Installing and Configuring Debian Linux for Hyper-V
Let's continue our exercises in virtualizing Linux systems under Hyper-V. Today we will install and configure Debian 6 for Hyper-V. All that I will write below can be applied not only to Debian 6, but also to Debian 5 and other Debian based distributions such as Ubuntu, Kubuntu, Xubuntu, Ebuntu.
Debian is not included in the list of officially supported Microsoft Linux systems for running under Hyper-V. Despite this, he works in a virtual environment very well. Due to the fact that there is no official Hyper-V integration package for Debian, we will use the Hyper-V drivers built into the latest Linux kernels.
Installing Debian 6 under Hyper-V is pretty commonplace. The only thing you need to do at the stage of creating the virtual machine is to add the Legacy emulated network interface to the system. We will need it for the initial system update and installation of the latest Linux kernel.

After the installation of Debian 6 is complete, we will have a 2.6.32 kernel, of course it does not sparkle with novelty, but at the same time it is quite normal with multiprocessor virtual machines.

In order for the virtual machine to be able to work faster and take full advantage of Hyper-V, you need to update the kernel to at least 2.6.36. Before assembling a new kernel, we update the system, install the sources of the current kernel and all the necessary tools to compile the new one. Now let's start building the new kernel 2.6.36 taken from kernel.org. From the menu, select Device Drivers -> Stagging Drivers -> Microsoft Hyper-V Client Drivers. At this stage, you can also remove unnecessary drivers for devices that will never be in the virtual machine such as wifi, sound cards, USB, PCI. However, this is not necessary, if you do not wish, you can not do it. After that, we can start building deb kernel packages. In order to better distinguish the kernels, add hyper-v characters to the name.

Compiling the kernel takes quite a while. After that, two deb packages will appear in / usr / src that can be installed into the system using the dpkg –i command.
Also, these packages can be transferred and installed in other virtual machines with Debian so as not to repeat the compilation process.
We edit / etc / initramfs-tools / modules and add the following lines to load the necessary modules at system startup: Update initramfs: Turn off the virtual machine, remove the Legacy network adapter, add the synthetic network adapter and boot the machine with a new kernel. After that, check with lsmod | grep hv that all the modules necessary for Hyper-V to work were loaded.


Please note that in newer versions of Linux kernels the Hyper-V synthetic network interface has been renamed from seth to eth. This may be misleading. As usual, I tested the stability of a virtual machine, pumping through it for several days using scp for almost a hundred gigabytes of traffic. Virtual hard drives are also fast enough. The virtual machine works stably in a 4-processor configuration with 44 gigabytes of RAM. In general, we can conclude that Debian and the distributions based on it are able to work perfectly under Hyper-V and are used to implement infrastructure elements that work under heavy load.


Debian is not included in the list of officially supported Microsoft Linux systems for running under Hyper-V. Despite this, he works in a virtual environment very well. Due to the fact that there is no official Hyper-V integration package for Debian, we will use the Hyper-V drivers built into the latest Linux kernels.
Installing Debian 6 under Hyper-V is pretty commonplace. The only thing you need to do at the stage of creating the virtual machine is to add the Legacy emulated network interface to the system. We will need it for the initial system update and installation of the latest Linux kernel.

After the installation of Debian 6 is complete, we will have a 2.6.32 kernel, of course it does not sparkle with novelty, but at the same time it is quite normal with multiprocessor virtual machines.

In order for the virtual machine to be able to work faster and take full advantage of Hyper-V, you need to update the kernel to at least 2.6.36. Before assembling a new kernel, we update the system, install the sources of the current kernel and all the necessary tools to compile the new one. Now let's start building the new kernel 2.6.36 taken from kernel.org. From the menu, select Device Drivers -> Stagging Drivers -> Microsoft Hyper-V Client Drivers. At this stage, you can also remove unnecessary drivers for devices that will never be in the virtual machine such as wifi, sound cards, USB, PCI. However, this is not necessary, if you do not wish, you can not do it. After that, we can start building deb kernel packages. In order to better distinguish the kernels, add hyper-v characters to the name.
# apt-get update
# apt-get install build-essential ncurses-dev kernel-package fakeroot install linux-headers-2.6 linux-source-2.6.32
# cd /usr/src
# wget -c www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.36.tar.bz2
# bzip2 -d linux-2.6.36.tar.bz2
# tar xf linux-2.6.36.tar
# cd linux-2.6.36
# cp /boot/config* ./.config
# make menuconfig

# make-kpkg clean
# fakeroot make-kpkg --initrd --append-to-version=-hyper-v kernel_image kernel_headers
Compiling the kernel takes quite a while. After that, two deb packages will appear in / usr / src that can be installed into the system using the dpkg –i command.
Also, these packages can be transferred and installed in other virtual machines with Debian so as not to repeat the compilation process.
We edit / etc / initramfs-tools / modules and add the following lines to load the necessary modules at system startup: Update initramfs: Turn off the virtual machine, remove the Legacy network adapter, add the synthetic network adapter and boot the machine with a new kernel. After that, check with lsmod | grep hv that all the modules necessary for Hyper-V to work were loaded.
hv_vmbus
hv_storvsc
hv_blkvsc
hv_netvsc
# update-initramfs –u –k 2.6.36-hyper-v


Please note that in newer versions of Linux kernels the Hyper-V synthetic network interface has been renamed from seth to eth. This may be misleading. As usual, I tested the stability of a virtual machine, pumping through it for several days using scp for almost a hundred gigabytes of traffic. Virtual hard drives are also fast enough. The virtual machine works stably in a 4-processor configuration with 44 gigabytes of RAM. In general, we can conclude that Debian and the distributions based on it are able to work perfectly under Hyper-V and are used to implement infrastructure elements that work under heavy load.

