我在 Raspberry Pi 3B 上运行 Ubuntu MATE 16.04(内核版本 4.4.38-v7+)。我正在尝试使用 LXD,但对虚拟化不熟悉,我很难创建一个非特权容器。
这些是我遵循的安装步骤:
> sudo apt install lxd
> sudo lxd init
Do you want to configure a new storage pool (yes/no) [default=yes]? yes
Name of the storage backend to use (dir or zfs) [default=dir]: dir
Would you like LXD to be available over the network (yes/no) [default=no]? no
Do you want to configure the LXD bridge (yes/no) [default=yes]? yes
Would you like to setup a network bridge for LXD containers now? no
Do you want to use an existing bridge? yes
Bridge interface name: br0
> reboot
> sudo lxc launch ubuntu:xenial/armhf ct01
但是,最后一个命令的输出会产生错误:
error: Failed container creation:
- https://cloud-images.ubuntu.com/releases: LXD doesn't have a uid/gid allocation. In this mode, only privileged containers are supported.
这些是我的 subuid 和 subgid 文件的内容:
> cat /etc/subuid
ubuntupi:165536:65536
lxd:231072:65536
root:231072:65536
> cat /etc/subgid
ubuntupi:165536:65536
lxd:231072:65536
root:231072:65536
我尝试更改lxd
和root
更改,100000:65536
但结果仍然相同。我已经阅读了一些关于像这样和其他线程的 uid/gid 分配的参考资料,但我仍然无法找到解决这个问题的方法。谁能告诉我怎么了?如何创建非特权容器?