Created
March 27, 2016 03:44
-
-
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
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
# 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