# Gentoo physical to virtual Hyper-V Migration

## vladixx

Hi all!

I would like to ask someone of you for help. I have a physical server with Gentoo Linux webserver 3.0.4-hr5 #2 SMP Tue Dec 13 13:33:26 CET 2011 x86_64 Intel(R) Xeon(R) CPU E5520 @ 2.27GHz GenuineIntel GNU/Linux that I would like to move to a virtual machine with Microsoft Hyper-V 2012 host. I have one disk of two from RAID within the physical machine, which I chrooted in (in virtual machine) from gentoo livecd, tried to create initramfs with modules for hyper-v (because of kernel panic: VFS: Cannot open root device 0x0801 or unknown-block(8,1)) - had to do it manually without genkernel or mkinitrd, and failed. Genkernel cannot be installed because of dependency circle which I tried to solve by installing GCC and GLIBC separately but both fail, mkinitrd is not found by portage. Physical machine has LILO, on virtual I installed GRUB because of initrd...

Can someone please help me with creating the correct initramfs with all the modules I need? Thank you in advance.

----------

## DirtyHairy

If you are not depending on any external modules, it might be easier to just build into the kernel whatever it need to boot.

----------

## vladixx

 *DirtyHairy wrote:*   

> If you are not depending on any external modules, it might be easier to just build into the kernel whatever it need to boot.

 

Hyper-V modules can be considered external, afaik, they cannot be built into the kernel so I need initramfs...

----------

## DirtyHairy

Mmmh, I don't want to doubt your sources, but when I just tried with linux 3.8, I had no problems with selecting the Hyper-V stuff for compilation into the kernel. Of, course I cannot test the actual function  :Wink:  Apart from that, I can only link the gentoo wiki page (as I have no experience with building an initramfs) http://en.gentoo-wiki.com/wiki/Initramfs

----------

## vladixx

Whatever I do I always end up either in rescue shell without seeing /dev/sda or on kernel panic - No init found. I am desperate as I need to boot the virtual machine asap because physical hardware is dying slowly but surely... In my kernel version there is only possibility to modularize hv_* modules, no way to build them into the kernel.. Updating the kernel through 

```
emerge -Dup world 
```

 ends up on gcc and glibc circular dependencies... Is anybody able to help me? Please?

----------

## DirtyHairy

Could you repost the circular dependency issue to the Portage & Programming part of the forum, together with the actual errors? Circulars are in my experience often caused by certain useflag combinations and can in this case usually be broken by temporarily disabling an useflag. No way to tell for sure without the output, though.

As for the Hyper-V modules: you have to make sure that their dependencies are also selected as built-in. If any of those are selected as modules, you won't be able to compile the Hyper-V stuff into the kernel. You can see the dependencies by selecting help in menuconfig. On my kernel, the interesting bits are ACPI, NLS and CONNECTOR.

----------

## vladixx

OK, went around circulars, downloaded sources for newer kernel, compiled, now booting, but get stuck on other things:

first error http://imagebin.org/255753 (boot continues over)

second error http://imagebin.org/255754 (this appears straight after hv_vmbus: Hyper-V Host-OS Build:.... )

.config http://pastebin.com/t2v2N4bn

----------

