9

I am running VirtualBox both on a Snow Leopard OSX host machine and on a Windows Vista host machine. Whenever my host machines lose internet connection the guest machines seem to lose internet connectivity permanently even after the host connection to the Internet is reestablished.

Resetting guest networking on the guest os, disconnecting cable via host virtualbox settings, and even restarting the guest OS do not help at all. The guest no longer can access the Internet. The only solution is restarting VirtualBox itself while the host is connected to the Internet. This really gets to be a pain when the host goes into sleep mode or I disconnect my laptop at work and then reconnect at home.

Guests are setup with NAT networking. It affects guest machines with both Ubuntu and Windows XP OS'es.

Is this expected behavior? Does anyone know of a fix? Or am I setup incorrectly?

3
  • I'm not too familiar with VBox, but this sounds like a problem with the NAT'ing that VBox is trying to do, and maybe a hiccup in the route between the 'private' network and the 'public' network. Can you post ifconfigs and traceroutes?
    – Guamaniac
    Feb 25, 2010 at 1:46
  • 1
    Cross posted this question in the VirtualBox forums and got this response: "It is unwanted but expected behaviour, a workaround is possible but not for the faint hearted it involves sharing a hostonly link via ics for a Guest via the Host. Ics can recover from a disconnect, VBox nat can't." Feb 25, 2010 at 5:20
  • @Guamaniac So, while attempting to recreate the problem I found that the host->router disconnection alone is not unrecoverable. When I disconnect host->router wireless network manually then reconnect the guest recovers its connection to the Internet. Normally I experience the problem when I put my machine to sleep and try to reconnect it minutes/hours later. I'll do some more testing to see when the guest goes unrecoverable and run a traceroute when I get it to happen. Feb 25, 2010 at 5:57

3 Answers 3

4

NAT on VirtualBox is not that good you might want to try Host-only with some "host natting" as explained in this article : http://akutz.wordpress.com/2009/08/20/building-a-better-os-x-firewall-or-how-i-solved-the-nat-problem-for-virtualbox/

2

I operate different virtual servers here and had similar problems (and more) when using NAT. What works best for me is using bridged conenctions: Create a network bridge on the host OS (basically not bridging anything but the primary network connection) and use bridged networking in VirtualBox using the newly created bridge. My hosts are Windows Vista and Windows 7, Clients Windows Server 2008 and debian.

This will put your clients in the same net as your host and therefore make host and client see each other as well as different clients see each other (if you have mutliple clients on the same host).

I don't know if there are any side effects and do have no clue about the technical background of bridging, however, so take this advice with special caution.

0

I stumbled upon this bug report for Virtual Box from years ago. See the last post where harrisp says:

I may have found a solution to this and possibly the reason it happens.

Changing the adapter type to PCnet-FAST III (Am79C973) seems to be working for me. The connection is not being lost anymore.

The previous adapter type I was using was Intel PRO/1000 MT Desktop (82540EM)

I too changed from Intel Pro to PCnet-Fast and the problem is gone! FYI

A COUPLE DAYS LATER...

I have since discovered that even with PCnet-Fast in place instead of Intel Pro, loss of network (either thru ethernet unplugged or router rebooted) causes all of the guests running on my Windows 10 host to get their networks messed up - while the host itself has recovered perfectly...

Unlike when using the Intel Pro, I have found that I do NOT need to reboot the host. But I have to terminate and re-start ALL of the running guests on that host in order to recover their network connectivity. Interestingly, at least on some occasions after the host's network has recovered, I found that connectivity between host and guests was ok (ie, I could ping from the host and get replies). However, the guests were NOT able to connect any further so pings from anywhere else on the LAN other than the host would still fail.

I guess what I will have to do is create a Windows Event Manager task linked to the restoration of the LAN at the host level and have that trigger a termination and re-start of the guests.

This seems better than a reboot of the host. But not by much!

You must log in to answer this question.

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