Launching a privileged docker container in an LXD fails with this:

docker: Error response from daemon: linux runtime spec devices: lstat /dev/.lxc/proc/1482/fdinfo/12: no such file or directory.

Steps to reproduce:

lxc launch ubuntu-daily:16.04 docker -p default -p docker
lxc exec docker -- apt install docker.io -y
lxc exec docker bash
sudo curl -L git.io/scope -o /usr/local/bin/scope
sudo chmod a+x /usr/local/bin/scope
scope launch

Original guide: LXD 2.0: Docker in LXD

Bug report: Docker containers failing in /dev/.lxc/proc directory #2825 - GitHub

How to make it work?

  • That guide you linked says you need A Docker image which behaves when confined by user namespaces, or alternatively make the parent LXD container a privileged container (security.privileged=true). Is it possible the issue is with scope? Can you run lxc exec docker -- docker run --detach --name app carinamarina/hello-world-app, or alternatively, does it work in a privileged container? – Jonathan Y. May 9 '17 at 21:39
  • LXD was a privileged container (the 'docker' LXD profile gives security.privileged=true). I've tried some hello-world image in a privileged LXD - same problem. Don't have this config any more, moved to KVM. – Velkan May 10 '17 at 7:54

Per Stephane Graber (LXD lead developer) you don’t need the LXD docker profile any more !

See… https://github.com/lxc/lxd/issues/3299

  • Please, try to always provide the version number since when it's fixed. It's always frustrating to clone repos, search for the commit and the next release after it. – Velkan Nov 24 '17 at 7:06

Just to clean this up a bit, this is solved quite nicely (as @bmullan points out).

16.04, lxd version 2.21, the following sequence works:

lxc launch ubuntu-daily:xenial xenial
lxc config set xenial security.nesting true
lxc exec xenial snap install docker
lxc exec xenial docker run ubuntu ls

The docker.io package, and the docker snap both work, but are different versions, and have different update policies, etc. The snap version used above is 17.06.2-ce, while the docker.io package in xenial is 1.13.1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.