I want to create multi-bootable USB with GRUB2. But I don't want to use physical USB stick to experiment with.How can I create virtual USB to play with it as it is real device using qemu? I want to boot guest machine from it, setup GRUB to it from guest OS and so on.Later, I want to be able to take the virtual image and copy it to my real USB stick. How could I do that? Perhaps with if=usb_image.vmdk of=/dev/sdx?
Boot from virtual usb drive in qemu-kvm
debian;usb;qemu;bootable
Are you using an abstraction layer such as libvirt? If so then simply add a disk image file as a USB Disk.If you're running kvm/qemu directly, then the man page (man kvm or man qemu) provides the answers:USB options:-usb Enable  the USB driver (will be the default soon)-usbdevice devname  Add the USB device devname.disk:[format=format]:file  Mass storage device based on file. The  optional format argument will be used rather than detecting the  format. Can be used to specify format=raw to avoid interpreting an  untrusted format header.So, something like this should workdd if=/dev/zero bs=1M count=8000 of=usb.img    # Create the usb disk imagekvm ... -usb -usbdevice disk:raw:usb.img      # Start kvm/qemuLater, you can run dd if=usb.img bs=1M of=/dev/sdX, but you should make sure your /dev/sdX really is the USB device! You'll also need to make your virtual image the same size as your stick (or smaller). Remember a 1GB stick is only 10^9 bytes, not 2^31 bytes.