Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why systemd is disabled in WSL?

None of the systemd commands are working inside WSL( Ubuntu Bash 18.04). When I ran sudo systemctl is-active kubelet, error is output: System has not been booted with systemd as init system (PID 1). Can't operate. : running command: sudo systemctl is-active kubelet

How to enable systemd feature in WSL? Whats the way to get rid of System has not been booted with systemd

like image 241
Santosh Hegde Avatar asked Apr 08 '19 18:04

Santosh Hegde


People also ask

Why is there no systemd in WSL?

Both WSL1 and WSL2's primary conflict with Systemd is the PID1 clash - WSL's init on both versions runs as PID1, which is the main reason Systemd doesn't run on either.

Is WSL2 faster than WSL?

Initial versions of WSL 2 run up to 20x faster compared to WSL 1 when unpacking a zipped tarball, and around 2-5x faster when using git clone, npm install and cmake on various projects.


1 Answers

When using WSL2 you can use:

sudo service docker start 

This command basically execute the script /etc/init.d/docker.

Some customization, like specifying HTTP proxy, is possible via the script /etc/default/docker.

like image 95
imlearningdontjudgeme Avatar answered Sep 24 '22 03:09

imlearningdontjudgeme