LXD with systemd

Is it better to run systemd when using LXD ?
Or is this irrelevant ?
When will someone from Canonical have a YouTube
video on the new “Canonical LXD” ?

Hi @bernard010,

I’m not sure I understand the question. If installing LXD via snap then systemd is a requirement, since snapd requires systemd to function and snap will manage the units for you.

If you are building from source then systemd is not a requirement, but if you would like LXD to start again on reboot etc. then you will need to write a systemd unit yourself or use another method.

1 Like

Your answer to my question needs to be reflected
in the LXD Documentation.
Thus this small overlooked problem could be avoided in the future.

Can you clarify on what you would like to see in the documentation? What is the use case?

From my understanding, if you use the LXD snap, it’ll work out of the box and you don’t need any additional configuration (so no need to document anything). If you install on another distribution, it’s up to their packaging to handle how LXD is started (and we can’t document that, since it’s up to the distribution). If you build from source, it’s your responsibility to make sure LXD is started (through systemd or whatever method you prefer).

1 Like

So you say that the Host system does not have to be running using systemd for LXD to operate correctly.
That is contrary to what was stated above.

I’m not saying that you don’t need systemd. I’m saying that you don’t need additional configuration if you’re using the snap, since the snap requires snapd which in turn requires systemd. So this is not anything specific to LXD.

Thanks for the clarification.

systemd isn’t required for LXD - distributions such as Alpine Linux include LXD in their repositories and do not use systemd. However if not using systemd on the host, it is required to mount certain cgroups on the host if you want to run containers that use systemd.

1 Like

Thank you for your response very much appreciated.
I have been testing an instance without systemd.
Seems to work just fine.

1 Like