gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:21:32 30 4
gpt4 key购买 nike

我试图在另一台机器上运行交叉编译的 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 文件夹中。然后作为 super 用户,我尝试通过以下命令运行图像:

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

然后我试了一下,它也在那里成功运行了。实际上,在第二台主机上没有任何这样的目录,即/lib64 或/usr/lib64存在,这就是出现挂载错误的原因对于这些目录。

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

关于linux - lxc-start : utils. c: safe_mount: 1746 没有这样的文件或目录 - 无法将/lib64 挂载到/usr/lib/i386-linux-gnu/lxc/lib64,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42112749/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com