Skip to content

Instantly share code, notes, and snippets.

@thapakazi
Last active August 29, 2015 13:58
Show Gist options
  • Save thapakazi/9928172 to your computer and use it in GitHub Desktop.
Save thapakazi/9928172 to your computer and use it in GitHub Desktop.
#!/bin/sh
#source: http://www.twm-kd.com/software/boot-virtualbox-machine-from-a-usb-flash-drive/
#adding virualbox modules
sudo modprobe vboxdrv
#make a vbox hdd for the usb_drive
mkdir -p /tmp/VHardDisks
#create a new virual hdd... just a link to the /dev/sdxy
VBoxManage internalcommands createrawvmdk -filename /tmp/VHardDisks/usbdisk.vmdk -rawdisk /dev/sdb1
if [ $? -eq 0 ]
then
#virtualbox &
echo -e "\e[33m Now add new virtual Machine with /tmp/VHardDisks/usbdisk.vmdk as your storage... \n that's it... Enjoy. हस त । नमस्ते:P"
exit
fi
echo -e "\n \e[31m Check if your usb is /dev/sdb1 or sth else...fishy"
@thapakazi
Copy link
Author

for short url
curl http://git.io/AoRh | bash

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