User:Renich/Funtoo on KVM/Qemu and Virtio
This article is still in development
In order for it to work, you need to make sure that you've enabled Virtio support on the kernel.
Contents |
[edit] Pre-Requisites
- You are following the Funtoo Linux Installation Guide.
- You figured out how to use Genkernel by reading the Genkernel Quick Start Tutorial.
- You are using the most current vanilla-sources
[edit] Procedure
Carry on until you reach the Configuring and installing the linux kernel section.
[edit] Step 1: Install Genkernel
emerge sys-kernel/genkernel
[edit] Step 2: Install the vanilla sources
emerge sys-kernel/vanilla-sources
[edit] Step 3: Start configuring and building the kernel
genkernel --menuconfig all
[edit] Step 4: Search and enable the essential Virtio drivers
To be able to search for all Virtio options, just type / on the TUI (Terminal User Interface) and, then, type 'virtio'. Please, consult: KVM's website in order to get a list of options available in the Kernel's config.
[edit] Step 5: Continue with Funtoo Linux Installation Guide
[edit] Testing
[edit] Boot the Guest
You should be able to boot the guest without problems. If you're using virt-manager, then just hit "play" on the Guest. If you're a commandline dude, please, issue the following command:
qemu-kvm -boot c -drive file=/var/lib/libvirt/images/funtoo.img,if=virtio -m 512
[edit] Troubleshooting
[edit] Determining root device fails
For some reason, on kernel 3.4.5, it fails to load the modules automatically. You can workaround it by adding:
doload=virtio_pci,virtio_blk
to the kernel line; at the grub prompt; at boot time. It should look something like this:
set timeout=3
set default=0
menuentry "Funtoo Linux genkernel - kernel-genkernel-x86_64-3.4.5" {
insmod part_gpt
insmod ext2
set root=(hd0,2)
search --no-floppy --fs-uuid --set 22b809f0-86be-422a-8bdd-6f4362da83ed
linux /kernel-genkernel-x86_64-3.4.5 real_root=/dev/vda4 doload=virtio_pci,virtio_blk
initrd /initramfs-genkernel-x86_64-3.4.5
set gfxpayload=keep
}
Once you boot, a permanent workaround should look like this:
mount /dev/vda2 /boot
cat /boot/grub/grub.cfg
set timeout=3
set default=0
menuentry "Funtoo Linux genkernel - kernel-genkernel-x86_64-3.4.5" {
insmod part_gpt
insmod ext2
insmod virtio_pci
insmod virtio_blk
insmod virtio_net
set root=(hd0,2)
search --no-floppy --fs-uuid --set 22b809f0-86be-422a-8bdd-6f4362da83ed
linux /kernel-genkernel-x86_64-3.4.5 real_root=/dev/vda4 doload=virtio_pci,virtio_blk
initrd /initramfs-genkernel-x86_64-3.4.5
set gfxpayload=keep
}