Help needed fixing NAT

Discussions related to using VirtualBox on Linux hosts.
Post Reply
kokaku
Posts: 3
Joined: 30. Jul 2008, 04:25

Help needed fixing NAT

Post 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?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
kokaku
Posts: 3
Joined: 30. Jul 2008, 04:25

Post 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.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
kokaku
Posts: 3
Joined: 30. Jul 2008, 04:25

Post 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.
Post Reply