root@lxc-container-01:~# lxc launch images:ubuntu/22.04 u22 -c security.nesting=true
Creating u22
Starting u22
root@lxc-container-01:~# lxc config device add u22 kvm unix-char source=/dev/kvm
Device kvm added to u22
root@lxc-container-01:~# lxc config device add u22 vhost-net unix-char source=/dev/vhost-net
Device vhost-net added to u22
root@lxc-container-01:~# lxc config device add u22 vhost-vsock unix-char source=/dev/vhost-vsock
Device vhost-vsock added to u22
root@lxc-container-01:~# lxc exec u22 -- bash
root@u22:~# lxd init
Would you like to use LXD clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [default=yes]:
Name of the new storage pool [default=default]:
Name of the storage backend to use (lvm, zfs, ceph, btrfs, dir) [default=zfs]: dir # Error with ZFS, lvm or btrfs
Would you like to connect to a MAAS server? (yes/no) [default=no]:
Would you like to create a new local network bridge? (yes/no) [default=yes]:
What should the new bridge be called? [default=lxdbr0]:
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: none
Would you like the LXD server to be available over the network? (yes/no) [default=no]:
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]:
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:
root@u22:~# lxd init --dump
config: {}
networks:
- config:
ipv4.address: 10.117.86.1/24
ipv4.nat: "true"
ipv6.address: none
description: ""
name: lxdbr0
type: bridge
project: default
storage_pools:
- config:
source: /var/snap/lxd/common/lxd/storage-pools/default
description: ""
name: default
driver: dir
profiles:
- config: {}
description: Default LXD profile
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
root:
path: /
pool: default
type: disk
name: default
projects:
- config:
features.images: "true"
features.networks: "true"
features.profiles: "true"
features.storage.volumes: "true"
description: Default LXD project
name: default
and got this error:
root@u22:~# lxc launch images:ubuntu/22.04 u22vm --vm
Creating u22vm
Starting u22vm
Error: Failed to run: forklimits limit=memlock:unlimited:unlimited fd=3 -- /snap/lxd/23155/bin/qemu-system-x86_64 -S -name u22vm -uuid 27647c37-c204-4d90-9eef-21f9641ffa34 -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/u22vm/qemu.conf -spice unix=on,disable-ticketing=on,addr=/var/snap/lxd/common/lxd/logs/u22vm/qemu.spice -pidfile /var/snap/lxd/common/lxd/logs/u22vm/qemu.pid -D /var/snap/lxd/common/lxd/logs/u22vm/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:u22vm` for more info