0

Have a Ubuntu guest in VirtualBox using NAT. It has an IP of 10.0.2.15. The VM can hit anything in the outside world. However, the host OS (Windows 7) cannot ping the internal VM ('Destination net unreachable').

Any tips on how to resolve this? Thanks!

8
  • 2
    Don't use nat, use a bridged interface?
    – Zoredache
    May 6, 2010 at 18:18
  • 1
    ARGH man I would if the network I was on allowed it, but thanks for not answering the question. May 6, 2010 at 18:21
  • 3
    @Wells-Zoredache was answering that way because this question has come up a LOT on the Internet, and 99% of the time bridging is the answer because of the funky way NAT worked on Virtualbox. Port forwarding was a PAIN and very limited when NATting the interface. In NAT mode, Virtualbox really does isolate the system quite heavily and you're going to have some gymnastics to get it to do anything beyond sharing a directory with the host as a mapped drive. May 6, 2010 at 18:42
  • @Wells Oliver, I don't use virtualbox and I don't know how to fix the private network to be usable from the host. I just thought I would double check that you had tried or ruled out the obvious solution based on my experience with other VM products.
    – Zoredache
    May 6, 2010 at 22:08
  • 1
    Similar question: serverfault.com/questions/110403/…
    – splattne
    May 14, 2010 at 14:23

3 Answers 3

1

According to the VirtualBox manual, a virtual machine with NAT acts like a computer connected to the Internet through a router. In other words, the virtual machine is in a private network behind the router and cannot be accessed by the host.

If you change the network adapter to "bridged", the host will be able to see your virtual machine. But, so does everyone else on the same network. I have tried this with Windows 7 host and Windows 7 guest. Windows 7 discover each other immediately.

The manual also mentions about port forwarding, but I am still learning from other experts. Sorry, cannot give any suggestion on this area.

No much real help. But, hope this give you some idea.

1

There is still the solution (not sure if VirtualBox will like that but...) to add another network card. One on NAT for contacting the outside world, and the other sharing a private network with the host. Normally it'll do the trick.

Hope this will help you

0

If NAT doesn't work (doesn't surprise me) and you can't use Bridged mode, create a Host-only network. A Host-only network behaves like a Bridged network, but there is no connection to the physical network. Essentially it creates a virtual switch and connects the virtual adapters to that. If you need an adapter on the host system, a Microsoft Loopback Adapter will likely work if VirtualBox doesn't supply virtual host adapters.

If you need to get to the Internet from the guest as well, create an additional network adapter in the guest which uses NAT.

Be sure not to create any virtual or physical networks on the same IP subnet. They are separate networks and must be configured with different IP subnets or your computer will send data packets to the wrong location! Your communication will silently fail, as you will have essentially told your computer to turn left when it needed to bear right.

This is trivial to configure on VMWare Workstation with the Virtual Network Editor. I haven't used VirtualBox since v2, but I can see from the manual that this type of configuration is possible.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .