Debian on Hyper-V

12,077

Solution 1

Stay away from any in-kernel Hyper-V drivers based on anything let's around say 3.0, since early version were considered staging and were sometimes utterly unstable.

Hyper-V drivers got fully integrated upstream (moved out of staging) with 3.4. While Debian Wheezy (7.0) will be based on 3.2, it will contain a backport from Kernel 3.4, I'm using it here.

Thus said for squeeze: Install with legacy NIC and IDE only drives, then get the Wheezy kernel from squeeze-backports and reboot. Then you'll be able to use paravirt NIC, SCSI disks, additionally you'll get mouse integration and support for more than 1 vCPU.

Solution 2

Debian Wheezy (7.0) contains a backport Hyper-V drivers from Kernel 3.4

But the Hyper-V kernel modules, at minimum:

  • hv_vmbus
  • hv_utils
  • hv_storvsc
  • hv_netvsc

are missing in the installer image of Debian Wheezy created before 2012-11-13

Solution:

You need use .iso created after 2012-11-14, or the .iso by Arnaud Patard

See details here.

Solution 3

Here is how to install Debian 7 (wheezy) on hyper-V. Currently, the netinst image doesn't contains the hyper-v drivers. (tested with netinst beta 2). You may replace your network card by a legacy network card, but it won't be enough since the debian Netinst does not detect the disk, so you can't install anything.

The solution I use is to download the Debian 6 netinst "business card". Add a "legacy network card", and boot on the install disc.

When netinst ask you for the hostname for your new system, switch to another console (Alt-F2) and type

echo wheezy > /etc/default-release

Then return to the first console (Alt-F1) and proceed. At the end of the installation, you will have a working Debian 7 (Wheezy), with modern kernel that support Hyper-V. So you may remove the legacy network card and use the native driver for network and disk.

Solution 4

Check this out: http://docs.homelinux.org/doku.php?id=using_linux_ic_with_debian_squeeze the kernels there have the storvsc ata_piix fix ;)

Solution 5

If you are running Debian 6.0 (Squeeze), You can upgrade to 7.0 (Wheezy), it’s so simple:
just answer Y every time.

apt-get update
apt-get upgrade
nano /etc/apt/sources.list

and replace every squeeze with wheezy, CTRL+X, Y,enter.

apt-get update  
apt-get upgrade  
apt-get dist-upgrade  
reboot  

your new kernel will be selected, login, then you can lsmod | grep hv and see the hyper-v modules loaded (hv_vmbus, hv_netvsc, hv_blkvsc, hv_storvsc), connect your non-legacy network adapter and do ip show link then you’ll see it (you can be sure by checking the MAC).
But why stay there?, now you can go to Debian 8.2 (jessie) by following the same instructions but this time use “jessie” on your sourcelist.
I wasn’t able to go directly from 6 to 8.
If you have trouble with “public key is not available” then follow instructions from here.

Sometimes running on Hyper-v it throws two errors:

Error: Driver ‘pcspkr’ is already registered  
SMBus base address uninitialized – upgrade bios or use force_addr=0xaddr  

to get rid of those errors just blacklist two modules by:

echo 'blacklist pcspkr' >> /etc/modprobe.d/fbdev-blacklist.conf  
echo 'blacklist i2c_piix4' >> /etc/modprobe.d/fbdev-blacklist.conf  

then do:

update-initramfs -u  
reboot  

Enjoy.

Share:
12,077

Related videos on Youtube

Tobia
Author by

Tobia

Updated on September 18, 2022

Comments

  • Tobia
    Tobia almost 2 years

    I installed Debian with kernel 2.6.32-5-686 on a Hyper-V virtual machine. I had to add a legacy network card. I follow this tutorial http://www.yusufozturk.info/linux-server/debian-2-6-36-kernel-upgrade-for-hyper-v-client-drivers.html to add Hyper-V driver but when I reboot with the new kernel i got this error:

    BLKVSC_DRV: blkvsc_probe() ERROR!! register_blkdev() failed! ret -16

    And at the very first boot log (that i can not copy because i did not find it in dmesg or boot log) i see a mount /dev error.

    Thank you.

  • Joel Coel
    Joel Coel over 11 years
    @Tobia that might be good fodder for a separate follow-up question
  • Tobia
    Tobia over 11 years
    Seems good, but is there also i386 version?
  • nokofi
    nokofi over 11 years
    By now this issue with thet netboot ISO has been resolved, you can now yank in the latest daily builds (and thus likely the final builds once it's you) and have working storage without additionaly hacking.