Despite claims to the contrary [PDF], VirtFS — the 9P-based virtio KVM/QEMU layer designed to pass through a host’s filesystem to the guest — is quite slow. I have yet to get it to perform at even 1/10 the speed of the virtual block device (VBD). That’s unfortunate, because in theory it should be significantly faster. At this rate, I suspect even NFS will be significantly faster.
Beyond that, it seems impossible to use VirtFS as the root filesystem in a VM, at least with Debian; initramfs-tools doesn’t know how to build an initrd in that situation, and the support is just not there.
It would make a great combination with btrfs or zfs, but unfortunately looks to be just not ready yet.
VirtFS: a nice idea, but very slow. http://t.co/4uULGFSMuW #KVM #qemu #virtualization
Planet Debian: John Goerzen: VirtFS isn’t quite ready http://t.co/UDDVHzdOK9
John Goerzen: VirtFS isn’t quite ready http://t.co/my30x4KUXi #debian #linux
John Goerzen: VirtFS isn’t quite ready: Despite claims to the contrary [PDF], VirtFS — the 9P-based virtio KVM… http://t.co/fyR73g8Gku
John Goerzen: VirtFS isn’t quite ready: Despite claims to the contrary [PDF], VirtFS — the 9P-based virtio KVM… http://t.co/hEu3tSeooF
virtio-9p is indeed horribly slow; I really wish it was faster, since it’s wildly useful.
However, you *can* use it as the root filesystem; I’ve done so several times. You don’t even need an initramfs. Just have a kernel with the appropriate modules built in for virtio and 9p, pass the virtio-9p filesystem label as the root= parameter, and pass rootfstype=9p .
Interesting. How do you generate the initramfs for that, or are you building the kernel by hand?
“Just have a kernel with the appropriate modules built in for virtio and 9p”.
I’ve also done it with a hand-constructed initramfs.
Did you try to mount it with the cache option? (Using cache=fscache works quite well for me.)