I find I need to run various Linux distros on my work machine for my new job on the Azure Compute team. While I still run Windows 10 as my primary OS (sorry – app compat reasons) – I have installed Hyper-V Client so I can at least switch out to whatever distro I need for the task at hand. Things were working great for the most part, until i left the machine running in the background or for extended periods of time.
Then it started to happen. The network stack would say it’s up and happy, but nothing was working. This happened a lot while i was using Ubuntu and I couldn’t figure it out. After some back and forth with some networking guys and virtualization guys – the following was suggested…
- Disable network-manager: It just doesn’t play well with virtualized NICs and the way most hypervisors work. Sure it’s supposed to make wireless easier and things like that, but it’s not required in a virtualized environment where your network stack isn’t going to be changing on ya.
- $ sudo systemctl stop NetworkManager.service
- $ sudo systemctl disable NetworkManager.service
- Disable avahi: it seemed to be the main culprit that was causing the freezing / wonkieness of the network stack.
- $ sudo apt-get purge -y avahi-daemon avahi-utils libavahi-core7 libavahi-gobject0
- don’t forget to edit your /etc/network/interfaces file to include the necessary info to enable DHCP on eth0
- $ sudo -H gedit /etc/network/interfaces
- edit or put in an eth0 reference I added in the following and saved the file.
- auto eth0
- iface eth0 inet dhcp
- after saving and exiting the file, restart your network
- sudo /etc/init.d/networking restart
- Install the updated virtual kernel, Linux tools and cloud tools (if they aren’t already present).
- $ sudo apt-get install linux-virtual linux-tools-virtual linux-cloud-tools-virtual
Low and behold – things are now rock solid. I can leave my Ubuntu running all day, switch in and out of the VM without any issues and I know my networking stack will be in a consistent state without having to restart the VM.
Am I missing anything? Anyone else working with Ubuntu (client) inside of a windows client implementation of Hyper-V?