-
Notifications
You must be signed in to change notification settings - Fork 933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use nested virtualization with LXC container #11674
Comments
Please show |
If there is another LXC container running with a LXC VM inside, launch a VM inside a new LXC causes this error: Error: Failed to run: forklimits fd=3 -- /snap/lxd/24846/bin/qemu-system-x86_64 -S -name u22 -uuid f09540b7-8133-425e-a68d-e69de6338a6e -daemonize -cpu host,hv_passthrough -nographic -serial chardev:console -nodefaults -no-user-config -sandbox on,obsolete=deny,elevateprivileges=allow,spawn=allow,resourcecontrol=deny -readconfig /var/snap/lxd/common/lxd/logs/u22/qemu.conf -spice unix=on,disable-ticketing=on,addr=/var/snap/lxd/common/lxd/logs/u22/qemu.spice -pidfile /var/snap/lxd/common/lxd/logs/u22/qemu.pid -D /var/snap/lxd/common/lxd/logs/u22/qemu.log -smbios type=2,manufacturer=Canonical Ltd.,product=LXD -runas lxd: : Process exited with non-zero value 1
Try `lxc info --show-log local:u22` for more info --show log result: Name: u22
Status: STOPPED
Type: virtual-machine
Architecture: x86_64
Created: 2023/05/17 11:09 UTC
Log:
qemu-system-x86_64:/var/snap/lxd/common/lxd/logs/u22/qemu.conf:115: vhost-vsock: unable to set guest cid: Address already in use
lxc config show u22 --expanded architecture: x86_64
config:
image.architecture: amd64
image.description: Ubuntu jammy amd64 (20230517_07:42)
image.os: Ubuntu
image.release: jammy
image.serial: "20230517_07:42"
image.type: disk-kvm.img
image.variant: default
volatile.base_image: 2827820539fec451e353579dea6ee5a8fbead380e055c7e5700c019a751bdd76
volatile.cloud-init.instance-id: 2b85d2a7-ec5e-4233-872d-4a3e7513a930
volatile.eth0.hwaddr: 00:16:3e:05:de:19
volatile.uuid: f09540b7-8133-425e-a68d-e69de6338a6e
volatile.uuid.generation: f09540b7-8133-425e-a68d-e69de6338a6e
volatile.vsock_id: "4"
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
root:
path: /
pool: default
type: disk
ephemeral: false
profiles:
- default
stateful: false
description: "" output for the another LXC VM: architecture: x86_64
config:
image.architecture: amd64
image.description: Ubuntu jammy amd64 (20230517_07:42)
image.os: Ubuntu
image.release: jammy
image.serial: "20230517_07:42"
image.type: disk-kvm.img
image.variant: default
volatile.base_image: 2827820539fec451e353579dea6ee5a8fbead380e055c7e5700c019a751bdd76
volatile.cloud-init.instance-id: 1b0874b0-4739-43d2-9dbe-f4ff99af6cd8
volatile.eth0.host_name: tap628ed6fe
volatile.eth0.hwaddr: 00:16:3e:03:fc:3e
volatile.last_state.power: RUNNING
volatile.uuid: b7783b4c-6b1d-4803-9f39-071c99841cc8
volatile.uuid.generation: b7783b4c-6b1d-4803-9f39-071c99841cc8
volatile.vsock_id: "4"
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
root:
path: /
pool: default
type: disk
ephemeral: false
profiles:
- default
stateful: false
description: ""
I guess the reason is that both VMs within these LXC containers using same vsock_id Race condition bug? |
Its a duplicate of https://github.com/lxc/lxd/issues/11508 in that case. |
Required information
Issue description
Unable to run LXD VM inside a LXD VM image (nested virtualization)
Steps to reproduce
on host:
lxc launch images:ubuntu/22.04 u22 -c security.nesting=true lxc config device add u22 kvm unix-char source=/dev/kvm lxc config device add u22 vhost-net unix-char source=/dev/vhost-net lxc config device add u22 vhost-vsock unix-char source=/dev/vhost-vsock lxc exec u22 bash
on VM:
Getting this error:
The text was updated successfully, but these errors were encountered: