Create a Virtual USB Drive in VMware Workstation

Last Updated on May 31, 2026

Virtualization allows you to use the physical hardware on your computer (the host) as virtual hardware for your virtual machines (guests). This way its easy to add or remove hardware on your virtual machines (VMs) with just a few mouse clicks. By being able to do this, we can customize our VMs to suit the particular task that the guest computer was created for.

With VMware Workstation, its easy to add additional hard drives (virtual disks) and when you do so, Workstation simply creates a new VMDK file on your host computer. Then you simply need to add the new drive in the operating system that is running on your guest. You can even use the hard drive on the host itself as storage for your VM rather than making a new VMDK if you know how to do it. You can check out the process here.

Create a Virtual USB Drive in VMware Workstation

Even though you can attach a USB flash drive to a virtual machine in VMware Workstation, it is still shared via your host computer. When you remove it from your host, its removed from the VM as well. But there is a way to create a virtual USB drive on your guest virtual machine which will act more like a real USB drive rather than a shared one. We will force the software to build a dedicated USB controller.

Virtual USB Drive Creation Process

1. Open an Administrative Command Prompt

The first thing you will need to do to create a virtual USB drive in VMware Workstation is to create a new VMDK file on your host computer’s hard drive. To do this, you will need to open a command prompt on your host computer. You must open an administrative command prompt just to make sure things work correctly without permission errors.

2. Navigate to the Installation Directory

Once you have the command prompt open, navigate to your exact VMware Workstation installation directory. This folder should be located at C:\Program Files (x86)\VMware\VMware Workstation if you kept the defaults when installing the software. Type cd followed by that path and hit Enter to change your active working directory.

VMware Workstation installation directory
Navigate to the VMware installation directory via a command line

3. Execute the Disk Manager Command

Next, you will need to create the virtual USB drive’s VMDK file by using a specific executable command. Paste vmware-vdiskmanager.exe -c -a buslogic -s 32GB -t 0 “D:\VMware VMs\vm-usb-key.vmdk” into the terminal window. You will need to change the file path section to match the location on your hard drive where you want to create the VMDK file. You can also change its name if you do not want to use the one from the example.

4. Understand the Command Switches

In my example, I will be creating a 32GB virtual disk file using the buslogic adapter that will grow dynamically. The command relies on specific operational switches to function. The -c switch tells the program to create a new disk. The -a switch dictates the exact adapter type. We use the -s switch to set the file size limit. Finally, the -t switch combined with a 0 value creates a dynamically sized virtual disk in one single file.

5. Verify the Disk Creation Message

You will see a message that says Virtual disk creation successful if you typed in everything correctly. The system generates the raw storage container instantly. If you didn’t use the directory that contains the virtual machines other disk files in the command, then you will need to copy or move your new VMDK file to that directory manually. Once you create this VMDK file, you can use it for other virtual machines as well. You would just need to disconnect it from the other VM first.

Command Line create VMDK file in VMware Workstation
Create the virtual USB drive’s VMDK file

Editing the Virtual Machine’s VMX Configuration File

1. Locate the Working Directory

The next step involves making sure a couple of lines are in the VMX file for the virtual machine you want to attach the new virtual USB drive to. They should be there by default, but it doesn’t hurt to check. To do so, navigate to the directory that has the active files for your virtual machine. If you don’t know this location, then you can find it directly from the virtual machine’s settings menu under the Options tab.

VMware Workstation VM Working Directory
Choose the working directory for the VMX file

2. Open the VMX File in Notepad

The VMX file will have the exact same name as your virtual machine with a .vmx extension after it. You can open it with a basic text editor like Notepad by right clicking on it and choosing Open with. Do not use a rich text editor like Word.

3. Search for the EHCI Parameters

Then look for the required two lines or use the search feature to find them quickly. You are looking for ehci.present = “TRUE” and ehci.pciSlotNumber = “xx”. The xx in the second line will have an actual assigned number generated by the hypervisor.

Edit VMX file
Searching the VMX file for ehci.present = “TRUE”

4. Inject the Custom USB Lines

Next, you will need to add specific configuration lines to your VMX file. Copy the four lines below and paste them at the very bottom of the text document.
ehci:0.present = “TRUE”
ehci:0.deviceType = “disk”
ehci:0.fileName = “vm-usb-key.vmdk”
ehci:0.readonly = “FALSE”

5. Save the Configuration Changes

Just make sure the name for the ehci:0.fileName line matches the exact name of your previously created VMDK file. If the file names do not match perfectly, the virtual machine will fail to boot entirely. Then you can save your VMX file and double click it to open the VM in VMware Workstation.

Configure the Virtual USB Drive in the Guest Operating System

1. Start the Virtual Machine

Next you will need to start your virtual machine so you can have your guest OS configure the new virtual USB drive for usage. This process will vary depending on if you are using Windows or Linux as your guest environment. The operating system handles the new hardware injection automatically during the boot sequence.

2. Inspect the Safely Remove Hardware Icon

For Windows guests, you can right click on your Safely remove hardware icon located in the system tray. You should see your new virtual USB drive listed clearly with its newly assigned drive letter. This confirms the hypervisor successfully tricked the guest OS into recognizing the raw VMDK as removable flash media.

Eject Virtual USB Disk
Right click eject virtual USB mass storage

If you want to change the letter, you can open Disk Management and see your new USB drive and change drive the letter if needed. If you try and open your new virtual USB drive in File Explorer, you will get an error message. It will say the drive needs to be formatted before you can use it. You will have to complete this formatting procedure before continuing. Accept the prompt and format the drive using the NTFS or FAT32 file system..

USB Drive Format
Disk format message

4. Verify the Host System Tray Icon

After you format your new virtual USB drive, you will be able to use it just like a physical USB drive attached to your local computer. You will also be able to see it in your active VMware Workstation system tray at the lower right corner of your host screen. If you hover your mouse over it, you will see the specific name of your VMDK file.

Create a Virtual USB Drive in VMware Workstation
VMware Workstation system tray USB icon

5. Avoid Ejecting the Drive in Windows

One very critical thing to keep in mind involves the Windows ejection protocol. If you manually eject this USB drive from inside the Windows guest OS, you will break the configuration permanently. You will most likely have to add the custom lines back to the VMX configuration file and reboot the machine to get the drive back. Do not click the eject button.

For additional training resources, check out our online IT training courses.

Check out our extensive IT book series.

Preston Mason

Preston Mason is an Windows specialist with 10 years of experience in the computer industry specializing in Windows, Office and hardware.

Related Posts

© 2026 Online Computer Tips
Website by Anvil Zephyr