Yes, see for instance how to boot a VM with the FS of the host:
Add the 9p modules to the host initramfs (that's the easiest way albeit not the cleanest, to have an initrd with the needed modules):
printf '%s\n' 9p 9pnet 9pnet_virtio | sudo tee -a /etc/initramfs-tools/modules
sudo update-initramfs -u
qemu -kernel "/boot/vmlinuz-$(uname -r)" \
I have tried both and I am in fact running both in production environment.
nfs is rock stable, of acceptable speed, but once the guest starts reading a lot of files or reading quickly a huge file, the host performance goes very noticeably down. This is especially pronounced if you run several guests and they start accessing the filesystem at ...
Main goal of 9p filesystem is to provide easy and efficient way to share filesystems between host/guest and guests (compared to nfs and shared block devices).
By default no cache used in linux implementation of 9p filesystem (read kernel documentation), so it can be used to share same filesystem between guests.
As sensible an idea as this seems at first, do not do this. 9P in its current state cannot handle some fairly basic operations, including:
open()...unlink()...fstat() on a file.
9P at present is not in a fit state to be used in production.
While you can make a bootable system with 9P as the root file system, operating that VM will cause significant grief -...