Booting physical USB Flash Drive in VirtualBox and VMWare Player under M$ Windows #037



 Booting from a physical USB Flash Drive in VirtualBox under Microsoft Windows

At the moment of writing this note (February 2021) VirtualBox 6.1 does not support USB boot.
Re-check if new versions of VirtualBox support USB boot, in this note version used are:
VirtualBox :VirtualBox-6.1.20-143896-Win
VirtualBox Extensions: Oracle_VM_VirtualBox_Extension_Pack-6.1.20.vbox-extpack
Link to download link 

So, there is a work-around, that works by assigning the physical USB Flash Drive to a virtual disk image, here is how to do it under M$ Windows.

 Host computer is your physical computer, the Guest computer is the one created in VirtualBox
Connect the USB Flash Driver to the Host computer
Press Windows key + R (Run..) and type "diskmgmt.msc", or type "Computer Management" in the search box of Windows 8 or later. Note the drive number that is displayed :


 Note the drive number, in this case "1".

Open command prompt with administrator privileges by using search box, right click and select "Run as administrator":


 Travel to VirtualBox installation directory using the following commands:

cd %programfiles%\Oracle\VirtualBox

VBoxManage internalcommands createrawvmdk -filename C:\usb.vmdk -rawdisk \\.\PhysicalDrive1



PhysicalDrive1 is Drive1, PhysicalDrive2 would be Drive2



 Run VirtualBox with administrator privileges:



Or in the admistrator CommandPrompt use command: 

start virtualbox.exe

 Create the Virtual Machine and assign the disk created before




Optional : enable disable Use Host  I/O Cache - in my machine, stability is only achieved with this option enabled.


 

NOTE: in the virtual machine select the USB type according to your USB adapter, if you have a USB2.0 key in an USB3.0 port, select USB2.0
All done!

Alternative :
 Virtual Machine USB Boot can create the virtual disk image and start VirtualBox, download it from link.
 Download, portable version is available, extract the files and run "Virtual Machine USB Boot" with administrator privileges:


  Remove the virtual disk from the virtual machine, close VirtualBox.
  In VirtualMachine USB click Add and:
  +select VM name
  +select Drive to add and boot
  +select Use host I/O cache
 press Ok, press Start


Using VMware Player to boot physical USB Flash Drive

VMware® Workstation 16 Player version 16.1.2 build-17966106 was used to write this note at July 2021.
Launch VMware, create a New Virtual Machine:

Choose "I will install..."


In this note I used a Debain i686 (32bit) live usb USB FLash drive, choose accordingly


Name the virtual machine and choose its location


It is not required to create an virtual hard drive, it will not take any space


Choose "Finish"


Choose "Edit virtual machine settings"


Choose "Add..."


Choose "Hard disk"


SCSI works, other might work as well


Choose "Use a physical disk..."


Select the correct number based on Windows Management > Device Manager (see the VirtualBox example


Give it a name, choose "Finish"


It is necessary to change the boot priority from the virtual HDD to the physical device, select the virtual HDD and choose "Advanced"


Select for example SCSI 0:2


All done, to start it is required to launch VMware Workstation 16 PLayer with administrator privledges



note: you need free space on the system hard drive when running this virtual machine, in this case, 2GB where occupied, same as the virtual machine RAM  memory size

most of times it is required to delete the drive letter assigned with the USB Flash Drive, to do so launch Computer Management, right click on the Disk 2 and choose "Change Drive Letter...":


 

 This doesn't always work and sometimes an error is generated, my solution is to remove the USB Flash Drive, insert it again and launch MiniTool Partition Wizzard Free, there is an portable edition here link


 

Note: when using MX Linux under VMware the boot fails with the default SCSI disk mode, if switched to SATA or IDE it works. 



updated: July 2021 to add VMware step by step notes


Comments