Skip to content

Instantly share code, notes, and snippets.

@ukiahsmith
Created March 27, 2016 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ukiahsmith/469b65fe172f44c872d7 to your computer and use it in GitHub Desktop.
Save ukiahsmith/469b65fe172f44c872d7 to your computer and use it in GitHub Desktop.
Run an headless VM and connect to it via SSH in a new iTerm tab
# Create a server vm called "DevServer"
do shell script "/usr/local/bin/VBoxHeadless -s DevServer &> /dev/null &"
do shell script "sleep 5"
set conn to "DevServerConn"
set fn to "
function DevServerConn() {
# connect with ssh
# devserver is an alias hostname that is configured in ~/.ssh/config
ssh devserver
# then shutdown the machine
/usr/local/bin/VBoxManage controlvm DevServer acpipowerbutton
}
"
# Now start iTerm and call the bash function to ssh into the VM
tell application "iTerm"
activate
set t to (current terminal)
tell t
launch session "Default Session"
tell the last session
write text fn
write text conn
end tell
end tell
end tell
# # this command will cut the fake bios loadscreen time down
# VBoxManage modifyvm DevServer --bioslogodisplaytime 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment