Tuesday, August 7, 2018

VirtualBox: Guest OS Loses Network Connection

Wow, its been 8 years since my last post. haha.

Well recently I found issue when dealing with VirtualBox and I think it will be best to put it here for other people experiencing similar problem.

One of the problem similar to this can be found in virtualbox website. https://www.virtualbox.org/ticket/6559


Environment:
VirtualBox 5 installed in host running under Ubuntu 16 with multiple network cards.
1 guest with same OS version with the host and set up with bridge mode. One of the host's eth was assigned directly to the guest.
Both host and Guest has static IP configured, and can access internet and ping each other without error.

Symptoms:
The issue occurs after a while (5-10 minutes). It appeared that the Guest Network is inactive. All ssh connection broken and new ssh will directed to the host not the guest.
Ifconfig working ok and display normal information. Testing connectivity to the internet by pinging to google.com, surprisingly bring the connectivity back.
After some googling, found some similar issues that the solution was using continuous ping to google
(just type ping google.com in the virtual box guest window)

Having try various methods to overcome this, for example:
  1. Modify Grup loader with parameter acpi=off apm=off
    But cousing problem in booting up guest. Must to log to safe mode and redo the change in grub loader config
  2. Changing to other Network Card on the Guest Network Setting
    Problem still exist
  3. etc.
Workaround:
Finally miracle happens, I try to change Promiscuous Mode from Deny to Allow All. The start the guest again. And wow the connection is maintained.
Ow forgot to mention my last Guest Adapter Network Type: is virtio-net. Previously it is Intel T Server, Don't know if this relevant though. But I will stick with this for a while, until issue for the adapter rised.

Actually I haven't verified whether this is permanent solution or not, but its been more than 1 hour since I changed the configuration, so I guest this can be marked as the answer.
EDIT: It is confirmed that the issue still occurs. The Real Solution had been found below.

Real Solution:
The real culprit of this issue was finally found. It is because the IP address. The current configuation: it the VMs' IP address defined in the host and the IP assigned in the VM itself is same IP. This seemed cause problem in the network, that some time the  network got lost due too network activation in both host and vm.
So to solve the issue we have changed the host eth ip, that is expected to use VM, to other IP address. So all host eth and guests' eth doesn't have same IP at all.

No comments:

Post a Comment