Debian Guest reset network adapter ignores configuration on VirtualBox after snapshot restore


pungent

I'm using virtualbox 5.2 as host and Debian 9 as guest on Ubuntu 14.04.

I have configured my Debian guest system to have a static IP (192.168.56.101) with a host-only adapter (192.168.56.1/24) and no dhcp.

This config will be written to the /etc/network/interfaces.d/setupguest and works perfectly when the machine is booted regularly. The host can ping the guest, and the guest can ping the host.

However, if I take a snapshot and restore that snapshot later, the adapter is reset and the configuration is ignored. The host cannot ping the computer, and the machine cannot ping the host. A /etc/init.d/network restartsolution to the problem. So it can't be the adapter or the host, it has to be a problem on the client.

The reset itself is not the main problem, but blatant disregard for the configuration is the problem after the reset. I can wait a few seconds, but I can't manually log into the machine because it's unattended in production.

How to enforce network profile compliance after adapter reset?

dmesgThe only relevant entry on the guest is:

[...] pcnet32 0000:00:03.0 enp0s3: link down
[...] pcnet32 0000:00:03.0 enp0s3: link up, 100Mbps, full-duplex

While trying to find dirty cronjob hacks, I came across /var/logs/cron.logthis entry at :

..... debian systemd-timesyncd[297]: Network configuration changed, trying to establish connection
pungent

My solution was to have a Cron job every minute. The cron job checks if the network adapter has an IPv4 address. If not /etc/init.d/network restartrunning.

It's really ugly, but it solves the current problem.

Related


VirtualBox: Set the network adapter to be private to the guest VM

Tombstone 89 In the previous question, I asked how to configure m0n0wall in a VM. Now, I want to set up the network adapter in my computer to be used only for the guest VM, that is, to not allow any traffic from the host to go through. So far I haven't been ab

VirtualBox: Set the network adapter to be private to the guest VM

Tombstone 89 In the previous question, I asked how to configure m0n0wall in a VM. Now, I want to set up the network adapter in my computer to be used only for the guest VM, that is, to not allow any traffic from the host to go through. So far I haven't been ab

reset snapshot configuration

Wand Is there a way to reset the snapshot configuration back to what it was when it was first installed? For example, I can do snap remove --purge intellij-idea-educational But then I need to install it again, including big downloads. mook765 Downloaded snaps

Increase the resolution of Debian Guest in VirtualBox

Robert Franz I have a windows 7 host and a debian 8 guest. I have installed virtualbox-guest-utils virtualbox-guest-x11 virtualbox-guest-dkms As described in https://askubuntu.com/questions/3205/higher-screen-resolution-in-virtualbox . I can choose up to 1024

Increase the resolution of Debian Guest in VirtualBox

Robert Franz I have a windows 7 host and a debian 8 guest. I have installed virtualbox-guest-utils virtualbox-guest-x11 virtualbox-guest-dkms As described in https://askubuntu.com/questions/3205/higher-screen-resolution-in-virtualbox . I can choose up to 1024

reset network adapter

Apathy paralysis I have a VBScript here to "switch" my network adapter (built from a script on the internet). I was wondering if anyone could help me turn this into a script that would "reset" (disable, then re-enable) my wireless adapter instead of switching

Network failure in VirtualBox Guest VM

Best 103 I can't access the internet from a VirtualBox virtual machine on Windows 7 and Debian Linux. I need to fix the problem in order to get these VMs working again. I have a Debian laptop host that has been running VMware VMs in the past and now runs Virtu

Network failure in VirtualBox Guest VM

Best 103 I can't access the internet from a VirtualBox virtual machine on Windows 7 and Debian Linux. I need to fix the problem in order to get these VMs working again. I have a Debian laptop host that has been running VMware VMs in the past and now runs Virtu

Network failure in VirtualBox Guest VM

Best 103 I can't access the internet from a VirtualBox virtual machine on Windows 7 and Debian Linux. I need to fix the problem in order to get these VMs working again. I have a Debian laptop host that has been running VMware VMs in the past and now runs Virtu

VirtualBox bridge adapter for everything except guest hosting

entropy I have two PCs on wired LAN: ENTROPER-PCand KINICKIE-PC. ENTROPER-PCRunning VirtualBox with an Ubuntu Server instance named db1 using a bridged network adapter. All three computers are identified and issued 192.168.1.xIP addresses by the router. I can

VirtualBox bridge adapter for everything except guest hosting

entropy I have two PCs on wired LAN: ENTROPER-PCand KINICKIE-PC. ENTROPER-PCRunning VirtualBox with an Ubuntu Server instance named db1 using a bridged network adapter. All three computers are identified and issued 192.168.1.xIP addresses by the router. I can

VirtualBox network adapter fails to install

Gabriel The host-only adapter fails to install in Windows 8.1 x64 with VirtualBox-4.3.20-96997. When installing VirtualBox, "Host Only" shows up as a failed device in Device Manager. Therefore, "Host Only" is not visible in the Network Connections window. Rein

VirtualBox network adapter fails to install

Gabriel The host-only adapter fails to install in Windows 8.1 x64 with VirtualBox-4.3.20-96997. When installing VirtualBox, "Host Only" shows up as a failed device in Device Manager. Therefore, "Host Only" is not visible in the Network Connections window. Rein

VirtualBox error after deleting snapshot

Mazar I have a Windows 7 Professional 64bit virtual machine running on Ubuntu 14.04LTS. I deleted the old snapshot of this virtual machine. The removal process took over 30 minutes, and right at the end of the process, the laptop shut down unexpectedly. After

VirtualBox error after deleting snapshot

Mazar I have a Windows 7 Professional 64bit virtual machine running on Ubuntu 14.04LTS. I deleted the old snapshot of this virtual machine. The removal process took over 30 minutes, and right at the end of the process, the laptop shut down unexpectedly. After

VirtualBox Network Configuration

Ben Morel I have a CentOS 6.1 virtual machine virtualized using VirtualBox on Windows XP. This machine hosts my local development MySQL server. I want to find the correct network configuration in order to: My guest computer always has the same IP and is access

VirtualBox Network Configuration

Ben Morel I have a CentOS 6.1 virtual machine virtualized using VirtualBox on Windows XP. This machine hosts my local development MySQL server. I want to find the correct network configuration in order to: My guest computer always has the same IP and is access