How to boot from USB in virtualbox on Ubuntu
Posted on | May 13, 2011 | 1 Comment
How to boot from USB in virtualbox
Useful for quick testing of USB boot media, flexible plug’n’play of guest operating systems, and so on.
Tested for various Ubuntu 9/10, virtualbox 3.1.6/4
Prepare:
$ su
# mkdir /root/.VirtualBox/HardDisks
# VBoxManage internalcommands createrawvmdk -filename /root/.VirtualBox/HardDisks/usbdisk.vmdk -rawdisk /dev/sdb1
So, you tell virtualbox to see the USB drive as a disk, which you then boot from.
Open virtualbox
# virtualbox
Make new machine, choose “Existing harddisk” and point at the one you created.
Useful for quick testing of USB boot media, flexible plug’n’play of guest operating systems, and so on.
Tested for various Ubuntu 9/10, virtualbox 3.1.6/4.0.6
Prepare:
$ su # mkdir /root/.VirtualBox/HardDisks # VBoxManage internalcommands createrawvmdk -filename \
/root/.VirtualBox/HardDisks/usbdisk.vmdk \
-rawdisk /dev/sdb1
Note: all in one line! the last bit, the device name, needs to point at your USB drive. In this case /dev/sdb1 – yours will be different!
So, you tell virtualbox to see the USB drive as a disk, which you then boot from.
Open virtualbox:
# virtualbox
Make new machine, choose “Existing harddisk” and point at the one you created.
Thats all.
Thanks, Three Wise Men http://www.twm-kd.com/software/boot-virtualbox-machine-from-a-usb-flash-drive/
Comments
One Response to “How to boot from USB in virtualbox on Ubuntu”
Leave a Reply
September 12th, 2013 @ 1:49 pm
@glip
That doesnt work.
I changed the owner of the file and changed the permissions, still wouldnt work.
commands:
sudo chown username:wheel usbdisk.vmdk
chown 600 usbdisk.vmdk (my other disk files have 600, but i also tried 755 and 777)
Starting Virtualbox as root however does work.
I believe it has to do with the rights to access the usb device.
e.g. fdisk -l, gparted and so on all need to be run as root so that they have access to the harddrives. And the way i understand it, is the vmdk file like a link to the usb device so in order to use that file you need to be root