Skip to content

Add --vsock option for guest-to-host Unix socket IPC - #88

Merged
slp merged 1 commit into
libkrun:mainfrom
phact:vsock
Aug 24, 2026
Merged

Add --vsock option for guest-to-host Unix socket IPC#88
slp merged 1 commit into
libkrun:mainfrom
phact:vsock

Conversation

@phact

@phact phact commented Aug 11, 2026

Copy link
Copy Markdown

Allow mapping guest AF_VSOCK ports to Unix sockets on the host via libkrun's krun_add_vsock_port(). A guest connection to (CID 2, PORT) is proxied to the host socket at PATH, so host services can be reached without giving the guest any network access. The flag can be repeated to map multiple ports:

krunvm start myvm --vsock 8765:/run/bridge.sock -- ...

Only wired into 'krunvm start' for now; the mapping is per-invocation and intentionally not persisted in the VM config.

Allow mapping guest AF_VSOCK ports to Unix sockets on the host via
libkrun's krun_add_vsock_port(). A guest connection to (CID 2, PORT)
is proxied to the host socket at PATH, so host services can be reached
without giving the guest any network access. The flag can be repeated
to map multiple ports:

    krunvm start myvm --vsock 8765:/run/bridge.sock -- ...

Only wired into 'krunvm start' for now; the mapping is per-invocation
and intentionally not persisted in the VM config.

Signed-off-by: phact <estevezsebastian@gmail.com>
@slp

slp commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

LGTM, thanks!

@slp
slp merged commit 8067488 into libkrun:main Aug 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants