From 1490debd620e254e151761fcc30ffdc9ec63e5fe Mon Sep 17 00:00:00 2001 From: Sam Leonard Date: Fri, 12 Apr 2024 17:03:00 +0100 Subject: [PATCH] man: add ssh example for vmspawn --- man/systemd-vmspawn.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/man/systemd-vmspawn.xml b/man/systemd-vmspawn.xml index e8d460ef4fc..336ebe9f520 100644 --- a/man/systemd-vmspawn.xml +++ b/man/systemd-vmspawn.xml @@ -541,6 +541,22 @@ $ systemd-vmspawn \ Note: this example also uses a kernel command line argument to ensure SELinux isn't started in enforcing mode. + + + SSH into a running VM using <command>systemd-ssh-proxy</command> + + +$ mkosi build +$ my_vsock_cid=3735928559 +$ systemd-vmspawn \ + -D mkosi.output/system \ + --private-users $(grep $(whoami) /etc/subuid | cut -d: -f2) \ + --linux mkosi.output/system.efi \ + --vsock-cid $my_vsock_cid \ + enforcing=0 +$ ssh root@vsock/$my_vsock_cid -i /run/user/$UID/systemd/vmspawn/machine-*-system-ed25519 + + -- 2.47.3