Windows 10 and WSL2

Find Tips and tricks on how to better use the Zeus IDE. Feel free to post your own tips but please do not post bug reports, feature requests or questions here.
Post Reply
jussij
Site Admin
Posts: 2461
Joined: Fri Aug 13, 2004 5:10 pm

Windows 10 and WSL2

Post by jussij » Sat Jun 20, 2020 2:33 am

With the Windows 10, version 2004 release it is now possible to install WSL2 using the Windows Update feature: https://devblogs.microsoft.com/commandl ... sion-2004/

With WSL2 installed it is then possible to access the Linux subsystem via the Windows command prompt:
wsl-cmd.png
wsl-cmd.png (36.42 KiB) Viewed 37 times
However, trying to run that same command from inside of Zeus results in this error:
zeus-err.png
zeus-err.png (113.21 KiB) Viewed 37 times
This happens because Zeus is a 32 bit application and the wsl.exe executable is only found in the PATH environment for 64 bit executables.

To access the Linux subsystem from inside Zeus you need to use the 32 bit version of the wsl.exe executable which is found here:

Code: Select all

C:\Windows\Sysnative\wsl.exe
To run the same command from within Zeus you need to use the 32 bit version of this command line as shown below:

Code: Select all

C:\Windows\Sysnative\wsl.exe cat /etc/os-release
Running that command line then results in the expected output:
zeus-cmd.png
zeus-cmd.png (162.47 KiB) Viewed 37 times
Using this approach you can easily setup Linux tools and compiler commands that can be run inside of Zeus.

Updating the PATH
If you open a command line prompt from inside Zeus and try to run these same commands you will once again run into this error:
wsl-z-err.png
wsl-z-err.png (9.85 KiB) Viewed 37 times
This is because Zeus will have started a 32 bit cmd.exe executable meaning we once again have the same mismatch as described earlier.

To fix all off these issue the best option is to just add the location to the PATH environment variable.

Code: Select all

C:\Windows\Sysnative\
This then allows these commands to be run without the need to for the [code[C:\Windows\Sysnative\[/code] folder details:
wsl-z-path.png
wsl-z-path.png (35.78 KiB) Viewed 37 times
Cheers Jussi

Post Reply
kuchnie warszawa opinie

Who is online

Users browsing this forum: No registered users and 1 guest