How do I boot from a liveusb using qemu-kvm?
qemu-kvm has disappeared. use the hint in start qemu by giving it a path to a linux root instead. this means
qemu-system-x86_64 -usb -usbdevice disk:/dev/sdb
where /dev/sdb is your raw device (not partition) of the usb stick that you want to boot.
(however, as of 12/2014, it's been flaky for me. booting ubuntu-gnome 14.10 results eventually in a kernel panic on a stick verified to boot just fine on the metal.)
/iaw
qemu-kvm -hdb <device>
, where <device>
is the USB stick (e.g. /dev/sdb
), should do it (tested with Ubuntu 12.04 on an USB stick and it works).
You will need write permission to the device (i.e. be root
or change its permissions).
I don't know why exactly, but Renan's answer didn't quite work for me. KVM said to me it couldn't find a bootable drive (despite the usb partition being marked as such).
However I've found another solution. Get the USB device VendorID:ProductID with lsusb. Example:
$ lsusb
...
Bus 002 Device 007: ID 0781:5406 SanDisk Corp. Cruzer Micro U3
Pass that to KVM, and ask for the boot menu:
sudo kvm -m 512 -smp 1 -drive file=/path/to/hardisk/file.img -usb \
-usbdevice host:0781:5406 -boot menu=on
Press F12 for the menu, choose the usb device, it works. There's probably a way to command the usb boot without needing to call the boot menu, but I didn't find any in man kvm.