When it comes to virtualization on the desktop, VMware Workstation and Oracle VM VirtualBox stand out from the rest. While Workstation is a premium software and includes all advanced options, VirtualBox is an open source virtualization software with a decent set of features.
Users who have used VirtualBox to install and test drive Windows 8 (see how to install Windows 8 on VirtualBox) must have noticed that it doesn’t support booting from USB by default. Users either need to use an ISO file or DVD as bootable media.
There might be instances where you want to install Windows on VirtualBox from bootable USB flash drive. In this guide, we are going to show you how to install Windows in VirtualBox using a USB drive as bootable media. Full Credit goes to SysProbs for the tip.
Steps to boot from USB in VirtualBox
Step 1: Start the procedure by creating your bootable USB drive. If you have one, you can skip to the next step. To create, you can follow our how to install Windows 7 and Windows 8 from USB flash drive, use Microsoft DVD/USB Tool, or Rufus tool. Once done, we recommend you follow our test bootable USB guide to make sure that the bootable media is error free.
Step 2: Connect your bootable USB drive to your Windows 7/Windows 8 host machine. Open Disk Management by typing diskmgmt.msc in the Run dialog and then pressing Enter key.
Step 3: In Disk Management, find out your USB drive’s disk number. For instance, in the below picture, Disk 1 is my USB’s disk number.
Close Disk Management.
Step 4: Next step is to create a raw VMDK file for the USB. To do that, open Command Prompt with admin rights. You can type CMD Windows 7 Start screen search and then simultaneously press Ctrl + Shift + Enter keys. Click Yes for the UAC prompt. If you are on Windows 8, type CMD when you are in Start screen and then press Ctrl + Shift + Enter.
Step 5: In the Command Prompt, enter the following commands to navigate to the VirtualBox folder. Please note that if have installed VirtualBox in any other location you need to use appropriate commands to move to the right location.
cd \
cd “Program Files”
cd Oracle
cd VirtualBox
And then enter the following command and press enter key to execute the same.
VBoxManage internalcommands createrawvmdk –filename C:\Users\PC\Desktop\New\usb2.vmdk –rawdisk\\.\PhysicalDrive1
In the above command, replace PhysicalDrive1 with your USB drive’s disk number. For instance, if your drive number is 5, type PhysicalDrive5. Also, replace the path (C:\Users\PC\Desktop\New) with a valid location to save the VMDK file.
You should see “VMDK created successfully” message.
Close the Command Prompt.
Step 6: Open VirtualBox as administrator by right-clicking on the program and then clicking Run as administrator option.
Step 7: Select the virtual machine from the list, click Settings and then click Storage. Click Add Hard Disk button, click Choose existing disk and then browse to the VMDK file that you created in Step 5.
Please note that the newly attached VMDK file should be the first hard disk to able to boot. You can move the VMDK file to the first by changing the hard disk port number on the right-hand side. You are done!
You can now start the virtual machine, it should now boot from the attached USB disk. Good luck!
gggirlgeek says
Just use RMPrepUSB. Use the F11 option to test using Qemu Emulator. (If you are using an internal hard disk or a disk larger than 128Gb press Ctrl+F5 to show all disks.) RMPrepUSB runs Quemu with the right command-line options to test-boot a physical drive. No need to unmount the device either. Works with multiple partitions too.
Worked on my Win10pro x64 UEFI, booting from second physical GPT Hard Drive where I installed Ventoy boot loader (aka. Grub2.) This HDD is partitioned into 3 partitions. I had the boot folder open in Explorer at the time. My laptop is an Acer Aspire 5 with Secure Boot disabled, UEFI-mode.
Jack says
i get a bunch of errors when i type it in i’ve tried everyones versions, and none of them are working. Please Help.
G says
Think i did all i had to, some “changed successfully messages” so thought i was on right path. But no go.
Steve smith says
You need a space after rawdisk
Porfirio says
There is a space missing after RAWDISK. I got the same error so I looked at the DOS screenshot and saw the space. it should look like this.
VBoxManage internalcommands createrawvmdk –filename C:\Users\PC\Desktop\New\usb2.vmdk –rawdisk \\.\PhysicalDrive1
I still couldn’t boot from the vmdk.
Robert says
I know this is an old guide but true is – It help me today to teach my Student as I’m a teacher. Thanks
DavidB says
There is a tool who does that automatically. It’s called “Virtual machine starter”. Works with Qemu and VirtualBox. More: it’s able to automatically dismount the volumes from the USB drive before the VM starts and to remount them back after it’s closed. This way it can prevent any data loss on the USB drive (from been accessed simultaneously by 2 computers) and you can see any modification made inside the VM (to the USB drive) into the real computer right after the VM is closed.
Where you can find it: go to reboot pro ? Boot methods & tools ? Boot from USB / Boot anywhere ? Booting VirtualBox with USB workaround (last page of the thread).
DavidB says
Very good method, thank you very much.
I have Windows XP SP3 x86 and I’m using VirtualBox as admin.
Only one problem: any changes made to the USB drive in the virtual machine are not visible in the host OS until I remove it and reattach it.
I tried a tool called sync.exe, who flushes the Windows RAM buffer, no change.
I tried also to change usb.vmdk to writethrough, still no change.
Is there any good setting for this, or even a tool/command (preferably fast too), perhaps even one that can be used in a batch file…?
Please help me…
Thank you.
Regards, DavidB
Magnus says
Thank you so much! This really worked like a charm!
Rezwanur Rahman Pantho says
U r great. Thanks. :-D :-D :-D
thuya says
Your blog is awesome.I have a problem in step 5.When I type command
“VBoxManage internalcommands createrawvmdk –filename D:\usb2.vmdk –rawdisk\\.\PhysicalDrive1”
I got syntax error.Please help me.
I already checked my usb is disk1.