Nested Docker in LXD on Jammy Jellyfish

I have had no issues running docker inside of a Focal Fossa LXD container. Recently I tried to install docker inside a LXD container running Jammy Jellyfish. The docker service does not seem to start.

root@Search-Engine:~# docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
root@Search-Engine:~# systemctl status docker
Failed to dump process list for 'docker.service', ignoring: Input/output error
× docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2022-07-03 20:12:53 UTC; 20s ago
TriggeredBy: × docker.socket
    Process: 420 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
   Main PID: 420 (code=exited, status=1/FAILURE)
      Tasks: 0
     Memory: 160.0K
     CGroup: /system.slice/docker.service

Jul 03 20:12:53 Search-Engine systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Jul 03 20:12:53 Search-Engine systemd[1]: Stopped Docker Application Container Engine.
Jul 03 20:12:53 Search-Engine systemd[1]: docker.service: Start request repeated too quickly.
Jul 03 20:12:53 Search-Engine systemd[1]: docker.service: Failed with result 'exit-code'.
Jul 03 20:12:53 Search-Engine systemd[1]: Failed to start Docker Application Container Engine.```
1 Like

I encountered the same problem as you under debain

Have you solved it yet

Yes, I have. By the way, be sure to watch my YouTube channel devoted to LXD The solution is to install your Docker in 22.04 with the script from the docker web site. Also, be sure to set security.nesting=true to nest inside of a LXD:

curl -sSL | sh

I can vouch for Scott’s channel. My whole day is gone watching his videos :slight_smile: Thank you @Scott_T

When I create a container under ubunt20.4.6, I will report these two types of errors. Have you ever encountered it?

My Docker is installed with 20.10.0. What version is yours,

docker: Error response from daemon: Could not check if docker-default AppArmor profile was loaded: open /sys/kernel/security/apparmor/profiles: permission denied.

docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: can’t get final child’s PID from pipe: EOF: unknown.

@cc_jack What host is your LXD installed on? Perhaps set both security.nesting=true. I nest docker inside of LXD on both ubuntu 20.04 and 22.04 LXD containers. Usually OCI runtime errors in Docker are indicative of not having security.nesting=true which is what you need to nest docker inside of LXD.

I created ubunt 20.04.6 in the LXD that comes with QNAP NAS

I have previously run this command on QNAP NAS with security. testing=true, and also in ubunt 20.04.6, but it was of no use. I have tried changing the Docker version to adapt to ubunt 20.04.6,

My ultimate goal is to run Docker on Ubuntu 20.04.6, especially the homeassistant hasso supervisor

@cc_jack ohhhhhhhh well QNAP NAS is very different. Would you please come by my chat to discuss this subject . I have two QNAP NAS systems and their implementation of LXD results in a few minor issues that I need to ask you some questions and tell you some workarounds.