1

I don't (repeat DONT) want to passthrough a physical usb device. I'm making a usb img file like so:

dd if=/dev/null bs=1K of=/tmp/test_usb.img seek=2040
mkfs.vfat /tmp/test_usb.img

I am then attempting to create the domain with the following xml:

<disk type="file" device="disk">
    <driver name="qemu" type="raw/>
    <source file="/tmp/test_usb.img"/>
    <target dev="sda" bus="usb"/>
</disk>

Inside the windows guest, it shows up as a QEMU USB HARDDISK (or similar name), but I cannot access it. Now, I'm not intending for this to show up as a usb-harddrive. I want it to be a plain-old FAT32 USB.

How do I do this?

EDIT (added picture)

Properties of QEMU USB HARDDISK

d0c_s4vage
  • 111
  • 5

1 Answers1

0
  • First, you need to create drive like:

    dd if=/dev/zero bs=1K of=/tmp/test_usb.img bs=100M count=1
    

    Copy /dev/zero, not /dev/null

  • Second, check your domain for presence of usb controllers initialization options:

    <controller type='usb' index='0' model='ich9-ehci1'>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
    <master startport='0'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
    <master startport='2'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
    <master startport='4'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x2'/>
    </controller>
    
  • Thrid, you need to initialize new disks in windows guest:

    Steps from TechNet:

    1. Open Computer Management (Local).

    2. In the console tree, click Computer Management (Local), click Storage, and then click Disk Management.

    3. Right-click the disk you want to initialize, and then click Initialize Disk.

    4. In the Initialize Disk dialog box, select the disk(s) to initialize.

    An alternative way, you can make partition table on your hard disk at once after dd'ing. use parted or cfdisk utils for it.

kvaps
  • 223
  • 3
  • 9