LKBEN10901: How to Compile Linux 2.6.32 Kernel under Debian 5 to Support Hyper-V


Symptom

You would like virtualisation support for your linux system with hyperV

Cause

none

Solution

Install Debian 5 under Hyper-V with an old NIC in the Hyper-V Settings
After installation has finishe, log in as root and follow these steps...
apt-get install build-essential ncurses-dev kernel-package fakeroot zlib1g-dev
cd /usr/src
wget -c http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.1.tar.bz2
bzip2 -d linux-2.6.32.1.tar.bz2
tar xf linux-2.6.32.1.tar
cd linux-2.6.32.1
make menuconfig
- Select “Device Drivers”
- Select “Staging Drivers” (with a “*”)
- Deselect “Exclude Staging drivers from being build”
- Select “Microsoft Hyper-V client driver” (with a “M”)
- The Microsoft drivers should automaticly marked with an “M”
=> Exit the “menuconfig”
Edit “.Config”
- Set „#CONFIG_LGUEST_GUEST=n“
- Set „#CONFIG_LGUEST=n“
=> Save it
make-kpkg clean
fakeroot make-kpkg --initrd --revision=hv.custom.1.0 kernel_image
cd ../
dpkg -i linux-image-2.6.32.1_hv.custom.1.0_i386.deb
sed -i 's/eth/seth/g' /etc/network/interfaces
Edit “/etc/initramfs-tools/modules”
- Add “hv_vmbus”
- Add “hv_blkvscb”
- Add “hv_netvsc”
- Add “hv_storvsc“
=> Save it
update-initramfs –u –k 2.6.32.1
Edit “/boot/grub/menu.lst”
- Search for the new kernel entries and replace the boot device from “root=/dev/hda1” to “root=/dev/sda1”
- Think about: there are two sections for the new kernel (singleusermode)!
=> Save it
Note the MAC-Adress of your NIC
init 0
Replace the Hyper-V “old network adapter” against the Hyper-V “
standard NIC” an set the MAC-Adress to the noticed one of your old NIC
 

Should be all done!

Disclaimer:

The information provided in this document is intended for your information only. Lubby makes no claims to the validity of this information. Use of this information is at own risk!

About the Author

Author: Wim Peeters - Keskon GmbH & Co. KG

Wim Peeters is electronics engineer with an additional master in IT and over 30 years of experience, including time spent in support, development, consulting, training and database administration. Wim has worked with SQL Server since version 6.5. He has developed in C/C++, Java and C# on Windows and Linux. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform.