I am trying to get qemu-kvm to boot from my live usb stick. Is this possible?
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).
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.)
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.
If you want to use an image of a liveusb, instead of a physical USB stick, you can do that with
$ kvm -usbdevice disk:/path/to/liveusb.img -boot menu=on ...
Without "-boot menu=on", kvm will always prefer the hard drive that you set with "-drive" or "-hd[a|b|c|d]".