Window’s Subsystem for Linux doesn’t load Systemd by default, here’s how to turn it on.

I had read an article about running Ollama on a Raspberry Pi 5, and first wanted to try it on a WSL version of Debian (my distro of choice). The installation went fine, but I couldn’t get the damned thing to run. A quick Google search showed that installing Ollama also installs a Systemd service file, but when you run sudo systemctl start ollama you get:

output: System has not been booted with systemd as init system (PID 1). Can't operate.

Which is annoying because so many applications rely on Systemd to start them running in the background when the system boots up. Another quick Google search shows how to enable it in WSL, although I’m at a loss for why it isn’t enabled by default. So here’s how you enable Systemd:

First update your installation of WSL:
wsl --update
Your version of WSL must be 0.67.6 or newer, so check it:
wsl --version
You also must also be using WSL 2, so type:
wsl --set-default-version 2
wsl --set-version <DISTRO> 2

if everything went ok, then typing wsl --list --verbose would give you something similar to this:

  NAME      STATE           VERSION
* Debian    Stopped         2

Now load up the distro you want to enable Systemd, and type sudo nano /etc/wsl.conf and enter the following:

[boot]
systemd=true

Now save your work (Ctrl + X, select Y to save your change), and then exit your distro.
Type wsl.exe --shutdown to restart WSL and all your distros. The next time you login to linux, type systemctl list-unit-files — type=service to get a list of Systemd sevice files and their current state. Congrats! Systemd is working on your WSL distro.

Please note!
Apparently on Windows 10, you will need to have Windows Update KB5020030 or higher, for this to work. You can use windows update to install it or manually install it from here.

By Lynx

Born in the 70's. Grew up in Western NY. Happily married, and has 2 children. Lives in Connecticut.

3 thoughts on “Enable Systemd in WSL”
  1. I have been rolling with this community for months now and the energy is consistently top notch. From the welcome bonuses to the weekly tournaments, there is always something exciting waiting around the corner. The whole experience feels handcrafted and player focused. Cannot recommend it enough to anyone seeking a premium gaming environment. billoncasino

  2. I have been playing online for years and this club really knows how to keep its members happy. Transparent rules, decent limits, and a team that actually answers back makes all the difference. It is the kind of spot that respects its players from day one. Welcome aboard cf88club

  3. As someone who values loyalty, I really appreciate how they reward consistent players. The VIP perks are genuinely useful and the game performance never lags even during peak hours. Truly top tier. vnhi88vip

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.