How To Boot From USB In VirtualBox

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 decent set of features.

VirtualBox Boot from USB

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 USB drive as bootable media. Full Credit goes to SysProbs for the tip.

Procedure:

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 Run dialog and then pressing Enter key.

Step 3: In the Disk Management, find out your USB drive’s disk number. For instance, in the below picture, Disk 1 is my USB’s disk number.

Boot From USB In VirtualBox step1

Boot From USB In VirtualBox

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

Boot From USB In VirtualBox step34

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 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.

Boot From USB In VirtualBox step4

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.

Boot From USB In VirtualBox step5

Boot From USB In VirtualBox step6

Boot From USB In VirtualBox step7

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 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!

Comments

  1. 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).

  2. 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

  3. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>