lucyllewy / one-script-wsl2-systemd

The one-script variant of the systemd hack for WSL2
MIT License
233 stars 39 forks source link

Error launching systemd #26

Closed HFR1994 closed 2 years ago

HFR1994 commented 2 years ago

I just did a fresh install of WSL2 with Ubuntu

wsl.exe install -d Ubuntu

I also installed Powershell 7 and run the following command

pwsh.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -File C:\Users\frhec\Desktop\install.ps1 -distro Ubuntu

No error during installation but as soon I launch the Ubuntu terminal I get

Waiting for systemd to finish booting
.....
Systemd is ready. Logging in.
x86 : The term 'x86' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:159
+ ... Text.Encoding]::GetEncoding(437); Write-Output $Env:ProgramFiles(x86)
+                                                                      ~~~
    + CategoryInfo          : ObjectNotFound: (x86:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

wslpath: /GnuPG/bin/gpg.exe
ln: failed to create symbolic link '/home/frhec/.wsl-cmds/gpg' -> '': No such file or directory

Any Ideas? Here are my specs

Device name DESKTOP-4IA2HB2
Processor   AMD Ryzen 9 5900X 12-Core Processor               4.30 GHz
Installed RAM   32.0 GB
------
Edition Windows 11 Pro
Version 21H2
Installed on    ‎10/‎25/‎2021
OS build    22000.556
Experience  Windows Feature Experience Pack 1000.22000.556.0
spectrapulse commented 2 years ago

Yeah, I have the exact same issue on my system.

Running on a fresh and updated installation of Windows 11.

crramirez commented 2 years ago

Hello,

Could you check the output of this command? wslvar 'ProgramFiles(x86)' maybe the WSL Utilities installation failed.

spectrapulse commented 2 years ago

The output of wslvar 'ProgramFiles(x86)' is the following:

x86 : The term 'x86' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:159
+ ... Text.Encoding]::GetEncoding(437); Write-Output $Env:ProgramFiles(x86)
+                                                                      ~~~
    + CategoryInfo          : ObjectNotFound: (x86:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
crramirez commented 2 years ago

And wslvar -v?

spectrapulse commented 2 years ago

wslu v3.2.2-1; wslvar v03

crramirez commented 2 years ago

The latest version is 3.2.4 maybe you can try upgrading it.

spectrapulse commented 2 years ago

Just decided to do another apt update && apt full-upgrade -y and it did resolve itself with an update.

It seems as a fresh WSL instance running ubuntu probably doesn't have up to date packages for the latest version of wslu to be installed with this script. It might be an idea to force an upgrade or add it to documentation that it is advised to make sure the packages in the WSL instance are up to date?

It should be common sense and its kind of foolish for me not to have thought of that earlier but still 😅

lucyllewy commented 2 years ago

Thanks for the report. I'll try to get the script updated shortly to force an apt full-upgrade as part of the installation.