LXD doesn't have a uid/gid allocation

Hi All,
I was running LXD (3.21) initially with snap. I had some issues. So I snap remove --purgeed it.
Decided to give LXC that is default to my OS using apt-get (I am on Mint 19.2). It shows LXC 3.0.8. I apt-get installed it.

Initialted lxd init.

While I tried to lauch 1st container, it downloaded image, but failed with below error.

makrand@mint-gl63:~$ lxc launch ubuntu:18.04 first
Creating first
Error: Failed container creation: Create LXC container: LXD doesn't have a uid/gid allocation. In this mode, only privileged containers are supported

Do I need to manually delete LXD user-group after snap remove --purge step?
What am I missing here?

Since you’re not using the snap anymore, you’re now using a build which uses /etc/subuid and /etc/subgid from your system. So you’ll need to go configure that with a suitably sized allocation for the root user so lxd can function.

Hi Stephane,

Thansk for replying. Any hint how can I do the same? Never tried this before.

PS - I was busy with something…so cound’t reply here earlier.

Never mind…got the solution. Just edit the subuid & subgid file and add entry for root as shown below.

makrand@mint-gl63:/etc$ cat /etc/subuid
makrand:100000:65536
root:1000000:65536
makrand@mint-gl63:/etc$ cat /etc/subgid
makrand:100000:65536
root:1000000:65536
makrand@mint-gl63:/etc$

Although, I am not sure about the sigifiance of this entry. Is there any manual/text avaialbe that explains this subuid and subgid?

Take a look at https://ubuntu.com/blog/nested-containers-in-lxd