Friday, February 15, 2013

qemu is a Bitch

I was trying to use qemu to test a bootable USB drive and found out just how difficult it is to use.  There are like 1,000 command line options, some of which don't even work.

Good luck getting a log of the output.  There are literally like 4 different ways of logging the text generated in the qemu window to a text file, none of which could I get to work.

Speaking of things that don't work, the host keyboard commands do nothing.  That means there is no way to do a clean exit.  You have to click the x provided by the window manager.

Anyway, I'm going to post a few command lines in case there are others out there trying to make sure their bootable thumb drive is working.  Unfortunately you'll have to have quick eyes or use screenshots or something until I figure out how to log the output.  Perhaps some kind soul will provide a comment on how to do this.

To get a list of the USB devices on your system, issue an
lspci
It's up to you to figure out which device is your flash drive.

Once you figure this out,
sudo qemu -usb -usbdevice host:XXXX:XXXX -boot menu=on
Should get you going.  Replace the XXXX:XXXX with the vendor_id:product_id from above.  The beauty of this is that it passes the actual USB device to qemu.  This more closely emulates the behavior of an actual system startup.

No comments:

Post a Comment