# Hyper-V network drivers

## teg

Hi all, and sorry for my bad english  :Smile: 

I'm making some important project. I must create some virtual machines for Hyper-V with specific requirements. They'll be running as virtual firewalls, routers and other ISO/OSI Layer 2-4 machines - it's not important right now  :Smile: . I decided to use Gentoo - to build quite small, optimized environments. 

I have build 3 Kernels, added them to GRUB: 1. Gentoo Hardened 2.6.36-r9 x86-64 without networking; 2. Gentoo Hardened 2.6.36-r9 x86-64 with Tulip drivers; 3. Gentoo Hardened 2.6.36-r9 x86-64 with 'staging drivers -> Microsoft Hyper-V virtual drivers'

2nd option - Tulip drivers - is for Hyper-V Legacy Network Adapter, which is emulated "DECchip Tulip" - family network device. This device is slow, but it woks with no problems - always - and so, it's recommended i.e. as network adapter used during installation of operating system. This option works fine. But...

I need 3rd option working - fast network device. In Kernel, there are options to compile Microsoft's Hyper-V staging drivers for Microsoft virtual network interface. They add support for Hyper-V virtual network adapter. They can be only added as modules (why?). I compiled kernel with this options enabled - everything went just fine. But when I start my virtual machine with this kernel, it stops:

* Starting udevd ...                                                                       [ok]

* Populating /dev with existing devices through uevents ...               [ok]

* Waiting for uevents to be processed ...

And it just stops. I can wait for an hour - and nothing happens  :Sad:  I was working for long time to build system for my requirements, it's fast, it contains only things I need - but I have to make that damn Hyper-V network device working:/

Please help me with this. I spend all day trying to solve this problem.

----------

## Shining Arcanine

Use this guide to compile your kernel:

http://www.kernel-seeds.org/

Following it usually resolves problems.

Also, make sure that your CFLAGS are not configured to generate instructions that the host machine's processor cannot understand.

----------

## teg

Nice site, but it helps me with nothing, i'm afraid  :Sad:  There is nothing about Hyper-V kernel modules. 

My system boots with no problems when I select options in my GRUB menu: 1 or 2, but when I select 3rd option, it boots normally, but it stops on "waiting for uevents...". When I reset my virtual machine - I can boot from option 1 or 2, booting option 3 makes it stop again od "waiting..". So I'm sure that these Microsoft drives are problem. Or maybe I missed something? I know from this forum, that there are people who just compiled Microsoft modules and it's just working :/

----------

## Shining Arcanine

 *teg wrote:*   

> Nice site, but it helps me with nothing, i'm afraid  There is nothing about Hyper-V kernel modules. 
> 
> My system boots with no problems when I select options in my GRUB menu: 1 or 2, but when I select 3rd option, it boots normally, but it stops on "waiting for uevents...". When I reset my virtual machine - I can boot from option 1 or 2, booting option 3 makes it stop again od "waiting..". So I'm sure that these Microsoft drives are problem. Or maybe I missed something? I know from this forum, that there are people who just compiled Microsoft modules and it's just working :/

 

What Microsoft modules? How did you compile them?

I suggest booting your virtual machine with System Rescue CD. Then follow the guide at kernel-seeds.org. If you follow it, you should eventually reach a stage at which it will tell you to use the Debian HCL, which will tell you what drivers you need for your virtual hardware.

----------

## minimaul

To get Gentoo working well in Hyper-V, literally all I've _ever_ had to do is get a recent gentoo-sources kernel and compile the modules in from staging. Run a make && make modules_install and you should be done. For reference, my virtual machines are all 64-bit machines running gentoo-sources-2.6.36-r1 to gentoo-sources-2.6.37. I'm not using Gentoo Hardened - just vanilla Gentoo.

I end up with several modules: hv_blkvsc, hv_netvsc, hv_storvsc, hv_timesource, hv_utils and hv_vmbus. You might want to try loading hv_vmbus, hv_netvsc, hv_blkvsc and hv_storvsc in /etc/conf.d/modules.

----------

## teg

I'm talking about Microsoft modules that can be compiled in kernel, that are in kernel sources, modules for Hyper-V hardware emulation of network card etc., these modules are in 'staging ->> Microsoft...'. 

I'm talking about these modules - here is an example for Debian, where You can see them on screenshots from 'make menuconfig':

http://blog.allanglesit.com/Blog/tabid/66/EntryId/44/Hyper-V-Guests-Compile-Linux-2-6-32-on-Debian.aspx

 *minimaul wrote:*   

> get a recent gentoo-sources kernel and compile the modules in from staging. Run a make && make modules_install and you should be done. 
> 
> I end up with several modules: hv_blkvsc, hv_netvsc, hv_storvsc, hv_timesource, hv_utils and hv_vmbus. You might want to try loading hv_vmbus, hv_netvsc, hv_blkvsc and hv_storvsc in /etc/conf.d/modules.

 

I just did all of this  :Smile:  I have ready 2.6.36-r9 kernel with those modules compiled - staging ->>Microsoft. It's my "3rd option" in GRUB (please see my first post). 

I have all hv_* modules from 'staging' compiled and "make_install'ed".  But when I run system with this kernel, it boots normally, but then it stops at "* Waiting for uevents to be processed ... ". Like something is going wrong with udev. When I boot this system with 'standard' kernel (my 1rst option in GRUB), it don't stop on "* Waiting for uevents to be processed ... " - it goes through that and I can login and I have have network connection through "Legacy" drivers in Hyper-V.

I just want to have situation like minimaul - just compile hv_* modules and GO... but it stops ot that damn uevents... Maybe it's problem with 'hardened' edition? :/

----------

## teg

Ok, so I compiled the gentoo-sources instead of gentoo-hardened. It boots! But, it started only once - at the first time - and generated plenty of errors. Now, if I want to start it, I have to disconnect Nework Adapter in Hyper-V, because if I don't do it, it stops on udev events with erros, something like that:

```

[ 11.333821] Stack: 

[ 11.337316] Call Trace: 

[ 11/339378] Code: ff ff 48 83 7b 38 00 74 0d eb 1d 31 f6 e8 ba f7 ff ff 85 c0 74 12 4c 89 e7 e8 88 f9 ff ff e8 81 b5 ff ff 49 89 c4 eb a7 fb 41 5b <5b> 41 5c 41 5d c9 c3 55 48 c7 c0 e0 f1 00 00 48 89 e5 41 57 41

```

[/quote]

If I disconnect Network Adapter in Hyper-V, it generates many errors like above, but I can login and use my system.

I tried:

```
 dmesg | less 
```

 to try to find out what's happening, and before that errors, there is something like that: 

```

BUG: sheduling while atomic: swapper/0/0x10000100

```

I recompiled the kernel without multiprocessor support but it doesn't help...

----------

