skiffos/SkiffOS

wsl: expose /run/WSL in the SkiffOS system

clayauld opened this issue · 15 comments

The wslu utility doesn't seem to work as expected. The wslpath binary doesn't get installed and the WSL InteropServer appears broken.

image

image

For the wslu package we just run "make install" and the makefile provided by wslu does the installing.

It looks like wslpath was renamed to wslupath:

image

@clayauld It needed /run/WSL mounted into the skiff system, see #226

Please run the following:

rm -rf ./workspaces/default/build/skiff-init-*
git fetch
git checkout fix-wslu
git submodule update
make configure compile

... to force re-building skiff-init-squashfs.

@clayauld you'll also need to delete these for the Go update:

rm -rf ./workspaces/default/build/host-go-1*
rm -rf ./workspaces/default/host/usr/lib/go

@clayauld #226 should have fixed it - feel free to comment here if not & ill reopen.

It appears that the fix doesn't properly mount /run/WSL -> /skiff-overlays/system/run/WSL as the log says...

image

Comparing this to another WSL distro...

image

Someone must mount over /run, I guess systemd. Will look into it

@clayauld Due to /etc/fstab containing a line mentioning /run systemd mounts a tmpfs to /run.

This must be hiding the bind mount made by skiff-init-squashfs.

@clayauld Let's try mounting the entire /run dir from the WSL environment and disable systemd run.mount

I did that on the fix-wslu branch: #227

As before we will need to rebuild skiff-init-squashfs:

rm -rf ./workspaces/default/build/skiff-init-*
git fetch
git checkout fix-wslu
git reset --hard origin/fix-wslu
git submodule update
make configure compile

Hmmm.... Still seems broken.

image

@clayauld are you sure you're on the latest fix-wslu branch commit and have recompiled skiff init as described above?

The logs don't mention /run but they should, there's a line in the config saying to mount /run itself and it should at least show up in those logs there.

Yep. You were right.
image

/run/WSL seems to be available now.

When I run the wslu commands I still get the error wslpath: command not found

image

I was looking at the source code for wslu and it still looks for the binary or script wslpath in the PATH. Based on another install of WSL I have running (Pengwin Linux), wslpath is a symlink to /init. I'm not sure if that is common across WSL distros, but I have found stale versions of re-implimentations of wslpath on Github. None of them seem to work as expected, however. I was thinking of just doing a manual install of one of those if they worked as expected, but no success so far.

I can do more digging later this weekend and test other WSL distros to see how they deal with this.

wslpath is a symlink to /init which means that /init as provided by microsoft implements wslpath if it is started with wslpath in $0

/init doesn't exist inside the skiffos chroot but I will try to find a way to get it in there.

nix-community/NixOS-WSL@df27a91#diff-8e10ab0ac1a96c07ffb329c5c4bc2bbb271e7f2914f1b0ac59742ab68d58c6f7R65

@clayauld please try fix-wslpath branch with #229

You will need to rebuild skiff-init-squahfs again as described above (just delete it from build/ before make compile)

What I did was mount the original / to /mnt/wsl and then symlink wslpath to /mnt/wsl/init

Okay That seems to have resolved the issues.

Great! Thanks for testing