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

Enabling BitLocker with Group Policy and backing up Existing BitLocker recovery keys to Active Directory

So getting BitLocker enabled in an Active Directory environment is fairly painless and helps to get your end user devices more Secure.  I’ll outline the steps you need to take to enable it as well as get the recovery keys stored in Active Directory.  I’ll also dive into replicating this setup on Azure AD/Intune in […]

Sync multiple Pi-Hole Configs

For my home network, I run Pi-Hole in docker containers in separate hosts. Whenever making a change such as creating a local DNS entry on one Pi-hole means logging into the other Pi-hole and making the same change, not ideal. So I’ve tried looking for a solution to this. I did give Gravity sync a […]

BackupExec unable to read or write to the Database

Today when checking one of the servers I manage, I got an error when opening up the BackupExec 12.5 management console. The error was “Unable to read or write to the Database” which I found a bit puzzling. I checked to make sure SQL Server which hosted the BE database was running, and it was. […]