Option 1: On Windows 11, add the necessary commands to the section in /etc/wsl.conf: Short answer to " what is a workaround here to automatically start docker when opening Ubuntu on WSL2? This answer is a bit outdated, but I'm leaving it here in case it's beneficial to anyone running on an older WSL release. Important note: Most users should read my updated answer first. , or if that does not exist, what is a workaround here to automatically start docker when opening Ubuntu on WSL2? What is the command that reaches sudo systemctl enable docker using sudo service docker. At the moment, I need to run sudo service docker start whenever I start WSL2. While sudo service docker start works like sudo systemctl start docker, there is no such command that uses "enable". I would expect it to be like: sudo service docker enableīut that "enable" is not available for "sysvinit" / "init". But I cannot find something like "systemd"'s sudo systemctl enable docker for "sysvinit". I can choose service docker start to run docker, which works. It should show systemd or sysv (or something like that) in the output. To know the process name associated with PID 1 (the first process that How to know which init system you are using? You may use this command Reason: Your Linux system is not using systemd Which brought me to Fixing "System has not been booted with systemd as init system" Error: Operate.Failed to connect to bus: Host is down" System has not been booted with systemd as init system (PID 1). Some steps before, I also got a different message at this point: lib/systemd/systemd-sysv-install enable dockerĪnd a test run shows, that docker is not yet running: docker run hello-worldĭocker: Cannot connect to the Docker daemon at Synchronizing state of rvice with SysV service script with With both commands avoiding "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Instead of just starting it again at every boot with sudo systemctl start docker Is the docker daemon running?’ on Ubuntu, I can automatically start the docker daemon at boot using sudo systemctl enable docker I am using Ubuntu on WSL2 (not on Docker Desktop).Īccording to How to fix docker ‘Cannot connect to the Docker daemon at unix:///var/run/docker.sock.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |