When I tried to run the final step I get the following errors.
$ sudo -E PATH=${PATH} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} $(go env GOPATH)/bin/lxd --group sudo
WARNING[2022-06-03T11:12:26-05:00] - Couldn’t find the CGroup blkio, disk I/O limits will be ignored
WARNING[2022-06-03T11:12:26-05:00] - Couldn’t find the CGroup blkio.weight, disk priority will be ignored
WARNING[2022-06-03T11:12:26-05:00] - Couldn’t find the CGroup CPU controller, CPU time limits will be ignored
WARNING[2022-06-03T11:12:26-05:00] - Couldn’t find the CGroup CPUacct controller, CPU accounting will not be available
WARNING[2022-06-03T11:12:26-05:00] - Couldn’t find the CGroup CPU controller, CPU pinning will be ignored
WARNING[2022-06-03T11:12:26-05:00] - Couldn’t find the CGroup hugetlb controller, hugepage limits will be ignored
WARNING[2022-06-03T11:12:26-05:00] - Couldn’t find the CGroup network priority controller, network priority will be ignored
WARNING[2022-06-03T11:12:26-05:00] Instance type not operational driver=qemu err=“QEMU command not available for CPU architecture” type=virtual-machine
The QEMU part can be fixed by installing QEMU on your system.
The rest is because of your cgroup2 setup. I suspect your current shell is in a sub-cgroup with limited controller availability (you can check with cat /proc/self/cgroup).
You should try to do:
echo $$ > /sys/fs/cgroup/cgroup.procs
Which should then change your cgroup to the root and make LXD much happier.
$ sudo -E PATH=${PATH} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} $(go env GOPATH)/bin/lxd --group sudo
[sudo] password for jason:
WARNING[2022-06-03T12:06:37-05:00] - Couldn't find the CGroup blkio, disk I/O limits will be ignored
WARNING[2022-06-03T12:06:37-05:00] - Couldn't find the CGroup blkio.weight, disk priority will be ignored
WARNING[2022-06-03T12:06:37-05:00] - Couldn't find the CGroup CPU controller, CPU time limits will be ignored
WARNING[2022-06-03T12:06:37-05:00] - Couldn't find the CGroup CPUacct controller, CPU accounting will not be available
WARNING[2022-06-03T12:06:37-05:00] - Couldn't find the CGroup CPU controller, CPU pinning will be ignored
WARNING[2022-06-03T12:06:37-05:00] - Couldn't find the CGroup hugetlb controller, hugepage limits will be ignored
WARNING[2022-06-03T12:06:37-05:00] - Couldn't find the CGroup network priority controller, network priority will be ignored
$ sudo -E PATH=${PATH} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} -s
[sudo] password for jason:
# echo $$ > /sys/fs/cgroup/cgroup.procs
# $(go env GOPATH)/bin/lxd --group sudo
WARNING[2022-06-03T12:40:26-05:00] - Couldn't find the CGroup network priority controller, network priority will be ignored
I was able to open a second terminal window and launch centos8 then install docker and run hello-world all within the lxc container. This is good because the main reason for running lxd is to run some docker images that require systemd within them. I didn’t build the images and would rather use supervisord instead of systemd. I hope it works as the docker running on the Ubuntu 22 host is not playing well at all with these docker images.
Lastly
How can I solve the cgroup network priority controller issue?
How can I set lxd to run in the background and not just in the terminal?
@Jason_Alexander
Thank you for your question and @stgraber answers.
I’ve not been able to understand how to create a lxd.service that would incorporate the rather strange echo $$ > /sys/fs/cgroup/cgroup.procs
If you have a solution, please could you post it
Thanks
John