Make your wsl 2 Current Distro Run Systemd


By this installation, systemd is enabled in your WSL 2 distro.

Download and run the latest installer script.

curl -L -O "https://raw.githubusercontent.com/nullpo-head/wsl-distrod/main/install.sh"
chmod +x install.sh
sudo ./install.sh install
This script installs distrod, but doesn't enable it yet.

Enable distrod in your distro

You have two options. If you want to automatically start your distro on Windows startup, enable distrod by the following command

/opt/distrod/bin/distrod enable --start-on-windows-boot
Otherwise,

/opt/distrod/bin/distrod enable
You can run enable with --start-on-windows-boot again if you want to enable autostart later.

Restart your distro

Close your WSL's terminal. Open a new Command Prompt window, and run the following command.

wsl --terminate Distrod
After re-opening a new WSL window, your shell runs in a systemd session

Popular posts from this blog

Shrink you container size up to 95%.

alma linux: dnf Module yaml error: Unexpected key in data