kubevirt: Passt network binding plugin fails on Ubuntu Noble 24.04
What happened: A clear and concise description of what the bug is.
Spin up a VM using the network binding plugin for passt interfaces following https://kubevirt.io/user-guide/network/net_binding_plugins/passt/ on Ubuntu 24.04 (Noble). The VM fails to start, citing the errors:
{"component":"virt-launcher","kind":"","level":"error","msg":"Failed to sync vmi","name":"vm-1","namespace":"vm","pos":"server.go:202","reason":"virError(Code=1, Domain=0, Message='internal error: Child process (/usr/bin/passt --one-off --socket /var/run/libvirt/qemu/run/passt/15-vm_vm-1-ua-default.socket --mac-addr 52:54:00:22:d9:3d --pid /var/run/libvirt/qemu/run/passt/15-vm_vm-1-ua-default-passt.pid --interface eth0 --log-file /var/run/kubevirt/passt.log --tcp-ports '~15000,~15001,~15004,~15006,~15008,~15009,~15020,~15021,~15053,~15090,3389,443') unexpected exit status 1: Couldn't create user namespace: Permission denied\n')","timestamp":"2024-07-12T10:25:51.627875Z","uid":"ea8dfc32-eda8-4300-9c86-0c6a201d09fb"}
The same configuration works on Ubuntu 22.04 (Jammy). It seems related to https://github.com/canonical/lxd/issues/12882:
k exec -ti -n vm virt-launcher-vm-1-786s6 -- unshare -U --mount-proc /bin/bash
unshare: unshare failed: Permission denied
command terminated with exit code 1
What you expected to happen: A clear and concise description of what you expected to happen.
VM should start with no errors.
How to reproduce it (as minimally and precisely as possible): Steps to reproduce the behavior.
Deploy a VM using passt network binding on Ubuntu (24.04) Noble. This requires multus to be installed.
Additional context: Add any other context about the problem here.
https://github.com/canonical/lxd/issues/12882 https://github.com/canonical/lxd/issues/11920
Environment:
- KubeVirt version (use
virtctl version): v1.2 - Kubernetes version (use
kubectl version): v1.28.9 - VM or VMI specifications: N/A
- Cloud provider or hardware configuration: https://kubevirt.io/user-guide/network/net_binding_plugins/passt/
- OS (e.g. from /etc/os-release): Ubuntu 24.04 (Jammy)
- Kernel (e.g.
uname -a): 6.8.0-38-generic - Install tools: KubeVirt and Multus
- Others: N/A
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 28 (24 by maintainers)
@sbrivio-rh: You can’t reopen an issue/PR unless you authored it or you are a collaborator.
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
I’ve just revisited this and integrated it with app armor. If you are running k8s v1.31+ you can set the following app armour profile on the
virt-launcherpod. Its based on the containerd default but gives it access tomountanduserns. It also solves the known issue https://github.com/kubevirt/kubevirt/issues/4290.I’d suggest adding a similar feature gate
KubevirtAppArmorProfileto write the app armor profile to/etc/apparmor.d/kubevirt.vmand modify the security context on thevirt-launcherpod to use this profile.