lxc-start: utils.c: safe_mount: 1746 没有这样的文件或目录 - 无法将 /lib64 挂载到 /usr/lib/i386-linux-gnu/lxc/lib64

lxc-start: utils.c: safe_mount: 1746 No such file or directory - Failed to mount /lib64 onto /usr/lib/i386-linux-gnu/lxc/lib64

我试图在另一台机器上 运行 交叉编译 lxc 图像,如下所示: 我 通过命令在 ubuntu 14.04 上创建了一个 lxc 图像

lxc-create -t /usr/share/lxc/templates/lxc-busybox -n customBusyBox

我检查了创建的图像 customBusyBox 运行在这台机器上没问题。现在我创建了它的 .tar.gz 文件,即 customBusyBox.tar.gz 将它复制到另一个 机器具有相同版本的 ubuntu 即 14.04 通过 scp 命令。 然后我将 customBusyBox 图像提取到 /var/lib/lxc 文件夹中。 然后作为超级用户,我尝试通过以下命令 运行 图像

lxc-start -F -n customBusyBox

然后我得到这个错误:

lxc-start: utils.c: safe_mount: 1746 No such file or directory - Failed to mount /lib64 onto /usr/lib/i386-linux-gnu/lxc/lib64
                                                                                                                              lxc-start: conf.c: mount_entry: 1650 No such file or directory - failed to mount '/lib64' on '/usr/lib/i386-linux-gnu/lxc/lib64'
                                                         lxc-start: conf.c: lxc_setup: 3790 failed to setup the mount entries for 'openWrt'
                                                                                                                                           lxc-start: start.c: do_start: 826 Failed to setup container "openWrt".
            lxc-start: sync.c: __sync_wait: 57 An error occurred in another process (expected sequence number 3)
                                                                                                                lxc-start: start.c: __lxc_start: 1338 Failed to spawn container "openWrt".
                                                                                                                                                                                          lxc-start: tools/lxc_start.c: main: 360 The container failed to start.
lxc-start: tools/lxc_start.c: main: 364 Additional information can be obtained by setting the --logfile and --logpriority options.

我尝试在网上搜索它的解决方案但没有帮助: 有人请提出一些解决方案。

谢谢

我能够解决这个错误。

以下是在第一台主机上创建的 customBusyBox 容器的配置文件:

# Template used to create this container: /usr/share/lxc/templates/lxc-busybox
# Parameters passed to the template:
# For additional config options, please look at lxc.container.conf(5)
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = lxcbr0
lxc.network.hwaddr = 00:16:3e:1d:e5:8c
lxc.rootfs = /var/lib/lxc/OpenWrt/rootfs
lxc.haltsignal = SIGUSR1
lxc.utsname = OpenWrt
lxc.tty = 1
lxc.pts = 1
lxc.cap.drop = sys_module mac_admin mac_override sys_time

# When using LXC with apparmor, uncomment the next line to run unconfined:
#lxc.aa_profile = unconfined
lxc.mount.entry = /lib lib none ro,bind 0 0
lxc.mount.entry = /usr/lib usr/lib none ro,bind 0 0
lxc.mount.entry = /lib64 lib64 none ro,bind 0 0
lxc.mount.entry = /usr/lib64 usr/lib64 none ro,bind 0 0
lxc.mount.entry = /sys/kernel/security sys/kernel/security none ro,bind,optional 0 0
lxc.mount.auto = proc:mixed sys

从另一台主机上的配置文件中删除了以下行:

lxc.mount.entry = /lib64 lib64 none ro,bind 0 0
lxc.mount.entry = /usr/lib64 usr/lib64 none ro,bind 0 0

然后我试了,运行 也成功了。实际上 not 任何这样的目录,即 /lib64 或 /usr/lib64 present主机,这就是为什么这些目录出现安装错误的原因。

配置文件存在于路径:/var/lib/lxc/<container-name>/