我在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分配的引用,如this和其他线程,但我仍然无法找到解决这个问题的方法。谁能告诉我什么错了?如何创建无特权的容器?