37

I followed docker instructions to install and verify the docker installation (from http://docs.docker.com/linux/step_one/).

I tried on 2 Ubuntu 14.04 machines and on both I got following error when starting docker daemon:

$ sudo docker daemon
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) 
INFO[0000] [graphdriver] using prior storage driver "aufs" 
INFO[0000] Option DefaultDriver: bridge                 
INFO[0000] Option DefaultNetwork: bridge                
WARN[0000] Running modprobe bridge nf_nat br_netfilter failed with    message: modprobe: WARNING: Module br_netfilter not found. , error: exit status 1 
INFO[0000] Firewalld running: false                     
WARN[0000] Your kernel does not support cgroup memory limit: mountpoint for memory not found 
WARN[0000] mountpoint for cpu not found                 
FATA[0000] Error starting daemon: Devices cgroup isn't mounted 

I appreciate any help to resolve this issue.

Rico
  • 58,485
  • 12
  • 111
  • 141
Dragan Nikolic
  • 1,536
  • 3
  • 17
  • 24

8 Answers8

39

I resolved this issue by starting the docker deamon manually using:

sudo service docker start

Simon
  • 509
  • 4
  • 3
31

Note: Looks like this issue was only present in Ubuntu 14.04 and earlier. The newer Ubuntu versions don't need this.

Try the following:

  • Log into Ubuntu as a user with sudo privileges.

  • Edit the /etc/default/grub file.

  • Set the GRUB_CMDLINE_LINUX value as follows:

    GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"

  • Save and close the file.

  • Update GRUB.

    $ sudo update-grub

  • Reboot your system.

Some folks have reported restarting the docker daemon works:

sudo systemctl restart docker

As noted above the newer docker documentation doesn't refer to this in the new Docker versions.

Update

This works for some folks on Ubuntu 14.04 or earlier:

sudo apt-get install cgroup-lite
Rico
  • 58,485
  • 12
  • 111
  • 141
  • 10
    this solved my problem too but I'd like to know what this cgroup thing actually does – KillerSnail Sep 03 '15 at 16:50
  • Unfortunately this does not solve the br_netfilter problem. – Veda Sep 24 '15 at 09:33
  • I solved the `br_netfilter` problem by installing `3.19.0-33-generic` linux image. – Mitar Nov 28 '15 at 23:51
  • And then also installing `linux-image-extra-3.19.0-33-generic` to get aufs back. – Mitar Nov 29 '15 at 00:10
  • @Rico, I know that its 5 years too late, but i am using ubuntu 18.04 and i got this error. I recently switched from one virtualserver to another. Im very desperated about this error, maybe you can have a look at my docker forum post: https://forums.docker.com/t/docker-wont-start-because-of-a-daemon/99942 – y.y Oct 23 '20 at 11:14
  • All these changes are unneccessary. On Ubuntu 14.04 it's enough to run `sudo apt-get install cgroup-lite`, no need to reboot etc. – pts Dec 02 '20 at 13:28
4

I've had this issue with debian.

The package cgroupfs-mount solved that.

sudo aptitude install cgroupfs-mount
eloyesp
  • 3,135
  • 1
  • 32
  • 47
  • 1
    This doesn't work on Ubuntu 14.04 (as asked by the OP), the package *cgroupfs-mount* doesn't exist. – pts Dec 02 '20 at 13:29
  • This simple line just made it work for me, on an old MX Linux with a 4.19 kernel. Thanks a lot! – Zwyx Aug 05 '23 at 09:26
4

maybe need packages:

apt-get install aufs-tools
apt-get install cgroup-lite
virya
  • 41
  • 1
3

I just had to remove any mounts of cgroup from /etc/fstab and I solved the problem for Devices cgroup isn't mounted. I think that Module br_netfilter not found is just a warning and does not prevent Docker from starting. But you can fix it by installing:

apt-get install linux-image-3.19.0-33-generic linux-image-extra-3.19.0-33-generic

After that you have to reboot.

The "extra" is needed because aufs is not anymore included with basic image in Ubuntu.

pts
  • 80,836
  • 20
  • 110
  • 183
Mitar
  • 6,756
  • 5
  • 54
  • 86
3

I just had this problem on Fedora 31. The solution as described here is to append systemd.unified_cgroup_hierarchy=0 to the GRUB_CMDLINE_LINUX var in /etc/sysconfig/grub.

(In my case, GRUB_CMDLINE_LINUX="resume=/dev/mapper/fedora-swap rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb quiet systemd.unified_cgroup_hierarchy=0")

Then run grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg and restart.

bisgardo
  • 4,130
  • 4
  • 29
  • 38
3

Check if the cgroups are already mounted by running the following command:

$ cat /proc/self/cgroup | grep devices

If you see output that looks like this:

1:name=systemd:/user/docker/12345.devices

Then the cgroups are already mounted, and you may have a different issue causing the error.

If you don't see any output when running the above command, then you'll need to mount the cgroups manually. To do this, run the following commands:

$ sudo mkdir /sys/fs/cgroup/devices
$ sudo mount -t cgroup -o devices devices /sys/fs/cgroup/devices

After mounting the cgroups, restart the Docker service with the following command:

$ sudo systemctl restart docker
Andromeda
  • 1,205
  • 1
  • 14
  • 21
0

In my case, I didn't have to install or config anything new. Docker was running fine before this failure. Try restarting docker (eg. systemctl restart docker). If it fails, shutdown and cold-boot the machine. Ensure docker is running. After 129 days of uptime, my docker just got in a weird, bad state.

Donn Lee
  • 2,962
  • 1
  • 24
  • 16