Menu
InformatiWeb Pro
  • Index
  • System admin
  • Virtualization

Login

Registration Password lost ?
FR
  • Windows Server
    • WMS 2012
    • WS2012 R2
    • WS2016
  • Citrix
    • Citrix NetScaler Gateway
    • Citrix XenApp / XenDesktop
    • Citrix XenServer
  • VMware
    • VMware ESXi
    • VMware vSphere
    • VMware Workstation
  • Microsoft
    • Hyper-V
  • RAID
    • Adaptec SmartRAID
  • UPS
    • APC Back-UPS Pro
  • InformatiWeb Pro
  • Virtualization
  • VMware
  • Courses
  • Learn in depth the VMware Workstation Pro virtualization solution
  • Create a virtual USB key
49 / 52
  • Virtualize a physical computer (P2V) via Converter
  • Slice the virtual hard disk of a VM

Create a virtual USB key with VMware Workstation 16 or 15

  • VMware
  • 03 December 2021 at 09:52 UTC
  • InformatiWeb
  • 2/2
Previous page

5. Virtual USB key test

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.

6. Automatic change of the virtual USB key identifier (ID)

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.

7. Rename the .vmdk file

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 :

  1. the full path of the source file
  2. the full path for the destination file

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.

8. Convert and/or change the uuid of the .vmdk file

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 :

  • 2 USB devices connected at the bottom of the VMware Workstation window
  • 2 USB drives in devices detected by Windows 10 installed as guest OS

In the guest OS file explorer, we will also have these 2 USB drives.

Share this tutorial

Partager
Tweet

To see also

  • VMware Workstation - Boot a VM on the BIOS / EFI firmware

    VMware 3/16/2013

    VMware Workstation - Boot a VM on the BIOS / EFI firmware

  • VMware Workstation 15 - Installation on Linux

    VMware 2/7/2020

    VMware Workstation 15 - Installation on Linux

  • VMware Workstation 15 - Slice the virtual hard disk of a VM

    VMware 12/24/2021

    VMware Workstation 15 - Slice the virtual hard disk of a VM

  • VMware Workstation 15.5 - Convert a Virtual PC virtual machine to a VMware VM

    VMware 12/10/2021

    VMware Workstation 15.5 - Convert a Virtual PC virtual machine to a VMware VM

Comments

Show comment

Share your opinion

Pinned content

  • Software (System admin)
  • Linux softwares
  • Our programs
  • Terms and conditions
  • Share your opinion

Contact

  • Guest book
  • Technical support
  • 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.