Today we will be installing and configuring Debian 6 under Hyper-V. All that I will write below can be applied not only to Debian 6 but also in Debian 5 and to the rest of the other distributions based on Debian, such as Ubuntu, Kubuntu, Xubuntu, Ebuntu.
Debian is not included in the list of officially supported Microsoft Linux systems running under Hyper-V. Despite this, he works in a virtual environment very well. Due to the fact that the integration components package for Hyper-V, we use Debian no Hyper-V drivers built in to the latest Linux kernel.
Installing Debian 6 under Hyper-V pretty banal. The only thing to do at the stage of creating a virtual machine is added to the system emulated network interface Legacy. He we will need for the initial installation and updates of the latest Linux kernel.
After the installation is complete, we will have 6 Debian kernel 2.6.32, of course it does not shine the novelty, but at the same time is quite normal with multiprocessor virtual machines.
To enable the virtual machine to run faster and take full advantage of the Hyper-V you need to upgrade your kernel to at least 2.6.36. Before building a new kernel update system, install the source code for the current kernel and all the tools necessary to compile a new one.
# apt-get update
# aptitude update
# apt-get install build-essential ncurses-dev kernel-package fakeroot install linux-headers-2.6 linux-source-2.6.32
Now begin to build a new kernel 2.6.36 taken from kernel.org
# cd/usr/src
# wget -c http://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
In the menu select Device Drivers-> Drivers-> Stagging Microsoft Hyper-V Client Drivers
At this point, you can remove the extra drivers for devices, which will never be in a virtual machine, such as wi-fi, sound cards, USB, PCI. However, this is not necessary if you do not wish to, can not do.
After that we can start to build deb packages. In order to better distinguish the kernel add the title characters of hyper-v.
# make-kpkg clean # fakeroot make-kpkg --initrd --append-to-version=-hyper-v kernel_image kernel_headers
Kernel compilation takes quite a long time. After this,/usr/src you will see two .deb package that can be installed into the system command dpkg-i.
These packages can be migrated and set other virtual machines with Debian in order not to repeat the compilation process.
Edit/etc/initramfs-tools/modules and add the following lines to indicate that you want to load modules at startup:
hv_vmbus hv_storvsc hv_blkvsc hv_netvsc
Create initramfs:
# update-initramfs –u –k 2.6.36-hyper-v
Turn off the virtual machine, remove the Legacy network adapter, add the synthetic network adapter and load the machine with the new kernel.
Please note that newer versions of Linux kernels, synthetic network interface for Hyper-V, renamed from seth in the eth. This can be misleading.