WSL: [nixos] WslRegisterDistributionFailed: 0x800707b - ProcMon - CreateFile NAME INVALID
- Your Windows build number: (Type
verat a Windows Command Prompt)
Microsoft Windows [Version 10.0.16299.431]
- What you’re doing and what’s happening: (Copy&paste specific commands and their output, or include screen shots)
Howdy folks I’m working on bringing https://nixos.org v18.03 up on WSL (https://github.com/NixOS/nixpkgs/issues/30391). You can reproduce this issue by cloning down http://github.com/ghuntley/nixos-wsl and uncompressing install.tar.7z.[0..] into the x64 directory.

- What’s wrong / what should be happening instead:
See twitter thread at https://twitter.com/tara_msft/status/996870558741508096 and below

If I understand this correctly the installation is failing because this image contains filenames or directories that cannot be expanded onto NTFS which is causing WslRegisterDistributionFailed to go boom. I’m not sure if you have used NixOS before but it’s a functional linux distribution which centers around the concept of /nix aka the nixstore.
When /etc/nixos/configuration.nix is updated/applied by root or nix-shell is invoked the output state (ie operating system or resulting application) is placed into the nixstore. This allows scenarios such as side-by-side installation of multiple versions of python with different FFI dependancies and instant rollback to previous known operating state (think of it like “boot to last known good configuration” in windows). NixOS has a garbage collector which cleans up state within the nixstore as need be.
Thus the filenames or directories you see here are valid and a requirement for nixos.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 11
- Comments: 15 (2 by maintainers)
Just chiming in to clarify that on NixOS, the
PATHenvironment variable is everything. You run programs with the correctPATHset and they will find only the correct version of the program they want.To prevent too long
PATH, normally you use a profile directory that is simply all desired packages symlinked together. In fact, the entire OS is like that, and upgrading the OS is simply changing the symlink to the profile.It is pretty common that a program in nix is installed multiple times, although I’m not too sure about bash.
It might be interesing to do a garbage collection and see if the second bash goes away.
You might be looking fot the nix pill on store paths
I presume the expansion is happening on the Windows side, in which case the question mark in the filename being an invalid NTFS path character is the problem (quick summary here). I guess it will be difficult to get NTFS behaviour changed.
Curious about how WSL translates these characters to be stored on the underlying NTFS, on the Linux side I ran this script…
resulting in…
Then on the Windows side…
resulting in…
So perhaps it would work if you repackage the “install.tar…s” with question marks mapped to #003F, and when the Linux side boots it sees a proper question-mark character.
Proof of concept…
On Windows side…
Then on Linux side… (actually the file didn’t show in the directory until I closed all bash windows and opened a new one, but after that…)
results in