Home > My tips and tricks, Software > USB boot in VirtualBox

USB boot in VirtualBox


VirtualBox is a great piece of free virtualization software. I’ve been using it for years to tinker with various operating systems and software products. Lately I’ve been playing with boot disks. This isn’t a problem if you intend to use an ISO file or a physical disk in VBox, but if you want to use an USB flash drive to test things out, you can’t do so. Or, I should rather say that you can’t easily do so.

In order to get VBox to boot off an USB flash drive, you will need to do the following:

  1. Open up a command prompt. Under Windows Vista/7, right click on it and run it as an Administrator.
  2. Type in Diskpart. Once Diskpart has loaded, type in list disk. Your flash drive should appear near the bottom of the list. Make a note of which Disk number it is. Exit Diskpart.
  3. Back in the command prompt, change to the C:\Program Files\Oracle\VirtualBox folder.
  4. Type in the following code: VBoxManage internalcommands createrawvmdk -filename path\to\usb.vmdk -rawdisk \\.\PhysicalDrive1
  5. Change the number at the end of PhysicalDrive 1 to match that of step 2.
  6. Right click your VBox shortcut and run it as an Administrator if you are on Windows Vista/7. Create or modify a virtual machine to use the VMDK file created above. The file is located in the root of your user profile. Make sure that the file is set for IDE Primary Master.

You should now be able to start your virtual machine using the USB flash drive as the boot device. Very useful if you need to test out recovery software etc…

Hopefully one day VirtualBox will be able to boot from USB without needing to go through these hoops.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: