我试图在另一台机器上运行交叉编译的lxc映像,如下所示: 我通过命令在ubuntu 14.04上创建了一个lxc image :
lxc-create -t /usr/share/lxc/templates/lxc-busybox -n customBusyBox
我检查了创建的图像 customBusyBox 在此计算机上正常运行。现在我创建了 .tar.gz 文件,即 customBusyBox.tar.gz ,并将其复制到具有相同版本的ubuntu的另一台机器上,即14.04 via 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.
我尝试在网上搜索其解决方案,但没有帮助: 有人请建议一些解决方案。
由于
答案 0 :(得分:0)
我能够解决这个错误。
以下是第一台主机上创建的 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>/