Saturday, January 26, 2013

Debian 6.0.6 with Hyper-V networking support



What I did:
Install clean debian (with a legacy network adapter attached, using a fixed mac address)

Prepare build environment
apt-get update
apt-get install build-essential libncurses5-dev bzip2 linux-source-2.6.32
Unpack linux sources
cd /usr/src
tar -jxvf linux-source-2.6.32.tar.bz2
ln -s linux-source-2.6.32 linux
cd linux
Cleanup (not really needed because we just unpacked it all)
make clean
make mrproper
Configure kernel
cp /boot/config-2.6.32-5-amd64 ./.config
make menuconfig

 - Load an Alternative Configuration File
  - .config [OK]
 - General setup --->
  - Local version - append to kernel release
   - -hyperv (mind the hyphen in front of it)
 - Device Drivers --->
  - Staging drivers --->
   < >  VIA Technologies VT6656 support   (BUGFIX http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=568454) 
     Microsoft Hyper-V client drivers
 - Kernel hacking --->
  [ ] Compile the kernel with debug info
 Exit and save!
Build kernel
make
make modules_install
make install
depmod 2.6.32-hyperv
Create initramfs
mkinitramfs -o /boot/initrd.img-2.6.32-hyperv 2.6.32-hyperv
Update grub
nano /etc/default/grub
 Default=2 (To make the 3rd menu option selected)
update-grub
Add Hyper-V modules
nano /etc/initramfs-tools/modules
  hv_vmbus
  hv_storvsc
  #hv_blkvsc (THIS IS STILL BUGGY, SO WE DISABLE THIS FOR NOW)
  hv_netvsc
Some bugfixing...
nano /etc/modprobe.d/blacklist.conf
 #fix: Driver 'pcspkr' is already registered, aborting...
 blacklist snd-pcsp
 #fix: SMBus base address uninitialized - upgrade bios or use force_addr=0xaddr
 blacklist i2c_piix4
update-initramfs -u -k 2.6.32-hyperv
Fix networking
nano /etc/network/interfaces
  edit eth0 to seth0
poweroff
In Hyper-V settings remove legacy network adapter and add normal one
Start up, you will get an message saying: Fixing recursive fault but reboot is needed!
Just poweroff and power on again
You're done!

Known issues:
 - Mouse still isn't working
 - hv_blkvsc isn't working
 - When using more then 4 GB of memory you get SRAT: Hotplug area too small

1 comment:

faristol said...

Thanks for sharing! This saved my life :)