Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am creating a bootable USB flash drive. Before using it I would like to test it with VMware Player (or VirtualBox).

I could make a raw image of the UFD and convert it with "qemu"

qemu-img convert -O vmdk imagefile.img imagefile.vmdk

or I can use raw2vmdk.

My problem is that my UFD is very large when compared to the actual data stored on it (larger than the primary HDD on my system). So there is no room for the raw image and the vmdk file on my system.

Is it possible to make a raw image of the UFD based only on the actual data (used sectors)?

Or is it at least possible to have a direct process? UFD to VMDK without passing via a raw image?

I would like to avoid solutions with physical UFD which oblige me to keep my UFD plugged.

Obviously, after playing with the virtual machine, the reverse should be possible, i.e. copy the virtual drive onto the UFD.

share|improve this question
If you want to do this you will need to have additional storage. – Ramhound Aug 22 '13 at 11:29
up vote 1 down vote accepted

You can use VBoxManage, it comes with VirtualBox.

This'll create "transparent" virtual disk, which gives you direct access to specified device. VBoxManage internalcommands createrawvmdk -filename mydrive.vmdk -rawdisk \\.\PhysicalDrive0

Look here for more examples:

share|improve this answer
Thanks. Just one thing. Should my UFD be plugged only when running VBoxManage internalcommands createrawvmdk... or also after when I use mydrive.vmdk in the guest VM? – antonio Aug 22 '13 at 14:02
That image file act as kind of proxy, so you have to plug UFD. Never tried it, but I think that you can use clonehd parameter to clone your UFD partition through that mydrive.vmdk, to image with variable size. – week Aug 22 '13 at 14:30

for those wanting to convert the drive instead of using a transparent virtual disk, or link... (took me around 20 minutes to convert a 32GB USB drive to vmdk)

VBoxManage convertfromraw \\.\PhysicalDrive2 D:\VirtualMachines.vmdk --format vmdk
  • *\.\PhysicalDrive = number of your USB drive found in Disk Management
  • *D:\VirtualMachines = this is the path I used. can be anywhere.
  • *.vmdk / --format vmdk = the extension and chosen format should match.
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .