This service isn't started at launch, which is by design. The command being launched establishes a tunnel to a virtual machine running on the host using UTM.app. I created a LoginItem that launches the virtual machine at startup using UTM's registered URI handlers. By starting these tunnels lazily, we are able to connect at a time after the virtual machine has already booted and able to be reached on the network. Trying to do this at startup would result in a failure to connect.
- Ensure ssh is configured on the remote machine, you've generated an ssh key and you've copied that ssh key to the remote host.
- Replace
{{ path_to_public_key }}
with the full path to the ssh key you generated in step 1. - Replace
{{ remote_user }}
with your username on the remote machine. - Replace
{{ remote_host }}
with the remote hostname or ip address (for virtual machines this will probably be an ip address reachable by your local machine). - Replace
{{ your_username }}
with your username, ex:$ whoami
- Replace
{{ your_groupname }}
with an appropriate group name, select from groups returned by$ id -Gn $(whoami)
, ex: staff. - Replace
{{ port }}
with the remote port you'd like to tunnel locally. - Rename the template to remove the prefix and replace template with the port number you want to tunnel:
$ mv 2-com.ssh.tunnel.port.template.plist com.ssh.tunnel.port.8080.plist
- Install the plist:
$ sudo install -o root -g wheel -m 644 com.ssh.tunnel.port.8080.plist /Library/LaunchDaemons
- Load the plist to activate it:
$ sudo launchd load -w /Library/LaunchDaemons/com.ssh.tunnel.port.8080.plist