Cyrus
Cyrus

Reputation: 681

Docker is running. Docker Desktop says "Docker Desktop stopped..."

I've installed Docker and Docker Desktop on my Ubuntu 20.04 VM using this guide:

https://linuxiac.com/how-to-install-docker-desktop-on-ubuntu/

Everything is running, but my Docker Desktop app can't seem to connect to Docker itself.

service docker status returns:

● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-05-13 14:49:12 PDT; 4 days ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 1086 (dockerd)
      Tasks: 18
     Memory: 73.0M
     CGroup: /system.slice/docker.service
             └─1086 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Warning: some journal files were not opened due to insufficient permissions.

However, this is what I get when I try to configure things in Docker Desktop. When I click on settings, I get a perpetual loading spinner.

docker desktop error

What I've tried

  1. I've restarted docker with sudo service docker stop / start

  2. I've clicked restart with the Docker Desktop dropdown menu on the top right of my Ubuntu Desktop.

  3. I've added my user to the docker group.

What steps can I take to debug this? Is there anything obvious I'm missing?

Thanks!

Upvotes: 16

Views: 52777

Answers (5)

anayarojo
anayarojo

Reputation: 1205

In my case, I was getting the error "Docker Desktop stopped".

Then tried re-installed many times, but now getting the error "running VM: running VM and dependencies: running VM: running qemu: qemu: waiting for qemu process: exit status 1",

Finally, I noticed the virtualization was disabled in my BIOS, the option was called "SMV mode", but it might be different on your machine.

Now, Docker is working again.

Credits: https://stackoverflow.com/a/76655270/3779757

Upvotes: 0

ditiro
ditiro

Reputation: 41

This worked for me:

Open %AppData%\Docker\settings.json and set

  • useWindowsContainers: true
  • wslEngineEnabled: true

Upvotes: 1

Kevin Cando
Kevin Cando

Reputation: 320

I had the same problem over Ubuntu 22.04 VM with Windows 11 as main host and Docker Desktop 4.9.0

If you are using Virtualbox you need to enable nested virtualization support which is available on Windows on versions > 6.0. Also it's important to mention that you need to have disable the Hyper-V, Virtual Machine Platform and the Windows Hypervisor Platform otherwise it won't work.

In order to enable the Nested VT-X/AMD-V in VirtualBox and Windows you need to step by step guide on:

  1. You need to open Windows Command line terminal by typing CMD on the bottom Search area. Once it shows up, right click on it and select Run as Administrator. This will open the command line terminal in the administrator mode.

  2. Now, you need to go to VirtualBox folder using cd "Program Files\Oracle\VirtualBox" command. This folder contains all the VirtualBox executables components along with other important files in which we need to use VBoxManage.

  3. To enable the Nested VT-x/AMD-v in VirtualBox, you need to run VBoxManage modifyvm <vm_name> --nested-hw-virt on syntax. EX. I am enabling it for my VM called 'Ubuntu 22.04' so I will use VBoxManage modifyvm "Ubuntu 22.04" --nested-hw-virt on command.

You should test that KVM can be used so you can run the command kvm-ok on Ubuntu shell kvmok

In order to install KVM, you need to do the following:

  1. Install KVM on Ubuntu 22.04

Next, run the command below to install KVM and additional virtualization packages on Ubuntu 22.04.

$ sudo apt install -y qemu-kvm virt-manager libvirt-daemon-system virtinst libvirt-clients bridge-utils

Let us break down the packages that we are installing:

  • qemu-kvm: An opensource emulator and virtualization package that provides hardware emulation.
  • virt-manager: A Qt-based graphical interface for managing virtual machines via the libvirt daemon.
  • libvirt-daemon-system: A package that provides configuration files required to run the libvirt daemon.
  • virtinst: A set of command-line utilities for provisioning and modifying virtual machines.
  • libvirt-clients: A set of client-side libraries and APIs for managing and controlling virtual machines & hypervisors from the command line.
  • bridge-utils: A set of tools for creating and managing bridge devices.
  1. Authorize Users

Only members of kvm user groups can run virtual machines. Add a user to the kvm group by typing:

$ sudo adduser ‘<username>’ kvm

Then you need to stop and disable docker

$ sudo service docker stop
$ sudo systemctl disable docker.service
$ sudo systemctl disable docker.socket

Afterwards, you reboot and Docker Desktop is going to be setup

Upvotes: 11

Mate
Mate

Reputation: 5274

I had the same problem on Debian 11 and Docker Desktop 4.8.1

  1. If you are using Linux inside a VM, verify virtualization support. Docker Desktop runs a VM that requires KVM support.

https://docs.docker.com/desktop/linux/install/#kvm-virtualization-support

  1. If you're using VMWare, you need to enable CPU counters.

https://github.com/canonical/multipass/issues/1085

  1. Verify qty with

    egrep -c '(svm|vmx)' /proc/cpuinfo

  2. You need to stop and disable Docker.

    $ sudo service docker stop
    $ sudo systemctl disable docker.service
    $ sudo systemctl disable docker.socket
    

    Then, restart your linux and your Docker desktop.

    Even more, if you run docker ps as root user , you don't use docker desktop. You have another list of containers.

  3. Be careful if you change "Setting-> Resources-> Advanced: Disk Image location" , you must not delete the default file 1.8G => home/YOUR_USER/.docker/desktop/vms/0/data/Docker.raw

    You can change the path, but you need to keep that file in that location.

enter image description here

Reset factory enter image description here

Docker desktop restart

enter image description here

Docker service status after reboot my computer

enter image description here

Full history:

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo usermod -aG docker YOUR_USER
sudo apt install gnome-terminal
sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virtinst libvirt-daemon virt-manager -y
sudo usermod -aG kvm YOUR_USER
sudo apt autoremove
sudo apt install ./docker-desktop-4.8.1-amd64.deb
sudo systemctl disable docker.service
sudo systemctl disable docker.socket

Test VirtualBox VM - Ubuntu 20.04

enter image description here

Upvotes: 13

RoGaTT
RoGaTT

Reputation: 61

Docker needs virtualization for work. So, you can turn it on in BIOS. That worked for me

Upvotes: 6

Related Questions