[lxc-users] Error: /proc must be mounted

Fajar A. Nugraha list at fajar.net
Mon Nov 28 06:25:27 UTC 2016


On Mon, Nov 28, 2016 at 2:43 AM, Itamar Gal <itamarggal at gmail.com> wrote:

> Hey Fajar,
>
> Thank you for your help. Following your advice, I checked to make sure
> that lxcfs is running:
>
>     $ pgrep lxcfs | xargs ps -f -p
>
>     UID        PID  PPID  C STIME TTY          TIME CMD
>     root     29988     1  0 13:17 ?        00:00:00 /usr/bin/lxcfs
> /var/lib/lxcfs
>
>
>

You should also be able to look at /var/lib/lxcfs and see what's in there.
There should be cgroup and proc mounts with the corrent content.



> It appears that is running. I then tried creating a new container as
> you suggested:
>
>     sudo lxc-create --template=download --name=lxc-debug
>
>
> I chose the following options from the interactive prompt:
>
>     Distribution: ubuntu
>     Release: trusty
>     Architecture: amd64
>
>
> Then I started the container and checked to make sure it was running:
>
>     $ sudo lxc-start -n lxc-debug
>     $ sudo lxc-ls --fancy | grep debug
>
>     lxc-debug      RUNNING 0         -      10.0.3.142               -
>
>
> According to the printed instructions no user accounts are created for
> downloaded containers and you have to use lxc-attach to create the
> initial account. Just as a sanity check I tried logging in using
> lxc-console and the ubuntu user, but sure enough the usual password
> from the ubuntu template didn't work (i.e. I was unable to
> authenticate). So I tried using lxc-attach instead. Unfortunately
> lxc-attach was unsuccessful:
>
>     $ sudo lxc-attach -n lxc-debug -- "echo testing"
>
>     lxc-attach: lxc-debug: attach.c:
>     lxc_attach_to_ns: 252 No such file or directory - failed to open
> namespace: 'mnt'.
>     lxc-attach: lxc-debug: attach.c: lxc_attach: 981 failed to enter
> the namespace
>
>
>
Hmmm ... that seems like a much bigger problem.

Are you sure you have correct version of everything? e.g. lxc userland and
lxcfs?
Are there perhaps stray versions somewhere (e.g. have you compiled lxc in
the past, and install it in the /usr/local)

"which lxc-attach" and "lxc-attach --version" should give more insight.



> In fact, it turns out that I get the same error message when
> attempting to use lxc-attach with my older (working) containers.
> Moving on, I used chroot to set the password for the ubuntu user:
>
>     $ sudo chroot /var/lib/lxc/lxc-debug/rootfs passwd ubuntu
>
>
> After setting the password I can use lxc-console to enter the
> container, but the ps command still doesn't work - it generates the
> same error message.
>
> Any further thoughts? Thanks again for your help.
>


You can try this command in the container. Here's from mine:

# grep /proc /proc/mounts
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
...
lxcfs /proc/cpuinfo fuse.lxcfs
rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
lxcfs /proc/diskstats fuse.lxcfs
rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
lxcfs /proc/meminfo fuse.lxcfs
rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
lxcfs /proc/stat fuse.lxcfs
rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
lxcfs /proc/swaps fuse.lxcfs
rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
lxcfs /proc/uptime fuse.lxcfs
rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0

If you're missing the first entry, or the lxcfs entries, or don't even have
/proc/mounts altogether, then I'm not sure what else to check.

You could PROBABLY try to upgrade the kernel (
http://packages.ubuntu.com/precise-updates/linux-generic-lts-trusty), to
see if for some reason the problem is caused by missing namespace support
in your kernel. If that doesn't work, or you can't afford downtime on this
server, then my best advice at this point would be to "setup a new trusty
server as lxc host"

-- 
Fajar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20161128/66c030b3/attachment.html>


More information about the lxc-users mailing list