0

I'm using Debian on WSL. Nix is already install.

I install docker with this command:

nix-env -iA nixpkgs.docker

I want to start the daemon :

systemctl start docker

Failed to connect to bus: No such file or directory

update

FYI $XDG_RUNTIME_DIR= /mnt/wslg/runtime-dir $UID=1000 $DBUS_SESSION_BUS_ADDRESS has no value

ls -l /mnt/wslg/runtime-dir

drwx------ 4 pierre pierre 120 Dec 26 00:41 runtime-dir

I can access the bus. But I need to use sudo

sudo systemctl start docker

Now I have this problem

Failed to start docker.service: Unit docker.service not found.

I think docker.service is this file: /etc/systemd/system/docker.service

But it doesn't exist on my OS. I'Ve tried to uninstall and reinstall docker with nix. To no avails

I think that it is linked:

https://discourse.nixos.org/t/docker-packages-systemd-unit-files-dont-work-on-ubuntu/12160

sudo cp ~/.nix-profile/etc/systemd/system/docker.service /etc/systemd/system/docker.service

sudo cp ~/.nix-profile/etc/systemd/system/docker.sock /var/run/docker.sock

sudo systemctl enable docker


 Failed to start docker.service: Unit docker.socket not found.

Failed to start docker.service: Unit docker.socket not found.

After reading this link, I use this command in order to the know where I should replace docker.socket file. :

 systemctl list-sockets --all

But no docker.socket is listed

**update

I have made all the commands from scratch. Now I have this problem A dependency job for docker.service failed. See 'journalctl -xe' for details.

3 Answers 3

0

If I understood the problem correctly, you have to set your XDG_RUNTIME_DIR manually (because /run/user/... is sometimes owned by some other user?? (Not quite sure to be honest)):

So can you try to set XDG_RUNTIME_DIR = "/run/user/$UID" and then starting nix again?

If that doesn't work you maybe have to set DBUS_SESSION_BUS_ADDRESS as well to DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$UID/bus".

You can find a similar thread to yours here: https://superuser.com/questions/1561076/systemctl-user-failed-to-connect-to-bus-no-such-file-or-directory-debian-9

Did that help/fixed your problem?

0

You must look for directory, use cd .. and go to /bin/, there is your program, then start use ./docker or systemctl start docker.

0
sudo groupadd docker
sudo chgrp docker docker.sock
sudo systemctl start docker

No error message

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.