Linux VM Performance on Hyper-V

, ,

I was recently on a call with a customer who had migrated their VMs to a new Hyper-V host (and away from VMWare) and had a few Ubuntu VMs for hosting their PHP stack of applications. Part of the call we were doing a review of some of the VMs and the customer complained that they were facing some performance issues with the Ubuntu VMs that they previously never had with VMWare.

Now while Linux Guest Support for VMWare is pretty much plug and play, the same cannot be said for Hyper-V. While the VM Guests are these days enlightened with some base integration services, Ubuntu still uses the generic kernel when being installed in Hyper-V, so there can be issues around integration services and performance around disk utilisation. So after the call with that customer, the action items were to adjust the kernel for these two VMs.

Microsoft recommend using the linux-azure kernel when running Linux under Hyper-V and if ever migrating into Azure. Switching Kernels is a fairly painless process, however isn’t fraught without danger (so make sure you backup or snapshot prior). Connecting to the VM, we firstly check the current kernel that is running by using the following command

uname -r

This returns linux-generic and confirms that we need to change, so we will now install the azure packages and kernel using the following command

sudo apt install linux-azure

While you can be more selective about what you’re installing, I’d generally just use this over-arching set of packages. Once saying yes to install and it completes, we need to reboot to load the new kernel. As the machine reboots, we should notice the heartbeat and network details get filled in as the Guest is now enlightened and providing information back to the Hypervisor.

There are other things to watch out for like file system block size matching your underlying storage infrastructure that can also hamper performance especially for systems with large files, so take note when creating the VM.


Leave a Reply

More Posts

Microsoft 365 Admin Notifications to your user mailbox with Plus addressing

Licensing your Entra Administrator accounts for email is a common practice to ensure you are across service health updates, user, security and billing alerts but by doing this it introduces security risks and additional costs for mailbox licensing. As a best practice, privileged accounts should remain isolated from unnecessary communication channels to minimise vulnerabilities or […]

Aruba Switches and Trancievers

Vendors tend to lock down the type of transceivers you can use on their SFP/SFP+ and QSFP ports. They do this for a number of reasons but mainly in the spirit of support and quality (which I can understand). there are a number of guidelines around agreed upon by networking vendors that fall under Multi-Source […]

Watch out when you enable DNS Scavenging and have a DirectAccess environment

So we had recently enabled DNS scavenging for a large environment who also had a DirectAccess server. The next day we were getting help desk calls about remote users not able to connect and those who were in the office unable to use their devices. One of the cornerstones of DirectAccess is DNS and the […]