usernetes icon indicating copy to clipboard operation
usernetes copied to clipboard

[WSL2] Build my own image from source Dockerfile

Open dg424 opened this issue 5 months ago • 4 comments

Hi,

I cloned the repository and built the container using the included Dockerfile. It starts up, but gets stuck here:

         Starting undo-mount-hacks.service - Undo KIND mount hacks...
[  OK  ] Finished undo-mount-hacks.service - Undo KIND mount hacks.
         Starting containerd.service - containerd container runtime...
[  OK  ] Started containerd.service - containerd container runtime.
[  OK  ] Reached target multi-user.target - Multi-User System.
[  OK  ] Reached target graphical.target - Graphical Interface.
         Starting systemd-update-utmp-runlevel.service - Record Runlevel Change in UTMP...
[  OK  ] Finished systemd-update-utmp-runlevel.service - Record Runlevel Change in UTMP. <---- stuck here

Running within WSL2 - latest on Windows 11.

My goal is to run usernetes (or kind, minikube, k3s) under rootless Docker.

k3s within DinD complains about cgroup v2 delegation because it looks like it is looking at the filesystem for delegation configuration and this area of the filesystem is not "bubbled up" to rootless DinD and of course any containers run under it.

dg424 avatar Jul 28 '25 13:07 dg424

Hi @AkihiroSuda,

Any update or anything that I could try to make this work ? Most of the rootless k8s I've seen seems to be about running "outside" of Docker on the machine itself. I was able to get dind-rootless up and running in an Ubuntu 22.04 container on WSL2 Ubuntu 22.04. I can also try a bare metal Ubuntu 22.04 host as well if this could help, but it seems like no one has yet been able to run rootless k8s using rootless Docker.

dg424 avatar Aug 19 '25 19:08 dg424

it seems like no one has yet been able to run rootless k8s using rootless Docker.

I have been able, using Rootless Docker on Ubuntu 24.04. This configuration is tested on the CI too: https://github.com/rootless-containers/usernetes/blob/master/.github/workflows/main.yaml

I haven't tried it on WSL2 though

AkihiroSuda avatar Aug 20 '25 03:08 AkihiroSuda

it seems like no one has yet been able to run rootless k8s using rootless Docker.

I have been able, using Rootless Docker on Ubuntu 24.04. This configuration is tested on the CI too: https://github.com/rootless-containers/usernetes/blob/master/.github/workflows/main.yaml

I haven't tried it on WSL2 though

Was this via Rootless DinD ? This is my use case - Rootless DinD with k8s (any) using Rootless DinD as the Docker host.

dg424 avatar Aug 20 '25 13:08 dg424

Ok, I was able to get this working with rootless on host machine itself instead of rootless DinD. So, deploy rootless on the host machine as per instructions, run kind in a container, and it comes right up. Couldn't get k3s, minikube, nor usernetes to work from inside a container. My goal is to get a k8s distro using DinD rootless rather than host rootless.

dg424 avatar Aug 26 '25 15:08 dg424