Yoodley is reader-supported. When you buy through links on our site, we may earn an affiliate commission.
A virtual USB drive can be best defined as a computer within a computer, lacking the processing power of a physical USB drive, but brimming with storage.
Attached to virtual machines, virtual USB drives bear great resemblance to physical external hard drives in terms of functionality and their dependency on your computer’s memory.
Now that you have caught up on a brief about virtual USB drives, we shall move on to the core part where we discuss how you can create a virtual USB drive in Windows, and other OS.
How to make a virtual USB drive in Windows?
You can create a virtual USB drive in Windows using both third party applications and the system software. Let us look at both of them in detail.
Method 1: Using System Software
- Open Start and search for Disk Management. Click on the first search result that appears.
- Once the app is launched, click the ‘Action’ button and click the ‘Create VHD’ option.
- Now, select ‘Browse’. This will allow you to locate the folder in which you would like to store your virtual USB drive in Windows 10.
- When prompted with a “File name” field, enter a name for the drive.
- Now, you will be prompted to save your USB drive. Select the ‘Save as type file’ drop down menu and select how you want to save your virtual USB drive – as *.vhdx or as *.vhd.
- Now, click on ‘Save’.
- Next step is to determine the size of your virtual USB drive. To do this, from under ‘Virtual hard disk size’, specify the size in any of the following formats that you deem fit:
- Megabytes (MB)
- Gigabytes (GB)
- Terabytes (TB)
- Now select the format for your drive from VHD and VHDX. You can do this from under the ‘Virtual hard disk format’ dropdown. We strongly recommend using the VHDX format, and the VHD format only if it is absolutely necessary.
- Now, you will need to select the type of your virtual USB drive. From under ‘Virtual hard disk type’, select:
- ‘Dynamic’ expanding option if you have chosen VHDX in the last step
- ‘Fixed size’ option if you have chosen VHD in the last step.
- Finally click OK. Now, you have created a virtual USB drive on your Windows OS.
Method 2: Using a third-party software IMDisk
IMDisk Toolkit includes a virtual disk driver and a library, specifically the DiscUtils library. With a GUI 32 bit, IMDisk Toolkit has multiple uses such as mounting image files of a hard drive, CD-ROM, and/or creating several RamDisks. However, in this post, we’ll be using IMDisk to purposely create a virtual USB drive on Windows.
To create a virtual USB drive in IMDisk, you will first need to download the toolkit from any trusted source. Once you have it in the zipped format, extract the stable file to the folder. Next, install the software by running the IMDisk installation file. Locate where you want to install the software, then click ‘Next’.
Now, click on ‘Install’ and then ‘OK’. Once you have installed the program, launch it by accessing it from its allocated place. Follow the steps below to create a virtual USB drive using IMDisk:
- Go to ‘File’. Select ‘Mount new virtual disk’.
- Once a box with options appears on your screen, select a name for your drive in ‘Image File’. Select ‘Create virtual disk in virtual memory’ from under ‘Image Access’ options.
- Specify the size of the drive and the drive type.
- Click on OK and you have successfully created a virtual USB drive using IMDisk.
How to make a virtual USB drive in Linux?
To create a new virtual disk for an existing Linux virtual machine:
- Login as a root user (this account has full privileges) by opening the command terminal pressing CTRL+Alt+T.
- In the command terminal, write su – and press Enter. You will be prompted to enter the password to root.
- Once you are logged in as root user, run the following command and make note of the sdx entries:
ls /dev/sd*
- Now, log in to the vCenter Server using vSphere Client and once in the inventory, right click and select ‘Edit’ to edit settings.
- Click the ‘Hardware’ tab and click ‘Add’. Next, select ‘Hard Disk’ and then click on ‘Next’.
- Upon completing the wizard, reboot your Linux virtual machine and login using the root credentials in the command terminal again.
- Now run the following command:
ls /dev/sd*
- You will now notice a new set of entries post running the command.
- Create one partition on new disk, example to sdx: fdisk /dev/sdx
Command (m for help): p
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-22400, default 1): <RETURN>
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-22800, default 22800): 22400
Command (m for help): w
The partition table has been altered ! - Create an ext3 file system for the new disk partition you just created in the last step, using the command:
mkfs -t ext3 /dev/sdx1
- Use command fdisk -l for verification of the new disk partition you have created.
- Use the command mkdir /New_Directory_Name for creating a mount point.
- If you wish to display the current content for say, /etc/fstab: use the following command
cat /etc/fstab
- To edit fstab, use text edit and add the following line, so that /etc/fstab is available across reboots of the virtual machine:
/dev/sdx1 /New_Directory_Name ext3 defaults 1 3
- Reboot your Linux virtual machine and the virtual USB drive as a new disk partition will now be available.
How to make a virtual USB drive in Mac?
You can create an empty disk image, add data to it, then use it to create disks, CDs or DVDs.
To create a virtual USB drive in MacOS, you will need to create a disk image, add data, and then use it to create disks, CDs, or DVDs.
Here is how you can create a disk image in MacOS:
- Go to Disk Utility app, then choose File > New Image > Blank Image.
- Give your disk image a name, add tags, and choose the saving location.
- Now, add a size to your disk image in the ‘Size’ field.
- Select ‘Format’, and then choose the format for your disk from the following options available:
- APFS or APFS (case-sensitive).
- Mac OS Extended (Journaled) or Mac OS Extended (Case-sensitive, Journaled)
- MS-DOS (FAT)
- ExFAT
- Now, if you choose to add encryption to the disk image, click on the pop menu labelled as ‘Encryption’. Next choose an encryption option.
- Choose the image format from the ‘Image Format’ pop-up and choose from one of the following options:
- Sparse bundle disk image
- Sparse disk image
- Read/write disk image
- DVD/CD master
- Finally click ‘Save’ and then ‘Done’.
- From the Finder, locate your disk image and copy your files to the mounted disk image. Next, eject it.
- Now, restore the disk image to a disk.
FAQs
1. How to mount an ISO image in Windows?
Mounting an ISO image in Windows 8 and 10 is an easy job, as these Windows versions come with a built-in ability to mount ISO disc image or a VHD virtual hard drive image file. But if you are working on Windows 7 or Vista, you require a third party application tool like WinCDEmu which is an open-source disc mounting program. WinCDEmu supports various types of image files like BIN, NRG, MDS/MDF, CCD, and IMG; it can also be used in Windows 8 or 10.
Here are the 3 steps to mount an ISO image in Windows 8 and 10: ( Without using WinCDEmu )
- Go to the ISO image which you want to mount, then double click on it. It works only when you have no programs associated with the ISO image on your system.
- Right click on the ISO image file and select the “Mount” option.
- Select the ISO file from the file explorer, and then click on the ” Mount ” button under the Disk Image Tools ” tab on the ribbon. Once mounting is successful, it will appear as a new drive under This PC. In order to unmount the ISO file, right click on the drive, and select “Eject”.
On Windows 7 or Vista follow the given steps:
- Install WinCDEmu application on your PC and let it install the hardware drivers that it requires.
- Once WinCDEmu is installed successfully, double click on the ISO image file to mount it or right click on the disk image file and click “Select drive letter & mount” and “OK” option.
- To unmount the disk image, right click on the virtual disk drive and select “Eject” option.
2. How can I use my Android phone as a USB drive?
- Connect your android device to your PC using a USB data cable. Once connected, a ” USB Storage” notification will appear in the notification panel of your device. Select the ” USB Storage” and click the “OK” option.
- An AutoPlay box will appear on your PC, choose the “Open Folder” option. And now a new storage drive will appear under This PC, as a Removable Disk. Now you can easily transfer files from your PC’s hard drive to an appropriate folder on your Android Phone.
3. How to open a VHD file?
Steps to open a VHD file on Windows are given below;
- Save the VHD file to the desktop. In case if you have downloaded the compressed file, you can easily find it in the downloads.
- Launch the WinZip application from the start menu or the desktop shortcut. To open the VHD file- click on the VHD file and choose open option.
- Select the VHD files which you want to extract.
- Now click on 1-click Unzip option and choose Unzip to PC from the WinZip toolbar.
- Choose the folder where you want to extract the file and click the Unzip button.
- Once extraction is successful, close the Winzip application, and go to the folder where you extracted the file and easily access it from there.
4. How to add a virtual printer port?
Steps to add a virtual printer port are as follows:
- Go to the start button, open the control panel and from the hardware and Sound select printers option.
- Click on add printers option.
- From the add Printer wizard, click on add a local printer.
- Then choose Create a new port option. Make sure that the local port is selected in the list and then click on next.
- Type \\computer name\printer name in the Port Name dialog box, and then click OK.
- Now complete the rest of the wizard and then click on Finish.
5. How to create a multi-partition USB drive that also acts as the bootable ubuntu.iso?
- Partition the pendrive as you like, to give space for the ISO image in a FAT partition, the first one.
- Now Run lsblk to identify which device is your pendrive, i.e /dev/sdb, being the first partition the FAT one, i.e /dev/sdb1. Mount it, i.e /media/user/PENDRIVE
- Then mark this partition as bootable, from Disk Utility.
- Run the following commands:
sudo apt install grub-efi-amd64 dirs=(dev bin sbin etc sys usr proc lib lib64) for dir in “${dirs[@]}”; do mkdir -p /media/user/PENDRIVE/$dir sudo mount –bind /$dir /media/user/PENDRIVE/$dir done sudo chroot /media/user/PENDRIVE/ grub-install –force –removable –target=x86_64-efi –efi-directory=/ /dev/sdb1 sudo chroot /media/user/PENDRIVE/ grub-install –force –removable –target=i386-pc –boot-directory=/ /dev/sdb - Unmount the binded dirs and remove them:
for dir in “${dirs[@]}”; do sudo umount /media/user/PENDRIVE/$dir rm -r /media/user/PENDRIVE/$dir done - Create a file grub.cfg under /media/user/PENDRIVE/grub/ with their content:
set root='(hd0,1)’ configfile /boot/grub/grub.cfg - Mount the Ubuntu ISO and copy the grub.cfg file in /media/user/PENDRIVE/boot/grub/
- Alter the file¹, in this example with ubuntu-20.04.1-desktop-amd64.iso
set root='(hd0,1)’
set iso_path=/ubuntu-20.04.1-desktop-amd64.iso
loopback loop $iso_path
menuentry “Ubuntu” {
set gfxpayload=keep
linux (loop)/casper/vmlinuz iso-scan/filename=$iso_path file=/cdrom/preseed/ubuntu.seed maybe-ubiquity quiet splash —
initrd (loop)/casper/initrd
}
- Copy the ISO image in the partition (the first FAT one).
Ready, you have now an EFI/i386 bootable pendrive with the partitions you created.