How to Boot an OS from a USB Drive in VirtualBox

VirtualBox is one of the most popular solutions used to manage and run virtual machines. Just like a real computer, it needs a source to boot from. The most straightforward way to run a guest operating system in a virtualized environment is to download a bootable ISO image and then mount it in a virtual CD/DVD drive.

Sometimes, though, you may prefer an alternative. For example, you can boot directly from a USB stick. Since it’s easy to install a Linux distribution on a USB drive, this method allows you to keep an operating system in your pocket and run it anywhere you have access to a virtual machine.

Find the Disk Number Associated with Your USB Drive

Modern editions of Windows associate a number to each disk they can access. This number is needed to use in a subsequent command.

1. Insert your USB drive into a free slot. In Windows 10 you can access Disk Management by right-clicking on the Start Menu.


To open this utility in older versions of Windows, click on the Start Menu and launch a Run dialog.


In this dialog type diskmgmt.msc and press Enter.


Make note of the disk number associated with your USB drive. For example, in the previous picture the disk number is “1.”

Create a Virtual Raw Disk Associated with Your USB Drive

VirtualBox gives you the option to create a new virtual disk when you launch a new virtual machine. The information you store on this disk gets mapped to a file somewhere on your real storage device. Unfortunately, the graphical user interface doesn’t let you map a virtual disk directly to a real storage device or partition. However, there is a command-line utility, included with the application, that lets you do that.

Open a command prompt with administrator privileges. Click on the Start Menu, type cmd, right-click on “Command Prompt” and “Run as administrator.”


Change directory to the path where you have installed VirtualBox. By default, this is “C:\Program Files\Oracle\VirtualBox.” If you installed to another path, you may have to modify the next command:

Remember the disk number associated with your USB drive, and change the last digit in the following command, if necessary:

For example, if you have an SSD drive in your system and a hard-drive, then the number of your USB disk might be “2” instead of “1,” so the command should become:


A file named “usbdrive.vmdk” is now saved on your desktop. You will use this in the next step.

Add Your USB Drive to the Virtual Machine

To be able to use raw devices as virtual disks, VirtualBox needs to run with administrator privileges. Click the Start Menu, type “virtualbox,” right-click the application and “Run as administrator.”


Click on “New” to create a new virtual machine.


In the dialog that opens, at the bottom of the window, you will notice the “Hard disk” section. Select “Use an existing virtual hard disk file,” and click the icon that has been highlighted in the next picture. Browse to your desktop, and select the file named “usbdrive.”


In the following picture you can see a Windows installation kit booting directly from an USB drive in a virtual machine.


Potential Problems and Solutions

Keep in mind that every time you want to boot from your USB drive, you have to run VirtualBox with administrator privileges.

On some motherboards, virtualization features are disabled by default. Depending on your CPU, you will have to enable either VT-x on Intel processors or AMD-V on AMD processors. You will find these options in your BIOS or UEFI settings. If VirtualBox only shows you 32-bit versions of operating systems it can host, it’s a sign that these features are inactive. If your CPU supports VT-d or AMD IOMMU equivalent, enable that too, as it may help with performance when booting from a USB device.

Having trouble with this setup? Let us know in the comments. Someone else who ran into the same issue might be able to help.

Alexandru Andrei

Fell in love with computers when he was four years old. 27 years later, the passion is still burning, fueling constant learning. Spends most of his time in terminal windows and SSH sessions, managing Linux desktops and servers.


  1. Thanks for the article…I didn’t know that could be done; I thought you could only boot from an ISO file.

    However, it should be noted that most of the required backslashes (“\”) have been removed from the text portions of the article, although they do show properly in the screenshot of the command prompt window.

  2. Thank you Rick. It was OK in the original form of the article. It seems that somewhere in the editing process, some of the tools that format the text (probably the WYSIWYG GUI editor) cut out those backslashes.

    Will be solved. Thank you again for letting us know.

  3. hey hi! im traying to do this, but installing on c: this install windows 7 on pendrive!
    Please help!

  4. Everytime I try to Boot following this guide I get This:
    An error has occurred during virtual machine execution! The error details are shown below. You may try to correct the error and resume the virtual machine execution.
    The I/O cache encountered an error while updating data in medium "ahci-0-0" (rc=VERR_ACCESS_DENIED). Make sure there is enough free space on the disk and that the disk is working properly. Operation can be resumed afterwards.

    Severity: Non-Fatal Error

    Not sure what is goin o

    1. Seems like you skipped this? “Click the Start Menu, type “virtualbox,” right-click the application and “Run as administrator.””

    2. I had this issue as well. The reason seemed to be that the raw volume used by guest OS was also mounted in host OS, so they were conflicting.

      I resolved this by “removing a drive letter” (my host OS is Windows) from the drive in Disk Manager. This made the drive inaccessible for the host system.

  5. This is not what people want, to boot from a USB stick with no way to install the OS.
    What they want is to install the OS to the virtual disk.

    These steps only result in “no bootable media” found for me, despite the fact that the USB stick is bootable.
    I understand you can only repeat other people’s instructions that you found on the internet.

    But, the reality is, what is desired here is for the Virtual machien to recognize the usb stick as bootable, not as a hard drive.

  6. I have this problem:

    Raw-mode is unavailable courtesy of Hyper-V. (VERR_SUPDRV_NO_RAW_MODE_HYPER_V_ROOT).

    Result Code:
    E_FAIL (0x80004005)
    IConsole {872da645-4a9b-1727-bee2-5585105b9eed}

Comments are closed.