DEV Community

Discussion on: Install Fedora 37 or earlier on Windows Subsystem for Linux (WSL)

Collapse
 
krrishdhaneja profile image
Krrish Dhaneja

Hey, @bowmanjd Thanks for your instructions, but as you know that wsl2 doesn't support systemd, how do I install SysVinit in Fedora, I found no docs on Google about this, Can you please help me!

Collapse
 
bowmanjd profile image
Jonathan Bowman

Good question. Are you sure you need systemd or sysvinit? What happens if you run sshd by itself? You may be pleasantly surprised.

Collapse
 
krrishdhaneja profile image
Krrish Dhaneja • Edited

I don't get it, that's kind of a puzzle i think; @bowmanjd

Thread Thread
 
bowmanjd profile image
Jonathan Bowman
sudo dnf install openssh-server
sudo ssh-keygen -A
sudo /usr/sbin/sshd
Enter fullscreen mode Exit fullscreen mode

What do you think? Are the results satisfactory?

Collapse
 
krrishdhaneja profile image
Krrish Dhaneja

I think You mean I can start sshd by itself, that's kind of interesting but what about rest of the services? I may need an init system for that? Ain't I?

Thread Thread
 
bowmanjd profile image
Jonathan Bowman

What other services do you need to run?

Thread Thread
 
krrishdhaneja profile image
Krrish Dhaneja

Till now only sshd, and will be seeing your docker tutorial to start docker, and rest the future will tell! Btw isn't there any way to install systemd on wsl by using original linux kernel instead of wsl2's custom kernel? And isn't there any SysVinit package in Fedora's repository of packages or I have to add a ppa just as in Ubuntu??

Thread Thread
 
bowmanjd profile image
Jonathan Bowman

I would recommend using Hyper-V or Virtualbox to run your own Linux VM, which will then have systemd or other init system. Yes, Fedora already has systemd, and you could find other distros if you prefer openrc or other init system. The issue isn't the installation of systemd, then (and, no, you wouldn't want to try to replace systemd with sysvinit on a systemd-based distro; instead, find a non-systemd distro). The issue is that WSL has its own init system that runs with PID 1. By the way, systemd has little to do with the kernel version installed.

The typical WSL hack I see is running genie. You may try that. But it adds another layer of complexity that is generally unneeded, if all you want is a way to launch long-running processes. Simply launch them. If you need other systemd features, other than services, then maybe you want to look into genie or a separate VM.

Does that make sense?

Thread Thread
 
krrishdhaneja profile image
Krrish Dhaneja

Thanks for suggestion and explanation, would be trying genie!!

Collapse
 
operation420_net profile image
operation420_net

Please see my reply to Krrish Dhaneja

Collapse
 
operation420_net profile image
operation420_net

Please see my reply to Krrish Dhaneja

Collapse
 
operation420_net profile image
operation420_net

Krrish Dhaneja, I replied to your other comment with the instructions!!!