Krunkit: support SSHOverVsock and replace SSH-based guestagent connection with vsock#4822
Conversation
There was a problem hiding this comment.
SSHOverVsock can be implemented too?
There was a problem hiding this comment.
Yes, I think it should be possible but maybe in a different PR?
[EDIT]: NVM, I'll do it in this PR itself
0e0e40c to
74a847d
Compare
SSHOverVsock and replace SSH-based guestagent connection with vsock
74a847d to
dd630c0
Compare
AkihiroSuda
left a comment
There was a problem hiding this comment.
Thanks, but with this commit I can no longer start an existing instance (Fedora 43)
$ limactl --debug start gpu
[...]
INFO[0000] [hostagent] hostagent socket created at /Users/suda/.lima/gpu/ha.sock
DEBU[0000] [hostagent] Start udp DNS listening on: 127.0.0.1:62489
DEBU[0000] [hostagent] Start tcp DNS listening on: 127.0.0.1:57693
DEBU[0001] received an event event="{2026-04-23 03:22:57.454603 +0900 JST {false false false [] 57692 <nil> <nil> <nil>}}"
INFO[0001] SSH Local Port: 57692
INFO[0001] [hostagent] Driver stopped due to error: "exit status 2"
INFO[0001] [hostagent] Shutting down the host agent
INFO[0001] [hostagent] Waiting for the essential requirement 1 of 3: "ssh"
DEBU[0001] received an event event="{2026-04-23 03:22:57.469493 +0900 JST {false false true [] 0 <nil> <nil> <nil>}}"
DEBU[0001] External driver krunkit stopped successfully
FATA[0001] exiting, status={Running:false Degraded:false Exiting:true Errors:[] SSHLocalPort:0 CloudInitProgress:<nil> PortForward:<nil> Vsock:<nil>} (hint: see "/Users/suda/.lima/gpu/ha.stderr.log") ha.stderr.log:
[...]
{"level":"info","msg":"hostagent socket created at /Users/suda/.lima/gpu/ha.sock","time":"2026-04-23T03:22:56+09:00"}
{"level":"debug","msg":"Start udp DNS listening on: 127.0.0.1:62489","time":"2026-04-23T03:22:56+09:00"}
{"level":"debug","msg":"Start tcp DNS listening on: 127.0.0.1:57693","time":"2026-04-23T03:22:56+09:00"}
{"level":"info","msg":"Driver stopped due to error: \"exit status 2\"","time":"2026-04-23T03:22:57+09:00"}
{"level":"info","msg":"Shutting down the host agent","time":"2026-04-23T03:22:57+09:00"}
{"level":"info","msg":"Waiting for the essential requirement 1 of 3: \"ssh\"","time":"2026-04-23T03:22:57+09:00"}
{"level":"debug","msg":"executing script \"ssh\"","time":"2026-04-23T03:22:57+09:00"}
{"level":"debug","msg":"External driver krunkit stopped successfully","time":"2026-04-23T03:22:57+09:00"}
driver.stderr.log:
[...]
time="2026-04-23T03:22:56+09:00" level=info msg="Starting krun VM (hint: to watch the progress, see \"/Users/suda/.lima/gpu/krunkit.log\")"
time="2026-04-23T03:22:56+09:00" level=info msg="krunkitCmd.Args: [krunkit --memory 4096 --cpus 4 --device virtio-serial,logFilePath=/Users/suda/.lima/gpu/serial.log --krun-log-level 3 --restful-uri none:// --device virtio-blk,path=/Users/suda/.lima/gpu/disk,format=raw --device virtio-blk,path=/Users/suda/.lima/gpu/cidata.iso --device virtio-vsock,port=2222,socketURL=/Users/suda/.lima/gpu/ga.sock,connect --device virtio-net,type=unixgram,fd=14,mac=52:55:55:83:5b:be]"
time="2026-04-23T03:22:56+09:00" level=info msg="ssh.overVsock is false, using usernet forwarder for SSH"
time="2026-04-23T03:22:57+09:00" level=error msg="Error during Start" error="exit status 2"
time="2026-04-23T03:22:57+09:00" level=debug msg="Start error channel closed"
time="2026-04-23T03:22:57+09:00" level=debug msg="Received AdditionalSetupForSSH request"
time="2026-04-23T03:22:57+09:00" level=debug msg="AdditionalSetupForSSH succeeded"
time="2026-04-23T03:22:57+09:00" level=debug msg="Received GetInfo request"
time="2026-04-23T03:22:57+09:00" level=debug msg="Received GetInfo request"
time="2026-04-23T03:22:57+09:00" level=debug msg="Received Stop request"
time="2026-04-23T03:22:57+09:00" level=warning msg="Failed to send interrupt signal" error="os: process already finished"
time="2026-04-23T03:22:57+09:00" level=debug msg="Stop succeeded"
Oh I forgot to add a check for |
Did you install it from the source? |
|
Or if we are now supported to use https://github.com/slp/homebrew-krun/blob/master/Formula/krunkit.rb (slp/krun, not slp/krunkit), the document has to be updated https://github.com/search?q=repo%3Alima-vm%2Flima+slp%2Fkrunkit&type=code |
|
Yup, I think |
|
Yes, it works for me with krunkit v1.2.1. Please update the docs and https://github.com/search?q=repo%3Alima-vm%2Flima+slp%2Fkrunkit&type=code , then LGTM |
5edd4c0 to
f1fcced
Compare
…tion with vsock Signed-off-by: Ansuman Sahoo <anshumansahoo500@gmail.com>
f1fcced to
a990219
Compare
Since the upstream issue(libkrun/krunkit#79) is now fixed, this PR transitions the krunkit driver from using SSH local socket forwarding for guestagent communication to virtio-vsock implementation.