Page 1 of 1

Help needed fixing NAT

Posted: 30. Jul 2008, 04:43
by kokaku
I'm running Ubuntu Hardy with a WindowsXP guest. I've been trying without success to allow the Windows guest to access Apache running in Ubuntu. During the many attempts to get that working, I managed to screw up Windows so that it can't access the internet at all now.

Please be patient if my terminology is not quite right - I'm not a networking guru (if I were I wouldn't be writing this).

I see what's wrong but I don't know how to fix it...
The Windows guest IP address is now 192.168.x.y (instead of the default 10.0.2.0)
I thought that might allow me to access Ubuntu Apache but it didn't.
Doing that appears to have killed Windows inet access.

What I can't remember is how I remapped the NAT IP and how to get it back to the default.

I read something about vboxmanage modifyvm -natnet1 but -natnet1 is not a valid option in version 1.5.6_OSEr28240.

Does anyone know how to undo what I did to the NAT address?

Posted: 30. Jul 2008, 09:16
by Sasquatch
Set the network settings to DHCP and it will work again. If you want to access your webserver, use port forwarding as described in the manual, or use Host Interface.

Posted: 30. Jul 2008, 18:25
by kokaku
Thank you very much! There were so many things I had tried that I had forgotten messing around with netsh settings on the Windows command-line.

Here's the command if anyone else has this problem...
netsh interface ip set address name="Local Area Connection" source=dhcp

As to accessing the webserver, I tried both port forwarding and host interface without success (following several different sets of instructions both from the manual and found on various sites).

The documentation on port forwarding makes it sound like it's there to allow the host network to access a server running in the guest. In this case, I have a guest that needs to access a server running on the host. Is port forwarding still the right solution? (because it looks a lot easier to setup than host interface).

This is one site's advice that didn't work (my comment is the last one)
http://ubuntuforums.org/showthread.php?t=682519

And another (again, I have comments at the bottom)
http://herbee.fr/?q=VirtualBox-NAT

Thank you again - for helping me get a little closer to making this work.

Posted: 30. Jul 2008, 19:25
by Sasquatch
Ok, as I read it, I thought you had a server on the Guest you wanted to access from the Host and other systems on the network, not that you have a server running on the Host that you want to access from the Guest. You only need to connect to 10.0.2.2 from the Guest to access your Host if you use NAT. No additional config needed.

Posted: 30. Jul 2008, 23:04
by kokaku
Ah. Thank you again. I thought I'd tried that before but perhaps not quite the way I needed to. Appears to work now.