Virtualbox CentOs guest intermittently loses internet connectivity after sleep on Mac Host

2

I am using centos 6.2 guest on a Mavericks host in VirtualBox 4.2.18.

The guest was working fine for maybe a few dozen sleep/wake-up cycles. But then the internet connectivity mysteriously disappeared. It has not returned again on multiple additional sleep/wake-ups.

Here is networking info:

Linux localhost.localdomain 2.6.32-358.18.1.el6.x86_64 #1 SMP Wed Aug 28 17:19:38 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[cloudera@localhost ~]$ ifconfig -a
eth1      Link encap:Ethernet  HWaddr 08:00:27:EB:4E:4D  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:600745 errors:0 dropped:0 overruns:0 frame:0
          TX packets:454956 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:424847635 (405.1 MiB)  TX bytes:46180137 (44.0 MiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:44851827 errors:0 dropped:0 overruns:0 frame:0
          TX packets:44851827 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:60169754058 (56.0 GiB)  TX bytes:60169754058 (56.0 GiB)

UPDATE After stopping the VM and restarting networking came back up. But .. is there a way to revive the internet connection without a restart?

javadba

Posted 2014-01-26T06:31:51.280

Reputation: 2 201

I have this same issue. Any luck? – thesmart – 2014-08-13T17:51:32.737

Networking on virtualbox seems to be hit and miss. With an Ubuntu Host - and the same CentOs Guest - I end up doing sudo service network restart pretty often. As mentioned here, on mac the solution is worse. – javadba – 2014-08-13T18:23:53.373

I ended up running this on Ubuntu guest every time host wifi changes: sudo dhclient -r && sudo dhclient eth0 and also using the bridged adapter. – thesmart – 2014-08-27T23:47:04.187

@thesmart I did something along the same lines: sudo service network restart – javadba – 2014-08-28T04:27:38.743

I have the same issue with a centos virtualbox on windows 8. Hey! sudo service network restart works! Since ya didn't make it an answer, ima steal it ; ) (feel free to steal back) – B T – 2014-09-08T18:32:46.170

ok i will ;) actually i'm the OP.. – javadba – 2014-09-08T19:48:54.890

Answers

0

The reliable way to obtain network availability without a restart is:

sudo service network restart

javadba

Posted 2014-01-26T06:31:51.280

Reputation: 2 201

why doesn't this work for me? What possible reasons to run down and check? – ahnbizcad – 2017-04-24T05:29:30.373