`wsl --exec <command>` doesnt work
Sakooooo opened this issue · comments
Bug description
when trying to run wsl --exec with nixos as my default distro it errors with
<3>WSL (16121) ERROR: CreateProcessEntryCommon:577: execvpe emacs failed 2
<3>WSL (16121) ERROR: CreateProcessEntryCommon:586: Create process not expected to return
To Reproduce
Steps to reproduce the behavior:
- Run
wsl --exec <command>
- returns <3>WSL (16121) ERROR: CreateProcessEntryCommon:577: execvpe emacs failed 2
Expected behavior
it should execute normally
Logs
~ wsl --exec emacs
<3>WSL (16121) ERROR: CreateProcessEntryCommon:577: execvpe emacs failed 2
<3>WSL (16121) ERROR: CreateProcessEntryCommon:586: Create process not expected to return
~
its supposed to be wsl <command>
not wsl --exec <command>
sorry :P
wsl --exec
actually launches the command without a login shell. Because all of the NixOS specific magic (currently, that's gonna change) happens in the login shell of the root user, only wsl <command>
works properly with NixOS right now
alright thanks :)