Compiled sources from GitHub, LXD startup issues

I cloned the repo and followed the setup here, Installing LXD - LXD documentation

I’m running Ubuntu 22.04

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

thanks

That looks about right.

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.

Alright, I installed qemu. A mention to it might be useful on the installing instructions page too. I think I saw it mentioned on the FAQ.

Running the following with and without sudo did not work.

$ echo $$ > /sys/fs/cgroup/cgroup.procs
bash: /sys/fs/cgroup/cgroup.procs: Permission denied

Current state is

$ 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

thank you for the help so far

*edit: Forgot to add the following output

$ cat /proc/self/cgroup
0::/user.slice/user-1000.slice/user@1000.service/app.slice/app-org.gnome.Terminal.slice/vte-spawn-a5c0a4a6-b9b4-4ce1-bc80-5df079917586.scope

Ah, so you’ll need to do:

  • sudo -E PATH=${PATH} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} -s
  • echo $$ > /sys/fs/cgroup/cgroup.procs
  • $(go env GOPATH)/bin/lxd --group sudo

As the write to cgroup.procs must be done as root and you need it all done in the same shell as only that shell will be moved to the root cgroup.

GOOD NEWS!!
It’s working.

Still have one issue with cgroups

$ 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

  1. How can I solve the cgroup network priority controller issue?
  2. How can I set lxd to run in the background and not just in the terminal?
  3. Will I have to run those 3 commands everytime?

I really appreciate all the help.
-Jason

You can’t, cgroup2 doesn’t support network priority at this stage, this will need kernel work to happen.

LXD itself doesn’t support going in the background, you need to use your init system (likely systemd) to achieve that.

Yep, you’d likely want to turn that into a shell script and then make a systemd unit around that to have it run in the background on startup.

Alright, I understand.
Cheers Mate!!! :beers: :beers: :beers:
Thank you for all the help!!

1 Like

@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

Write a script that does it and then have systemd run that script.