Install and set up Windows subsystem for Linux (WSL)
Before starting, confirm that your Windows system on which you are installing WSL 2 meets all prerequisites, as outlined in the Microsoft documentation.
-
Download and install WSL 2.
-
See Microsoft's documentation for installing WSL 2 here.
The Ubuntu version to be installed is 22.04.
-
-
After the WSL 2 installation is complete, open you can access the Windows file system using the following:
/mnt/c
-
To open the Windows File Explorer from WSL 2, in the terminal, type the following:
cd/home
explorer.exe
-
The Windows path will have the following format:
C:\Users\itron\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu22.04onWindows_79rhkp1fndgsc\LocalState\rootfs
-
It is possible to download Visual Studio Code here, and link it to WSL 2.
After installing Visual Studio Code, you can access source code from WSL 2 by installing Visual Studio Code's WSL 2 plugin, available here.
You can also install the C/C++ Plugin, available here.
-
To open Code Directory in Visual Studio Code, type the following:
$ cd <source_code_dir>
$ code .
-
Alternatively, a folder can be added from the Studio IDE.