SSH
Every machine gets an SSH name made from its name: Web Server becomes
web-server. Use it to connect from your Mac without looking up addresses.
The SSH name stays when you rename the machine. To change it, set Name in the SSH pane of the machine's settings. A Linux guest keeps the host name it was created with.
Connecting#
swiftvm ssh web-server # a shell in the guest
swiftvm ssh web-server uname -a # or one commandFrom the app, choose Open in Terminal or Copy SSH Command in the machine's menu.
Plain ssh#
Turn on Settings → Network → Add machines to ~/.ssh/config to connect with
just ssh web-server. It also makes scp, rsync, and editors that work over
SSH find your machines.
SwiftVM adds one Include line to your SSH configuration and changes nothing
else in the file. The machines themselves are listed in a file SwiftVM keeps
up to date.
Keys#
- SwiftVM uses the key you already have (
id_ed25519,id_ecdsa, orid_rsain~/.ssh). If you have none, it makes~/.ssh/swiftvm_ed25519. - With Sign in over SSH with my key on, the key is installed in guests that SwiftVM sets up: Quick Create Linux machines, macOS 27 or newer, and Windows when SSH installation succeeds.
- The guests' host keys are kept apart from your own
known_hosts. A guest's key is accepted the first time you connect and checked from then on.
Guests you installed yourself#
A guest installed from a disc may have no SSH server. Install one in the guest, add your public key to the account, and set User in the SSH pane of the machine's settings. If the server listens on another port than 22, set Port there too.
Without a network#
--vsock connects through the machine's own socket device, not its network.
It still works when the guest's network is down or its cable is pulled.
swiftvm ssh web-server --vsock- It is for Linux guests. Ubuntu 26.04, Debian 13, Fedora 45, and Arch Linux ARM support it as they come; older systems such as Ubuntu 24.04 need the guest tools.
- To use it from your own SSH configuration, for
scp,rsync, or an editor:
Host web-server-vsock
User user
IdentityFile ~/.ssh/swiftvm_ed25519
ProxyCommand swiftvm vsock web-server 22Replace user and the key path with the guest's account and your SSH key.
swiftvm ssh --vsock uses the machine's configured account and key for you.