live-initramfs vs. Virtio
- Subject: live-initramfs vs. Virtio
- From: intrigeri at boum.org (intrigeri)
- Date: Thu, 07 Aug 2008 13:38:10 +0200
- Message-id: <[🔎] 85d4kloy1p.fsf@boum.org>
Hello,
I?d love Debian Live to support KVM+Virtio as a dev/testing
environment, and would be glad to document it on the wiki... once it
actually works. Hence this email.
My current use case is a custom usb-hdd image. I?m using a live-helper
package built from Git, and live-initramfs 1.136.3-1, since my built
images fail to boot with more up-to-date Git live-initramfs, with or
without Virtio, but this is for another e-mail.
,----
| The good news: virtio_net (not perfect, but still)
`----
The virtio_net network device works fine, but this module has to be
loaded soon enough, because the auto-detection happens too late for it
to be configured by dhclient (for the record, I added this module in
/etc/initramfs-tools/modules and in /etc/modules, maybe only one of
these would suffice). I may try latter to add out-of-the-box support
for virtio_net to live-helper.
,----
| The bad news (+ fix): virtio_blk
`----
When running the usual ??kvm binary.img, no problem, but when I try to
use Virtio (http://kvm.qumranet.com/kvmwiki/Virtio), with:
kvm -drive file=./binary.img,boot=on
... the live system boot fails (Unable to find a medium containing
a live file system). I end up in the ramdisk rescue shell, and was
able to investigate a bit:
This Virtio disk is present - as it should - as /dev/vda, its unique
partition as /dev/vda1. The /dev/disk/by-label/DEBIAN_LIVE link is
present as well, and /sys/block/vda/ looks nice.
Digging a bit more, I found out the itch:
'/lib/udev/path_id /block/vda' returns an empty string, and thus the
is_nice_device function considers such a disk as ??not nice??... and
the drive is then not searched for the live file system.
The following patch allows my live system to boot on a Virtio device.
(I could not find any guidelines for posting patches, so I?m simply
inserting the file generated by git-format-patch. I guess there?s
a better way...)
--- patch ------------------------------------------------------------
Reply to: