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

fix: compatibility with latest WSL update #199

Merged
merged 2 commits into from
Jan 19, 2023

Conversation

K900
Copy link
Contributor

@K900 K900 commented Jan 19, 2023

The latest WSL update makes /dev/shm a mount point, not a symlink, as it should be.
Unfortunately, this does not work well with us trying to remove it. Oops.

@K900
Copy link
Contributor Author

K900 commented Jan 19, 2023

A quick "my system is broken pls help" guide:

  1. Check out this PR
  2. nix build .#staticShim
  3. Copy result/bin/nixos-systemd-shim somewhere on the Windows file system
  4. From a Windows shell, run wsl --system --user=root
  5. mount -o remount,rw /mnt/wslg/distro
  6. rm /mnt/wslg/distro/sbin/init
  7. cp /mnt/.../nixos-systemd-shim /mnt/wslg/distro/sbin/init
  8. Exit WSL and run wsl --shutdown
  9. Restart NixOS on WSL
  10. Rebuild your config with changes from this PR - otherwise the activation script will replace the shim with the old broken one.

Useful for when your system is broken and you want to fix it quickly.
@nzbr
Copy link
Member

nzbr commented Jan 19, 2023

Code looks good so far. Will this work on the older WSL version as well?

@K900
Copy link
Contributor Author

K900 commented Jan 19, 2023

It should.

@SuperSandro2000
Copy link
Member

Tested on the current stable WSL release and thing still work after a wsl --shutdown

@K900 K900 merged commit 13f5b22 into nix-community:main Jan 19, 2023
@nzbr nzbr added the bug Something isn't working label Jul 28, 2023
@nzbr nzbr changed the title fix: fix compatibility with latest WSL update fix: compatibility with latest WSL update Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants