Running a Linux distribution, such as Debian, in a virtual machine on Microsoft Hyper-V is really quite easy now that Linux Integration Services (LIS) has been added to the Linux kernel. Linux Integration Services provides Hyper-V specific drivers for network, video and storage devices, as well as providing Hyper-V services like time synchronisation and guest shutdown.
Create Virtual Machine
There are two specific configuration options required when creating a new Hyper-V Generation 2 virtual machine to run Debian:
- Secure boot must be disabled, as it is not currently supported by Debian; and
- Dynamic Memory should be disabled, as the version of Linux Integration Services (LIS) included with Debian does not currently support dynamic memory allocation.
Otherwise, virtual machine sizing (processors, memory, storage, etc) can be as per the Debian System Requirements.
Once a new virtual machine has been created, Debian can be installed normally – either over the Internet, or from the ISO media.
When the installation is complete, log in as the root user.
Microsoft recommends using the NOOP scheduler for best disk I/O performance. To change the scheduler in Debian, the
elevator=noop instruction needs to be added to kernel parameters line in the grub configuration file. The line will appear similar to the following:
To make this change, run the following commands from a terminal console or command line:
sed -i '/GRUB_CMDLINE_LINUX_DEFAULT/ s/^\(.*\)\("\)/\1 elevator=noop\2/' /etc/default/grub update-grub
The virtual machine must be rebooted before this change to the scheduler will take affect.