Since the ".vmdk" file is plugged into the USB 2 controller of your virtual machine, programs that you will use in your virtual machine will see this ".vmdk" file as a real USB key.
You can therefore for example test the creation of a bootable USB key in a virtual machine without having to buy a real USB key for your tests.
For the demonstration, we are going to create a bootable USB key from the "Ultimate Boot CD" live CD that many IT scientists know.
The creation of the bootable USB key is done without problem.
The virtual bootable USB key has been created.
To boot a VMware Workstation virtual machine on a (real) USB key, refer to our "VMware Workstation 16 / 15 - Boot on an USB key" tutorial.
However, in summary, our virtual machine is configured to use a standard BIOS (and not the EFI firmware which is not supported by UBCD) and we use the "Plop Boot Manager" boot manager in iso format since the boot on an USB key is not possible from the phoenix BIOS of VMware Workstation.
The "Plop Boot Manager" boot manager appears and we select "USB" to boot from our virtual USB key.
As expected, our virtual machine boots on our virtual bootable UBCD (Ultimate Boot CD) USB key.
Although this is not a problem for the majority of you, be aware that the ID of this virtual USB key will change each time your virtual machine starts.
This can be a problem in a specific case if a program uses the unique identifier (ID) of the USB key used in its configuration file (but this case would be very rare).
To see this change, just launch the Windows Device Manager and open the properties of your virtual USB key.
In the "Details" tab, select the "Device instance path" item.
Then, use the horizontal scroll bar and look at the hexadecimal value (a sequence of numbers and letters) at the end.
Shut down the virtual machine and restart it.
Go back to the same place and you will see that the value has changed.
To rename a ".vmdk" file, you can't simply rename the file from the file explorer.
Indeed, as you can see, its name is also inside the ".vmdk" file.
To correctly rename a ".vmdk" file, open a command prompt and move back to the VMware Workstation folder :
Batch
cd "C:\Program Files (x86)\VMware\VMware Workstation"
Then, use the "-n" parameter of the "vmware-vdiskmanager.exe" program by specifying :
Which gives in our case :
Batch
vmware-vdiskmanager.exe -n "H:\Win 10 v2004 Pro x64\virt-usb-key.vmdk" "H:\Win 10 v2004 Pro x64\virt-usb-key-renamed.vmdk"
Plain Text
VixDiskLib: Failed to initialize PhoneHome library. Renaming completed successfully.
Note that the command only takes a fraction of a second.
If you open the "vmdk" file with Notepad ++ (for example), you will see that a unique identifier (called "uuid") is present in it.
However, by default, you can't use 2 virtual hard disks which have the same "uuid".
If you want to create a copy of your virtual USB key and use the 2 vmdk files at the same time, then just convert the ".vmdk" file to the same format.
Thus, the destination file will be almost identical to the source file. Only the unique identifier (uuid) will have changed.
Batch
vmware-vdiskmanager -r "H:\Win 10 v2004 Pro x64\virt-usb-key.vmdk" -t 0 "H:\Win 10 v2004 Pro x64\virt-usb-key-copy.vmdk"
Plain Text
VixDiskLib: Failed to initialize PhoneHome library. Creating disk 'H:\Win 10 v2004 Pro x64\virt-usb-key-copy.vmdk' Convert: 26% done.
When the conversion is complete, this message will be displayed.
Plain Text
Virtual disk conversion successful.
Note that this doesn't solve the problem with the identifier (ID) of the virtual USB device which will continue to change each time the virtual machine is started.
We can now use our 2 virtual USB keys at the same time by also adding :
Plain Text
ehci:1.present = "TRUE" ehci:1.deviceType = "disk" ehci:1.fileName = "virt-usb-key-copy.vmdk" ehci:1.readonly = "FALSE"
As you can see, converting the virtual disk did change the uuid of the ".vmdk" file.
As before, double-click on the ".vmx" file of your virtual machine so that VMware Workstation uses the new parameters you just added and launch it.
Once the virtual machine is started, you will see :
In the guest OS file explorer, we will also have these 2 USB drives.
VMware 3/16/2013
VMware 2/7/2020
VMware 12/24/2021
VMware 12/10/2021
Pinned content
Contact
® InformatiWeb-Pro.net - InformatiWeb.net 2008-2022 - © Lionel Eppe - All rights reserved.
Total or partial reproduction of this site is prohibited and constitutes an infringement punishable by articles L.335-2 and following of the intellectual property Code.
Show comment