linuxubuntu-14.04lxclxc-docker

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


I was trying to run cross-compiled lxc image on another machine as followings: I created an lxc image on a ubuntu 14.04 via command:

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

I checked it that the created image customBusyBox was running fine on this machine. Now I created its .tar.gz file i.e customBusyBox.tar.gz and copy it on another machine having same version of ubuntu i.e 14.04 via scp command. where then I extracted customBusyBox image to /var/lib/lxc folder. Then as super user I tried to run the image via following command:

lxc-start -F -n customBusyBox

Then I got this error:

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.

I tried searching for its solution on net but no help: Someone please suggest some solution.

Thanks


Solution

  • I was able to solve this error.

    Following was the config file of created customBusyBox container, on first host machine:

    # 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
    

    I removed the following lines from the above config file on another host machine:

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

    Then I tried and it ran successfully there also. Actually there was not any such directory i.e /lib64 or /usr/lib64 present on this second host machine that's why there was a mount error coming for these directories.

    config file is present at path : /var/lib/lxc/<container-name>/