Last active
July 26, 2016 08:27
-
-
Save euikook/7b0bc0a2ba318c7653469aea387e58bc to your computer and use it in GitHub Desktop.
Headless start VirtualBox VM
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
#!/usr/bin/env bash | |
# ~/bin/start-vm | |
VBoxManage startvm $1 --type headless |
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
# /etc/bash_completion.d/start-vm | |
_start_vm() | |
{ | |
local cur prev command module i | |
COMPREPLY=() | |
cur=${COMP_WORDS[COMP_CWORD]} | |
VM_LIST=`VBoxManage list vms | awk '{print $1}' | sed 's/\"//g'` | |
if [[ $COMP_CWORD -eq 1 ]] ; then | |
COMPREPLY=( $(compgen -W '$VM_LIST' -- $cur) ) | |
fi | |
} | |
complete -F _start_vm start-vm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment