Skip to content

Instantly share code, notes, and snippets.

Created January 17, 2014 09:31
What would you like to do?
To boot Virtualbox from a USB pendrive you must first create a virtual disk to access to it and then add it as storage.
if [ -r USB.vmdk ]; then
VBoxManage storageattach "BootFromUSB" --storagectl "SATA" --port 0 --device 0 --medium none
VBoxManage closemedium disk USB.vmdk --delete
sudo chown $USER /dev/disk1*
VBoxManage internalcommands createrawvmdk -filename USB.vmdk -rawdisk /dev/disk1 -partitions 1,2
VBoxManage storageattach "BootFromUSB" --storagectl "SATA" --port 0 --device 0 --type hdd --medium USB.vmdk
Copy link

mapio commented Jan 17, 2014

Of course, this assumes several things, such as, the name of the VM, the name of the device where the pen is mounted and the number of partitions that it is divided in… but should be quite easy to adapt it to different setups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment