How to fix Ubuntu network hangs on client Hyper-V

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…

  1. 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
  2. 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
  3. 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
  4. 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?

About author View all posts

Rick


Warning: sizeof(): Parameter must be an array or an object that implements Countable in D:\home\site\wwwroot\wp-content\plugins\projectnami-blob-cache\project-nami-blob-cache.php on line 416

Fatal error: Uncaught WindowsAzure\Common\ServiceException: Fail: Code: 400 Value: The account being accessed does not support http. details (if any): <?xml version="1.0" encoding="utf-8"?><Error><Code>AccountRequiresHttps</Code><Message>The account being accessed does not support http. RequestId:87eb82c3-001e-0075-028e-f54ff4000000 Time:2021-01-28T15:59:21.8049479Z</Message><AccountName>ritgcache</AccountName></Error>. in D:\home\site\wwwroot\wp-content\plugins\projectnami-blob-cache\library\WindowsAzure\Common\Internal\Http\HttpClient.php:382 Stack trace: #0 D:\home\site\wwwroot\wp-content\plugins\projectnami-blob-cache\library\WindowsAzure\Common\Internal\Http\HttpClient.php(275): WindowsAzure\Common\Internal\Http\HttpClient::throwIfError(400, 'The account bei...', '\xEF\xBB\xBF<?xml versio...', Array) #1 D:\home\site\wwwroot\wp-content\plugins\projectnami-blob-cache\library\WindowsAzure\Common\Internal\RestProxy.php(141): WindowsAzure\Common\Internal\Http\HttpClient->send(Array, Object(WindowsAzure\Common\Internal\ in D:\home\site\wwwroot\wp-content\plugins\projectnami-blob-cache\library\WindowsAzure\Common\Internal\Http\HttpClient.php on line 382