Vy Do
Vy Do

Reputation: 52488

Docker run inside Ubuntu on Windows WSL

enter image description here

enter image description here

My error

donhuvy@VYLAPTOP:~/temp2607/reaction-development-platform$ sudo apt-get update
Hit:1 https://download.docker.com/linux/ubuntu focal InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Fetched 114 kB in 4s (26.4 kB/s)
Reading package lists... Done
W: Target Packages (stable/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/docker.list:1
W: Target Packages (stable/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/docker.list:1
W: Target Translations (stable/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/docker.list:1
W: Target CNF (stable/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/docker.list:1
W: Target CNF (stable/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/docker.list:1
W: Target Packages (stable/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/docker.list:1
W: Target Packages (stable/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/docker.list:1
W: Target Translations (stable/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/docker.list:1
W: Target CNF (stable/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/docker.list:1
W: Target CNF (stable/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/docker.list:1
donhuvy@VYLAPTOP:~/temp2607/reaction-development-platform$ sudo apt-get install docker-ce docker-ce-cli containerd.io
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  docker-ce-rootless-extras docker-scan-plugin pigz slirp4netns
Suggested packages:
  aufs-tools cgroupfs-mount | cgroup-lite
The following NEW packages will be installed:
  containerd.io docker-ce docker-ce-cli docker-ce-rootless-extras docker-scan-plugin pigz slirp4netns
0 upgraded, 7 newly installed, 0 to remove and 45 not upgraded.
Need to get 104 MB of archives.
After this operation, 448 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://download.docker.com/linux/ubuntu focal/stable amd64 containerd.io amd64 1.4.8-1 [24.7 MB]
Get:2 http://archive.ubuntu.com/ubuntu focal/universe amd64 pigz amd64 2.4-1 [57.4 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal/universe amd64 slirp4netns amd64 0.4.3-1 [74.3 kB]
Get:4 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-ce-cli amd64 5:20.10.7~3-0~ubuntu-focal [41.4 MB]
Get:5 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-ce amd64 5:20.10.7~3-0~ubuntu-focal [24.8 MB]
Get:6 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-ce-rootless-extras amd64 5:20.10.7~3-0~ubuntu-focal [9063 kB]
Get:7 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-scan-plugin amd64 0.8.0~ubuntu-focal [3889 kB]
Fetched 104 MB in 17s (6216 kB/s)
Selecting previously unselected package pigz.
(Reading database ... 32256 files and directories currently installed.)
Preparing to unpack .../0-pigz_2.4-1_amd64.deb ...
Unpacking pigz (2.4-1) ...
Selecting previously unselected package containerd.io.
Preparing to unpack .../1-containerd.io_1.4.8-1_amd64.deb ...
Unpacking containerd.io (1.4.8-1) ...
Selecting previously unselected package docker-ce-cli.
Preparing to unpack .../2-docker-ce-cli_5%3a20.10.7~3-0~ubuntu-focal_amd64.deb ...
Unpacking docker-ce-cli (5:20.10.7~3-0~ubuntu-focal) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../3-docker-ce_5%3a20.10.7~3-0~ubuntu-focal_amd64.deb ...
Unpacking docker-ce (5:20.10.7~3-0~ubuntu-focal) ...
Selecting previously unselected package docker-ce-rootless-extras.
Preparing to unpack .../4-docker-ce-rootless-extras_5%3a20.10.7~3-0~ubuntu-focal_amd64.deb ...
Unpacking docker-ce-rootless-extras (5:20.10.7~3-0~ubuntu-focal) ...
Selecting previously unselected package docker-scan-plugin.
Preparing to unpack .../5-docker-scan-plugin_0.8.0~ubuntu-focal_amd64.deb ...
Unpacking docker-scan-plugin (0.8.0~ubuntu-focal) ...
Selecting previously unselected package slirp4netns.
Preparing to unpack .../6-slirp4netns_0.4.3-1_amd64.deb ...
Unpacking slirp4netns (0.4.3-1) ...
Setting up slirp4netns (0.4.3-1) ...
Setting up docker-scan-plugin (0.8.0~ubuntu-focal) ...
Setting up containerd.io (1.4.8-1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/containerd.service → /lib/systemd/system/containerd.service.
Setting up docker-ce-cli (5:20.10.7~3-0~ubuntu-focal) ...
Setting up pigz (2.4-1) ...
Setting up docker-ce-rootless-extras (5:20.10.7~3-0~ubuntu-focal) ...
Setting up docker-ce (5:20.10.7~3-0~ubuntu-focal) ...
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /lib/systemd/system/docker.service.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /lib/systemd/system/docker.socket.
invoke-rc.d: could not determine current runlevel
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.6) ...
donhuvy@VYLAPTOP:~/temp2607/reaction-development-platform$ sudo docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
donhuvy@VYLAPTOP:~/temp2607/reaction-development-platform$ docker run
"docker run" requires at least 1 argument.
See 'docker run --help'.

Usage:  docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

Run a command in a new container
donhuvy@VYLAPTOP:~/temp2607/reaction-development-platform$ docker --version
Docker version 20.10.7, build f0df350
donhuvy@VYLAPTOP:~/temp2607/reaction-development-platform$ docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
donhuvy@VYLAPTOP:~/temp2607/reaction-development-platform$ systemctl start docker
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
donhuvy@VYLAPTOP:~/temp2607/reaction-development-platform$ sudo dockerd
INFO[2021-07-26T09:26:04.598999900+07:00] Starting up
INFO[2021-07-26T09:26:05.751575600+07:00] libcontainerd: started new containerd process  pid=4266
INFO[2021-07-26T09:26:05.751933800+07:00] parsed scheme: "unix"                         module=grpc
INFO[2021-07-26T09:26:05.752582200+07:00] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2021-07-26T09:26:05.752789000+07:00] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}  module=grpc
INFO[2021-07-26T09:26:05.753058600+07:00] ClientConn switching balancer to "pick_first"  module=grpc
INFO[2021-07-26T09:26:05.784888200+07:00] starting containerd                           revision=7eba5930496d9bbe375fdf71603e610ad737d2b2 version=1.4.8
INFO[2021-07-26T09:26:05.807969400+07:00] loading plugin "io.containerd.content.v1.content"...  type=io.containerd.content.v1
INFO[2021-07-26T09:26:05.809913000+07:00] loading plugin "io.containerd.snapshotter.v1.aufs"...  type=io.containerd.snapshotter.v1
INFO[2021-07-26T09:26:06.359366500+07:00] skip loading plugin "io.containerd.snapshotter.v1.aufs"...  error="aufs is not supported (modprobe aufs failed: exit status 1 \"modprobe: FATAL: Module aufs not found in directory /lib/modules/4.4.0-19041-Microsoft\\n\"): skip plugin" type=io.containerd.snapshotter.v1
INFO[2021-07-26T09:26:06.360318200+07:00] loading plugin "io.containerd.snapshotter.v1.btrfs"...  type=io.containerd.snapshotter.v1
INFO[2021-07-26T09:26:06.361771600+07:00] skip loading plugin "io.containerd.snapshotter.v1.btrfs"...  error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs (wslfs) must be a btrfs filesystem to be used with the btrfs snapshotter: skip plugin" type=io.containerd.snapshotter.v1
INFO[2021-07-26T09:26:06.362037500+07:00] loading plugin "io.containerd.snapshotter.v1.devmapper"...  type=io.containerd.snapshotter.v1
WARN[2021-07-26T09:26:06.362243500+07:00] failed to load plugin io.containerd.snapshotter.v1.devmapper  error="devmapper not configured"
INFO[2021-07-26T09:26:06.362974300+07:00] loading plugin "io.containerd.snapshotter.v1.native"...  type=io.containerd.snapshotter.v1
INFO[2021-07-26T09:26:06.365365000+07:00] loading plugin "io.containerd.snapshotter.v1.overlayfs"...  type=io.containerd.snapshotter.v1
INFO[2021-07-26T09:26:06.368026100+07:00] loading plugin "io.containerd.snapshotter.v1.zfs"...  type=io.containerd.snapshotter.v1
INFO[2021-07-26T09:26:06.368363300+07:00] skip loading plugin "io.containerd.snapshotter.v1.zfs"...  error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with the zfs snapshotter: skip plugin" type=io.containerd.snapshotter.v1
INFO[2021-07-26T09:26:06.369411200+07:00] loading plugin "io.containerd.metadata.v1.bolt"...  type=io.containerd.metadata.v1
WARN[2021-07-26T09:26:06.377457800+07:00] could not use snapshotter devmapper in metadata plugin  error="devmapper not configured"
INFO[2021-07-26T09:26:06.378196300+07:00] metadata content store policy set             policy=shared
INFO[2021-07-26T09:26:06.384144600+07:00] loading plugin "io.containerd.differ.v1.walking"...  type=io.containerd.differ.v1
INFO[2021-07-26T09:26:06.384857900+07:00] loading plugin "io.containerd.gc.v1.scheduler"...  type=io.containerd.gc.v1
INFO[2021-07-26T09:26:06.386379300+07:00] loading plugin "io.containerd.service.v1.introspection-service"...  type=io.containerd.service.v1
INFO[2021-07-26T09:26:06.393867000+07:00] loading plugin "io.containerd.service.v1.containers-service"...  type=io.containerd.service.v1
INFO[2021-07-26T09:26:06.394944900+07:00] loading plugin "io.containerd.service.v1.content-service"...  type=io.containerd.service.v1
INFO[2021-07-26T09:26:06.395951300+07:00] loading plugin "io.containerd.service.v1.diff-service"...  type=io.containerd.service.v1
INFO[2021-07-26T09:26:06.397012700+07:00] loading plugin "io.containerd.service.v1.images-service"...  type=io.containerd.service.v1
INFO[2021-07-26T09:26:06.397965800+07:00] loading plugin "io.containerd.service.v1.leases-service"...  type=io.containerd.service.v1
INFO[2021-07-26T09:26:06.398988200+07:00] loading plugin "io.containerd.service.v1.namespaces-service"...  type=io.containerd.service.v1
INFO[2021-07-26T09:26:06.400056700+07:00] loading plugin "io.containerd.service.v1.snapshots-service"...  type=io.containerd.service.v1
INFO[2021-07-26T09:26:06.401187500+07:00] loading plugin "io.containerd.runtime.v1.linux"...  type=io.containerd.runtime.v1
INFO[2021-07-26T09:26:06.408917100+07:00] loading plugin "io.containerd.runtime.v2.task"...  type=io.containerd.runtime.v2
INFO[2021-07-26T09:26:06.411047900+07:00] loading plugin "io.containerd.monitor.v1.cgroups"...  type=io.containerd.monitor.v1
INFO[2021-07-26T09:26:06.412279400+07:00] loading plugin "io.containerd.service.v1.tasks-service"...  type=io.containerd.service.v1
INFO[2021-07-26T09:26:06.412639500+07:00] loading plugin "io.containerd.internal.v1.restart"...  type=io.containerd.internal.v1
INFO[2021-07-26T09:26:06.413666800+07:00] loading plugin "io.containerd.grpc.v1.containers"...  type=io.containerd.grpc.v1
INFO[2021-07-26T09:26:06.414645100+07:00] loading plugin "io.containerd.grpc.v1.content"...  type=io.containerd.grpc.v1
INFO[2021-07-26T09:26:06.415881400+07:00] loading plugin "io.containerd.grpc.v1.diff"...  type=io.containerd.grpc.v1
INFO[2021-07-26T09:26:06.417013800+07:00] loading plugin "io.containerd.grpc.v1.events"...  type=io.containerd.grpc.v1
INFO[2021-07-26T09:26:06.423490700+07:00] loading plugin "io.containerd.grpc.v1.healthcheck"...  type=io.containerd.grpc.v1
INFO[2021-07-26T09:26:06.424583600+07:00] loading plugin "io.containerd.grpc.v1.images"...  type=io.containerd.grpc.v1
INFO[2021-07-26T09:26:06.425780700+07:00] loading plugin "io.containerd.grpc.v1.leases"...  type=io.containerd.grpc.v1
INFO[2021-07-26T09:26:06.426810700+07:00] loading plugin "io.containerd.grpc.v1.namespaces"...  type=io.containerd.grpc.v1
INFO[2021-07-26T09:26:06.427972000+07:00] loading plugin "io.containerd.internal.v1.opt"...  type=io.containerd.internal.v1
INFO[2021-07-26T09:26:06.430384700+07:00] loading plugin "io.containerd.grpc.v1.snapshots"...  type=io.containerd.grpc.v1
INFO[2021-07-26T09:26:06.430569100+07:00] loading plugin "io.containerd.grpc.v1.tasks"...  type=io.containerd.grpc.v1
INFO[2021-07-26T09:26:06.431579800+07:00] loading plugin "io.containerd.grpc.v1.version"...  type=io.containerd.grpc.v1
INFO[2021-07-26T09:26:06.433089700+07:00] loading plugin "io.containerd.grpc.v1.introspection"...  type=io.containerd.grpc.v1
INFO[2021-07-26T09:26:06.440447100+07:00] serving...                                    address=/var/run/docker/containerd/containerd-debug.sock
INFO[2021-07-26T09:26:06.441881300+07:00] serving...                                    address=/var/run/docker/containerd/containerd.sock.ttrpc
INFO[2021-07-26T09:26:06.443648400+07:00] serving...                                    address=/var/run/docker/containerd/containerd.sock
INFO[2021-07-26T09:26:06.444409700+07:00] containerd successfully booted in 0.663149s
INFO[2021-07-26T09:26:06.458975000+07:00] parsed scheme: "unix"                         module=grpc
INFO[2021-07-26T09:26:06.459340200+07:00] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2021-07-26T09:26:06.459937000+07:00] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}  module=grpc
INFO[2021-07-26T09:26:06.461038500+07:00] ClientConn switching balancer to "pick_first"  module=grpc
INFO[2021-07-26T09:26:06.464507500+07:00] parsed scheme: "unix"                         module=grpc
INFO[2021-07-26T09:26:06.465303100+07:00] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2021-07-26T09:26:06.465948100+07:00] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}  module=grpc
INFO[2021-07-26T09:26:06.469570200+07:00] ClientConn switching balancer to "pick_first"  module=grpc
WARN[2021-07-26T09:26:06.508606600+07:00] Your kernel does not support cgroup memory limit
WARN[2021-07-26T09:26:06.509102200+07:00] Unable to find cpu cgroup in mounts
WARN[2021-07-26T09:26:06.509641700+07:00] Unable to find blkio cgroup in mounts
WARN[2021-07-26T09:26:06.511422700+07:00] Unable to find cpuset cgroup in mounts
WARN[2021-07-26T09:26:06.512210200+07:00] Unable to find pids cgroup in mounts
INFO[2021-07-26T09:26:06.513102200+07:00] Loading containers: start.
WARN[2021-07-26T09:26:06.525628500+07:00] Running iptables --wait -t nat -L -n failed with message: `iptables v1.8.4 (legacy): can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.`, error: exit status 3
INFO[2021-07-26T09:26:06.633151400+07:00] stopping event stream following graceful shutdown  error="<nil>" module=libcontainerd namespace=moby
INFO[2021-07-26T09:26:06.634747000+07:00] stopping healthcheck following graceful shutdown  module=libcontainerdINFO[2021-07-26T09:26:06.634766100+07:00] stopping event stream following graceful shutdown  error="context canceled" module=libcontainerd namespace=plugins.moby
WARN[2021-07-26T09:26:07.650886300+07:00] grpc: addrConn.createTransport failed to connect to {unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}. Err :connection error: desc = "transport: Error while dialing dial unix:///var/run/docker/containerd/containerd.sock: timeout". Reconnecting...  module=grpc
failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N DOCKER: iptables v1.8.4 (legacy): can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
 (exit status 3)
donhuvy@VYLAPTOP:~/temp2607/reaction-development-platform$ systemctl start docker
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
donhuvy@VYLAPTOP:~/temp2607/reaction-development-platform$ docker run hello-world
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.
donhuvy@VYLAPTOP:~/temp2607/reaction-development-platform$ sudo rm -rf /etc/systemd/system/docker.service.d
donhuvy@VYLAPTOP:~/temp2607/reaction-development-platform$ sudo systemctl deamon-reload
Unknown operation deamon-reload.
donhuvy@VYLAPTOP:~/temp2607/reaction-development-platform$ systemctl status docker.service
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
donhuvy@VYLAPTOP:~/temp2607/reaction-development-platform$ sudo su
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform# systemctl start docker
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down                                                                   [ OK ]
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform#
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform#
Executing: /lib/systemd/systemd-sysv-install enable docker
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform# systemctl restart docker
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform# systemctl restart docker
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform# systemctl restart docker
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform# /etc/init.d/dbus start
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform#
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform#
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform#
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform# docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform# service docker stop
 * Docker already stopped - file /var/run/docker-ssd.pid not found.
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform# cd /var/run/docker/libcontainerd
bash: cd: /var/run/docker/libcontainerd: No such file or directory
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform# service docker start
 * Starting Docker: docker                                                                                             [ OK ]
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform#
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform#
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform#
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform#
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform#
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform#
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform# docker --version
Docker version 20.10.7, build f0df350
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform# docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform# docker run -v /var/run/docker.sock:/var/run/docker.sock
"docker run" requires at least 1 argument.
See 'docker run --help'.

Usage:  docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

Run a command in a new container
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform# make
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Removed docker development symlink for reaction-hydra
Running pre-build hook script for reaction-hydra.
reaction-hydra post-project-start script invoked.
/bin/sh: 1: docker-compose: not found
make: *** [Makefile:264: build-reaction-hydra] Error 127
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform#

and

root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform# sudo systemctl is-active docker
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
root@VYLAPTOP:/home/donhuvy/temp2607/reaction-development-platform#

How to fix it?

Upvotes: 2

Views: 7944

Answers (3)

dylanvanw
dylanvanw

Reputation: 3341

I looked for a solution for this problem and found exactly what you were looking for I think. My goal was to be able to use docker from my WSL distro of choice (Ubuntu).

  1. Make sure you have WSL2 (How to check it)
  2. Download Docker Desktop (I know you don't want to use this but stay with me)
  3. Open docker desktop, go to settings, to Resources, to WSL integration. Here activate the integration with your distro of choice.
  4. Do not forget to hit Apply & Restart
  5. Now open your WSL and type docker run hello-world to test if docker works enter image description here

Upvotes: 2

Voronin
Voronin

Reputation: 187

I haven't entirely managed to get rid of the same error (I use Windows 10, WSL2 and Ubuntu 20.04 and I sure as hell do not want to use the crappy shareware called Docker Desktop, that annoys the hell of me with all its upgrade and "Pro" crap).

However: following this guide https://dev.to/bowmanjd/install-docker-on-windows-wsl-without-docker-desktop-34m9 seems to help.

I got rid of the "iptables"-related error messages by adding "iptables": false in the /etc/docker/daemon.json configuration. I have not mnaged to start dockerd just now though (apparently "error creating default "bridge" network: permission denied" is haunting me somewhat).

Give it a whirl if you like.

Edit: the reason for the error message was, that my WSL Ubuntu 20.04LTS container was - despite what I thought - not a WSL2 container, but WSL instead.

Make sure to set the version of the container to v2 and make sure to use that container, possibly setting both settings as defaults (v2 and container). See https://stackoverflow.com/a/65005633/15610035 for details on how to do it.

After changing the version of the container to v2 the error message went away.

However: I currently have trouble getting dockerd to expose the ports in a way, that the Windows localhost can access, because the WSL localhost is not the same as the Windows localhost. The reason is, that network is handled differently with WSLv2 - in comparison to WSLv1.

Additional useful articles: https://superuser.com/questions/1131874/how-to-access-localhost-of-linux-subsystem-from-windows and https://github.com/microsoft/WSL/issues/4150 .

Upvotes: 0

0xLogN
0xLogN

Reputation: 3805

WSL doesn't have an init. You need to use native Windows docker which uses a special WSL for it.

Upvotes: 2

Related Questions