Installing LXD inside a Docker Container (on MacOS)

Update:
I see one can only install the LXD-client and not the Server (on MacOS and Windows).

:thinking:
I might be wrong, but it reads this:

To install the feature branch of LXD, run:
brew install lxc

So maybe you confuse LXD and LXC.

Short summary:
lxc is (in this case) the LXD-client (I know its confusing, but I guess the name won’t be changed)
##########################################

Regarding your inital problem:
I guess you should clarify the title “lxd inside docker container on macos” and you might give some more details, what you tried so far and what problems you exactly encountered.

But my guesses would be:

  • Maybe Docker works differently on Mac than on Linux It indeed works differenty, see below.
  • In general LXD will need much access to the host system (thus it needs to run nested etc. to support running LXD inside LXD for example: https://ubuntu.com/blog/lxd-2-0-lxd-in-lxd-812) and docker might not provide that out of the box.

Also did you try to ask here:

or here:

because it seems to be more a docker question, than an lxd question.

Update 2:
Interesting I found this:

Functionally, there is no difference. Startup is slower from cold on OSX because as other commenters pointed out, the underlying Linux VM

Source: Reddit - Dive into anything

So you might gain nothing trying to use docker, because it also uses a VM (on MacOS).
Which is only logical because containers require the hosts kernel and the kernel of macos is different from the linux kernel.