XNU as a loadable kernel module inside Linux (macOS personality for arm64 Linux)
C
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-only
# run a command in the guest (or -s FILE: a script; -put/-get: copy)
O="-o Port=2222 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=10 -o ServerAliveInterval=30 -o LogLevel=ERROR -i $HOME/xnuvm/vmkey"
if [ "$1" = -s ]; then exec ssh $O [email protected] bash -s < "$2"; fi
if [ "$1" = -put ]; then exec scp -O -P 2222 ${O} -r "$2" [email protected]:"$3"; fi
if [ "$1" = -get ]; then exec scp -O -P 2222 ${O} -r [email protected]:"$2" "$3"; fi
exec ssh $O [email protected] "$@"