Skip to content

Instantly share code, notes, and snippets.

@bjackman
Created September 26, 2019 09:08
Show Gist options
  • Save bjackman/f76a09a6b99cb3ec236617ef1793b4f9 to your computer and use it in GitHub Desktop.
Save bjackman/f76a09a6b99cb3ec236617ef1793b4f9 to your computer and use it in GitHub Desktop.
QEMU command to boot with host rootfs
KERNEL_IMG=~/sources/linux/linux/arch/x86/boot/bzImage
kvm \
-kernel $KERNEL_IMG \
-smp $(nproc) \
-m 2G \
-nographic \
-fsdev local,security_model=none,id=fsdev-root,path=/,readonly \
-device virtio-9p-pci,id=fs-root,fsdev=fsdev-root,mount_tag=/dev/root \
-serial mon:stdio \
-append "console=ttyS0 root=/dev/root ro rootflags=trans=virtio,version=9p2000.u rootfstype=9p lsm= init=/bin/bash"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment