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

Does not work inside of WSL2 #46

Open
mspaulding06 opened this issue Jun 18, 2021 · 3 comments
Open

Does not work inside of WSL2 #46

mspaulding06 opened this issue Jun 18, 2021 · 3 comments

Comments

@mspaulding06
Copy link

I am having trouble getting this program to work inside of WSL2. Of note is that I am running from the unstable channel. I have run the following commands.

mkdir -m 0755 ~/.nix
nix run --store ~/.nix nixpkgs.bash nixpkgs.coreutils
nix-user-chroot ~/.nix bash

And doing that shows the following error.

failed to execute bash: No such file or directory (os error 2)

So then I try the chroot command with sudo and get a new error.

thread 'main' panicked at 'failed to bind mount /home/nixos/.nix to /nix: EACCES: Permission denied', src/main.rs:159:31
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Trying again with the backtrace environment variable yields no interesting results. I'm really stuck here and not sure where to go from this point. Any help on the matter would be greatly appreciated.

@Mic92
Copy link
Member

Mic92 commented Jun 18, 2021

First of all, since you can use sudo, do you really need this tool?
Also you try to stack nix-user-chroot nix run --store inside the nix store. This might cause problems when using bash because is in the nix store that gets remounted and might be no longer accessible. Maybe it works with /bin/bash.

@mspaulding06
Copy link
Author

I'm simply trying to follow the installation instructions that I'm seeing in the README doc for the repository. It is somewhat confusing what I am supposed to do here to get nix-user-chroot to work. I don't understand why it's not able to find the bash command. I've tried passing absolute paths for it as well and that doesn't seem to do much different.

@Mic92
Copy link
Member

Mic92 commented Jun 26, 2021

It is not finding bash because it comes from a different nix store already as it seems and nix-user-chroot binds mount a new one.
You could work around by using /bin/bash.

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

2 participants