I still don't understand about this drive number ID thing?
I have about 20+ different USB drives and I use them all with the same VM - I certainly don't want to create a VM for each of them! Especially as I have the same virtual HDDs attached to all of them.
I don't use a different vmdk for all of my USB drives. I just use one vmdk and one VM.
The only thing is that I have to make sure that when I connect a USB drive, it is connected as PhysicalDevice2 (as 0 and 1 and my internal HDDs). My vmdk is called USBPort2.vmdk and was made using the 2TB USB drive. I can plug any USB drive into my system and any of them will work with the same .vbox VM which has the USBPort2.vmdk storage attached.
So the only thing needed is to select the Physical Device number in the existing vmdk
This line in the vmdk seems to describe the size in sectors and drive number
# Extent description
RW 3906963456 FLAT "\\.\PhysicalDrive2" 0
So I would just want to select a VM and select a USB drive (or two).
Drive H: Lexar Jumpdrive
Your app would then look at the .vbox file, find the attached devices section, find the one which refers to the vmdk(s), change the vmdk to point to the correct PhysicalDevice number for the selected device (and poss. change size entry) and then run the VM.
So to launch from your app, I would select a VM and select a drive and click Start.
I am afraid I cannot send you the vmdk and vbox that I had the problems with as these have had to be deleted and re-created and I had to delete the snapshot and VBox Manager seems to object to me creating a snapshot now!