nix-community / NixOS-WSL

NixOS on WSL(2) [maintainer=@nzbr]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`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:

  1. Run wsl --exec <command>
  2. 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 :)