Skip to content

Instantly share code, notes, and snippets.

Embed
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.
#!/bin/bash
if [ -r USB.vmdk ]; then
VBoxManage storageattach "BootFromUSB" --storagectl "SATA" --port 0 --device 0 --medium none
VBoxManage closemedium disk USB.vmdk --delete
fi
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
@mapio

This comment has been minimized.

Copy link
Owner Author

@mapio 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
You can’t perform that action at this time.