I am hosting a Debian 11 (no desktop environment) virtual machine on Windows Server 2012 with Hyper-V. This is on a company network with its own DHCP system and the MAC address of the VM is registered with a static IP address. The machine has been working fine since November and was originally installed with Debian 10. I recently went through the process of doing a full upgrade from Debian 10 to Debian 11 without reinstalling. The upgrade took a while but went fine, once I upgraded I realized that the PHP package server (packages.sury.org) was still set to be for Debian 10, so I updated it to pull packages for Debian 11 and began the update of the PHP packages I had. I was connected via SSH and before it completed, the terminal froze and I could not ping the server. When I logged in through Hyper-V, the VM had restarted and I could not ping any websites or IP addresses. The eth0 adapter starts as DOWN
and when brought back up, I would only get an IPv6 address and not IPv4.
After a significant amount of troubleshooting, the only solution I found was to manually invoke the dhclient command (sudo dhclient eth0
) and this finally pulls up the correct static IP address I had before the issue started. However, this is only a temporary fix and I have to do it again if/when the VM is restarted. I don't think that upgrading to Debian 11 caused the issue since I had been using it for a few hours at this point and restarted a few times. It only began once I tried updating the PHP packages, but I don't really know why that would cause the DHCP to stop working. The VM is still registered with my company's network.
Long story short, how do I get the VM to automatically get its static address again, and how do I make sure it starts in the UP state once the VM boots? If any more information is needed, please let me know. I added the previously mentioned command to the crontab to run on boot and that resolved it, but I was hoping to find a solution rather than a band-aid fix.