rancher-sandbox / rancher-desktop-wsl-distro

Minimal WSL distro for Rancher Desktop
Apache License 2.0
16 stars 8 forks source link

[Question] How to use custom distro? #104

Open thetredev opened 3 months ago

thetredev commented 3 months ago

Hi,

say I built a distro from this repo myself, how would I tell Rancher Desktop to use it insead of the official release?

Thanks!

jandubois commented 3 months ago

When you run yarn to install the prerequisites of Rancher Desktop, it will download the wsl-distro tarball to some location under resources/win32/wsl-distro*. You should be able to replace the tarball at that time before running Rancher Desktop with yarn dev, or before packaging it.

Note that this is of course not supported ("you break it, you keep all the pieces" etc).

I'm curious though what kind of modifications you would want to make, and why.

Note that you can also run rdctl shell and then modify the distro as you need to. The changes will persist across restarts, but will of course be wiped out by a factory reset.

thetredev commented 3 months ago

Awesome, thanks! I just want to play around a bit and see if and how Rancher Desktop works with a systemd-based WSL distro.

jandubois commented 3 months ago

see if and how Rancher Desktop works with a systemd-based WSL distro.

This is not going to work; Rancher Desktop is currently pretty coupled to OpenRC. It uses custom /etc/init.d scripts and "manually" manages services with rc-service.

Feel free to look around, but be prepared to spend a couple of weeks modifying the Rancher Desktop backend itself before you can get this working.

mook-as commented 3 months ago

Things to watch out for if you're trying to do systemd:

thetredev commented 3 months ago

Thank you both. Very intersting! I'll take my time :D