Qemu

From vegard.wiki
Revision as of 07:27, 14 December 2019 by Vegard (talk | contribs) (kvm/9p)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Boot using host filesystem over 9p

kvm \
  -cpu host \
  -m 1G \
  -kernel arch/x86/boot/bzImage \
  -append "rootfstype=9p root=/dev/root rootflags=trans=virtio,version=9p2000.L rw console=ttyS0 init=/bin/bash" \
  -serial stdio \
  -fsdev local,id=fsdev0,path=/,security_model=passthrough \
  -device virtio-9p-pci,fsdev=fsdev0,mount_tag=/dev/root \
  -no-reboot \
  -display none

Remember to set the following variables in your kernel config (in order):

  • CONFIG_VIRTIO_PCI=y
  • CONFIG_NET_9P=y
  • CONFIG_NET_9P_VIRTIO=y
  • CONFIG_9P_FS=y