Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How to use custom distro? #104

Open
thetredev opened this issue Jun 20, 2024 · 5 comments
Open

[Question] How to use custom distro? #104

thetredev opened this issue Jun 20, 2024 · 5 comments

Comments

@thetredev
Copy link

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
Copy link
Member

jandubois commented Jun 20, 2024

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
Copy link
Author

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
Copy link
Member

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
Copy link
Contributor

mook-as commented Jun 22, 2024

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

  • You may or may not need systemd 255.7+ due to issues with cgroup namespaces in WSL.
  • We do the setup normally, but we run most services (dockerd/containerd, k3s, etc.) inside a network namespace; see https://github.com/rancher-sandbox/rancher-desktop/blob/main/pkg/rancher-desktop/assets/scripts/wsl-init-rd-networking for something to get started with. This is because dockerd/containerd/k3s tends to do fun things to iptables etc. and doesn't clean up properly, so restarting Rancher Desktop leads to issues. Look into JoinsNamespaceOf= in systemd.unit.
  • It might be good to make RD start a non-default .target for all the services once setup is complete.

@thetredev
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants