Add Virtualization/KVM interface#934
Open
locnnil wants to merge 2 commits into
Open
Conversation
4 tasks
akcano
requested changes
Jul 10, 2026
akcano
left a comment
Contributor
There was a problem hiding this comment.
Docs LGTM, with a few minor fixes.
Contributor
|
I want to understand more about the security implications of this. If it's unsafe to connect the interface when the container runs untrusted code (i.e. agents), we should at least document that. We should try to prevent local privilege escalation for the host user. I found some related info here but haven't looked too deeply yet: containerd/containerd#7442. |
- create interface to enable access of host virtualization device nodes /dev/kvm, /dev/vhost-vsock, /dev/vsock and /dev/vhost-net Signed-off-by: Lincoln Wallace <lincoln.wallace@canonical.com>
Signed-off-by: Lincoln Wallace <lincoln.wallace@canonical.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a
virtualizationinterface (name still TBD) that lets a workshop launch hardware-accelerated (KVM) virtual machines from inside its container, without requiring the workshop itself to run as a VM.The system SDK gains a single
virtualizationslot; any regular SDK can declare a matchingvirtualizationplug. When plug and slot are connected, these host character devices are passed through as LXDunix-chardevices:/dev/kvm/dev/vhost-net/dev/vhost-vsock/dev/vsockThey are group-owned by the
workshopuser, mode0660, so no world access is granted./dev/net/tunis not passed through because LXD already provides it in the container. Devices absent on the host (e.g. vsock modules not loaded) are markedrequired: falseand do not block launch.The interface follows the existing device-interface pattern (
gpu,camera): atype=noneconfig device carries the serialized config, round-tripped byLxdToSdkProfile. It is not auto-connected (deny-auto-connection: true) because it grants privileged access to host virtualization devices; it must be connected manually viaworkshop connectcommand.Self-review quick check
Docs
Procedure:
[ ] I have checked and added or updated relevant release notes.Content:
tutorial/andhow-to/sections).docs/.coverage.yamlupdated, coverage tags added (.. artefact).Or: