This repository is archived. Please migrate to the native systemd for WSL2 solution provided by Microsoft.
These are scripts to add proper systemd support on Ubuntu images of WSL2. Forked from the archived repo of DamionGans for better adaptation.
From the snapcraft forum. Thanks to Daniel on the Snapcraft forum!
I am not responsible for broken installations,
fights with your roommates and police ringing your door.
YOU are choosing to make these modifications, and if
you point the finger at me for messing up your device, I will laugh at you.
You need git
to be installed.
sudo apt install git
git clone https://github.com/saltyming/ubuntu-wsl2-systemd-script.git ~/ubuntu-wsl2-systemd-script
cd ~/ubuntu-wsl2-systemd-script
bash install.sh (--force) (--no-wslg)
# Enter your password and wait until the script has finished.
systemctl
If you don't get an error and can see a list of units, the scripts worked fine.
cd ~/ubuntu-wsl2-systemd-script
bash uninstall.sh
# Enter your password and wait until the script has finished.
Have fun using systemd on your Ubuntu WSL2 image. You may use, change and distribute these scripts by following LICENSE.md.