vmctl ssh
SSH into a VM.
Synopsis
vmctl ssh [OPTIONS] [NAME]
Arguments
| Argument | Description |
|---|---|
NAME | VM name (optional; inferred from VMFile.kdl if only one VM is defined) |
Options
| Option | Type | Description |
|---|---|---|
--user | string | SSH username (overrides VMFile) |
--key | path | Path to SSH private key |
--file | path | Path to VMFile.kdl (for reading ssh user) |
Key Resolution
vmctl searches for a private key in this order:
- Auto-generated key in VM's work directory (
id_ed25519_generated) - Key specified with
--key ~/.ssh/id_ed25519~/.ssh/id_ecdsa~/.ssh/id_rsa
User Resolution
--userCLI flaguserfield in VMFile'ssshblock- Default:
"vm"
Details
vmctl first verifies SSH connectivity using libssh2 (with a 30-second retry timeout), then hands off to the system ssh binary for full interactive terminal support. SSH options StrictHostKeyChecking=no and UserKnownHostsFile=/dev/null are set automatically.
For user-mode networking, vmctl connects to 127.0.0.1 on the forwarded host port. For TAP networking, it discovers the guest IP via ARP.
Examples
# SSH into the only VM in VMFile.kdl
vmctl ssh
# SSH into a specific VM
vmctl ssh myvm
# Override user and key
vmctl ssh myvm --user root --key ~/.ssh/special_key