Skip to content

Script to enable systemd support on current Ubuntu WSL2 images

Notifications You must be signed in to change notification settings

ningacoding/ubuntu-wsl2-systemd-script

 
 

Repository files navigation

ubuntu-wsl2-systemd-script

Script to enable systemd support on current Ubuntu WSL2 images from the Windows store. Tested on 18.04, 20.04 and the versionless (current) version of Ubuntu from the Windows Store. I am not responsible for broken installations, fights with your roommates and police ringing your door ;-).

Note: Right now I'm trying to get this script working well again. Please grant me some time and I'll do my best. You can make PR requests if you like to and I will try them out.

Instructions from the snapcraft forum turned into a script. Thanks to Daniel on the Snapcraft forum!

Usage

You need git to be installed for the commands below to work. Use

sudo apt install git

to do so.

Run the script and commands

git clone https://github.com/ningacoding/ubuntu-wsl2-systemd-script.git
cd ubuntu-wsl2-systemd-script/
bash ubuntu-wsl2-systemd-script.sh

Enter your password and wait until the script has finished

Then restart the Ubuntu shell and try running systemctl

systemctl

If you don't get an error and see a list of units, the script worked.

Have fun using systemd on your Ubuntu WSL2 image. You may use and change and distribute this script in whatever way you'd like.

About

Script to enable systemd support on current Ubuntu WSL2 images

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%