-
-
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" |
why you are adding tr -d '\015' for?
किन भने, it didn't work for that time...bcuz of explaination like that....
" Apparently, what curl sends to its standard output isn't acceptable to sh. If I had to guess, the first line of the file is #!/bin/bash\r where the \r is a carriage return (CR), and the system can't find a file with the CR in the name. (And the error report is confusing because the CR spoils the display.)
Maybe you should pipe the output through tr -d '\015' before submitting it to the shell."
http://stackoverflow.com/questions/10358203/bash-curl-script-run-with-options
But, wtf... it works now... without that
curl https://gist.githubusercontent.com/zerOnepal/9928172/raw/8cea753ae7f9fb843ffccf6a9d4717d8064f2355/usb-boot-with-vbox.sh | bash
for short url
curl http://git.io/AoRh | bash
I know you wont tye this shit...
curl https://gist.githubusercontent.com/zerOnepal/9928172/raw/8cea753ae7f9fb843ffccf6a9d4717d8064f2355/usb-boot-with-vbox.sh | tr -d '\015'| bash