I am new to kvm, qemu and kernel hacking. I tried to set up a Debian guest running inside a kvm. I was able to install it and it booted up successfully. Now I have the latest kernel source from kernel.org. I compile it and try to load this kernel in the Debian box like this:
kvm -smp 2 -m 512 -kernel /home/arun/kernel/linux/arch/x86_64/boot/bzImage -append "root=/dev/sda1
However it results in a kernel panic with the following error:
VFS: Cannot open root device "sda1" or unknown-block(0,0): error -6
After some googling I understand that I have to give the initramfs via -initrd switch of kvm command. So I created the initramfs using the mkinitramfs tool. But qemu does not load it:
qemu: error reading initrd /home/arun/kernel/linux/arch/x86_64/boot/bzImage/initramfs
How to properly create the initramfs for the Debian host?