Test usb booting capabilities with qemu under linux

9,404

Solution 1

I found the answer, but can it be improved?

lsusb

Bus 001 Device 007: ID 152d:2329 JMicron Technology Corp. / JMicron USA Technology Corp. JM20329 SATA Bridge

sudo qemu-system-x86_64 -m 512 -enable-kvm -usb -device usb-host,hostbus=1,hostaddr=7

Solution 2

There is also this format that works:

sudo qemu-system-x86_64 -enable-kvm -m 256 -usb /dev/sdX

It's a bit nicer since you don't have to look up the device numbers.

Solution 3

The -usbdevice host:bus.addr flag is the right way to do this now. For example:

sudo qemu-system-x86_64 -enable-kvm -m 256 -usbdevice host:3.6

The root privileges (from sudo) are needed to access the usb device node (/dev/bus/usb/003/006 in this case). Without proper permissions or privileges, you will receive permission denied errors, and qemu will not see your device.

Share:
9,404

Related videos on Youtube

w0rldart
Author by

w0rldart

Updated on September 18, 2022

Comments

  • w0rldart
    w0rldart almost 2 years

    I am running Ubuntu Oneiric and just installed quemu to test if my usb device is bootable, because for some reasons, on my laptop the usb boots but on my desktop pc it shows Boot Erro

    So, does anybody knows how to test with quemu the booting capabilities of my StoreJet usb HDD ?