#!/bin/bash
# vm [command…]: runs a command in the Intel Tiger VM on precision (exe's exe-mac-osx-intel, ssh on precision's
# 127.0.0.1:42075), account tiger, through precision: the guest's OpenSSH 5.1 knows only precision's RSA key and
# the old key exchange. Standard input goes through, as with ./g. sudo there takes the word in guest/vm-password.
HOST=${HOST:-livid@precision}
exec ssh -o BatchMode=yes "$HOST" "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR \
  -o ConnectTimeout=15 -o KexAlgorithms=+diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 \
  -o HostKeyAlgorithms=+ssh-rsa,ssh-dss -o PubkeyAcceptedAlgorithms=+ssh-rsa -o IdentityFile=~/.ssh/id_rsa \
  -o BatchMode=yes -o ControlMaster=auto -o ControlPath=/tmp/tiger-vm-%r@%h:%p -o ControlPersist=600 \
  -p 42075 tiger@127.0.0.1 $(printf '%q' "$*")"
