我正在尝试启动一个 lxd 容器,但是出现了以下错误:
lxc launch ubuntu:16.04
A criar o contentor
Error: Failed container creation: LXD doesn't have a uid/gid allocation. In this mode, only privileged containers are supported
我使用 cat /var/log/lxd/lxd.log 获得此信息(相关部分)
lvl=info msg="LXD 3.0.2 is starting in normal mode" path=/var/lib/lxd t=2018-11-10T13:42:30+0000
err="User \"root\" has no subuids" lvl=warn msg="Error reading default uid/gid map" t=2018-11-10T13:42:30+0000
lvl=warn msg="Only privileged containers will be able to run" t=2018-11-10T13:42:30+0000
...
关于如何解决这个问题有什么想法吗?
答案1
在 freenode #lxcontainers 上的 dnegreira 的帮助下,只需编辑 /etc/subuid 和 /etc/subgid 并添加
root:1000000:65536
到那些文件。