Created
November 14, 2012 20:17
-
-
Save Leechael/4074485 to your computer and use it in GitHub Desktop.
vmlive and vmstart: my handy commands for VirtualBox Instance Management
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias vmlive="VBoxManage list runningvms" | |
function vmstart () { | |
if [ -e $1 ]; then | |
echo 'No VirualMachine specified. All available machines:' | |
VBoxManage list vms | cut -d'"' -f2 | sed -E 's/(.*)/> \1/' | |
return | |
fi | |
local _EXISTS=`VBoxManage list vms | grep $1 | wc -l | awk '{print $1}'` | |
if [ ! $_EXISTS -eq 1 ]; then | |
echo 'Machine '$1' no exists...wtf?!' | |
echo 'Choose one of following machines:' | |
VBoxManage list vms | cut -d'"' -f2 | sed -E 's/(.*)/> \1/' | |
return | |
fi | |
VBoxManage startvm --type headless $1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment