How to Boot Virtual Machine from USB Drive in VirtualBox – Easy Steps on Windows 7 Host

By any chance you need to boot a virtual machine in Oracle VirtualBox with a bootable Operating System or program utility, then this small guide would be helpful. In this article, I show you how to boot a virtual machine from a physical USB drive (flash disk) which is connected to the Windows 7 host computer.

Oracle VirtualBox is one of the best and free desktop virtualization software which allows running multiple Operating Systems on the single computer. Nowadays, most of the PC utilities and Operating Systems have the feature to create bootable USB disk which can be used in varies ways. VirtualBox is not supporting direct USB boot for a virtual machine as it is supporting CD/DVD and ISO boot. So, here is the workaround to boot a virtual machine from USB disk on VirtualBox.

Basically, we need to create a raw VMDK file pointing to USB disk, which is similar to our earlier guide  how to access physical disk and partition from VirtualBox virtual machine.

Simple Steps

I’m demonstrating these steps on a Windows 7 host computer and an bootable DOS OS USB flash drive is connected to it. I’m going to boot an existing VirtualBox virtual machine from attached USB disk.

1) Make sure your USB is bootable and it is booting on a physical computer. Because, if the USB is not bootable, no point in blaming these steps or VirtualBox.

2) Find out the attached USB disk’s correct disk number from Windows Disk Management.

Here is mine. Disk 4 is the USB I need to boot from VirtualBox.

disk number of USB disk

3) Let’s create a raw VMDK file for the USB disk.

Open the command prompt as administrator ( in Windows Vista, 7 and .8) and go to the installation directory of VirtualBox (usually it will be located under program files folder).

cd virtualbox folder

Important Note – You must open the command prompt by selecting ‘Run as administrator’ option.

Type the following command.

VBoxManage internalcommands createrawvmdk -filename
C:\\Users\\Dinesh\\Desktop\\usb1.vmdk -rawdisk \\\\.\\PhysicalDrive4

creating raw file

You must enter the valid path to save output VMDK file and make sure you are typing the correct disk number for USB drive which we found out in step 2.

A successful message should appear as below if the command works fine.

sucessfull message

4) Open VirtualBox as administrator ( Right click – Run as administrator) and go to the settings of the virtual machine you like to boot from USB disk.

We need to attach the VMDK file which was created in step 3. Also, it should be the first hard disk to be able to boot. Since my existing virtual machine is having SATA controller, I have clicked on Add Hard disk and selected Choose existing disk. Browse the VMDK file we created earlier.

attach disk

Once the disk is added without any error messages, you may need to change the SATA ports or IDE settings to make the added hard disk as the first boot disk, otherwise, it will be booting from earlier OS hard disk only.

as first harddisk

5) Now you can switch on the virtual machine, it should boot from attached USB disk.

Here is my Fedora 17 virtual machine booted with DOS OS installed USB flash drive.

usb booted disk

The involved steps are very easy and straightforward, only important part is you must open the command prompt and VirtualBox program as administrator to make this work.

14 thoughts on “How to Boot Virtual Machine from USB Drive in VirtualBox – Easy Steps on Windows 7 Host”

  1. VBoxManage internalcommands createrawvmdk -filename C:mikeusb.vmdk -rawdisk \\.\PhysicalDrive7

    you have to have \\.\ for this to work..

  2. “Hi Mike, Great post! this worked well but I get BSoD when booting from the USB!!
    Any Ideas??”

    Sorry that was meant for you Dinesh

  3. Gee’s I wish you could have fixed it….
    Wasn’t until I read the comments (from Mike) that it finally worked – Thanks Mike 🙂

    VBoxManage internalcommands createrawvmdk -filename C:UsersDineshDesktopusb1.vmdk -rawdisk \\.\PhysicalDrive4

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

  5. Well, I found a solution: using mountvol command to dismount USB drive’s volume(s) before starting the VM and to mount them again after closing the VM.
    All can be done in a batch file so it will be very easy to use…

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

    • hi i have made 10 times all these steps and get error when boot the VM : Boot error

      cmd as admin
      VBoxManage internalcommands ….
      vbox as admin
      new vm ….add harddisk…existing disk… i saw that it see my usb 7.47 gb
      when i boot the new vm… Boot error on the screen.

      also can you give the link of your tool? Virtual machine starter” ????

  7. Does anyone have a handy link regarding how to do this on Linux or an OS X (or other ‘nix) system? Many thanks if so.

Comments are closed.