Using Windows with WSL
How to use GalaChain with Windows Subsystem for Linux (WSL)
1. Install Docker Desktop
Download and install Docker Desktop from the official website: https://www.docker.com/products/docker-desktop
If you already have Docker Desktop installed, make sure to update it to the latest version.
2. Install WSL 2 and a Ubuntu-20.04 distribution
Follow the official guide to install WSL 2: https://docs.microsoft.com/en-us/windows/wsl/install
We reccomend using Ubuntu-20.04 as your distribution. You can install it running the following command on PowerShell:
Here is a short video from Microsoft about how to install WSL 2 and how to prepare it to build Node.js applications:
3. Enable WSL integration on Docker Desktop
Open Docker Desktop and go to Settings
> Resources
> WSL Integration
and enable the integration with your WSL distribution.
4. Mount Your Current Windows Directory in WSL (Optional)
If you want to access your Windows file system directly from WSL (e.g., to work with files in your Windows directories like C:\Users\YourUsername\Documents\
), you can set up WSL to automatically mount your Windows drives.
- Edit the WSL Configuration File:
Open your /etc/wsl.conf
file in a text editor. If it doesn’t exist, create it:
- Add the Following Configuration:
Add these lines to the file:
metadata
: Enables the storage of Linux file system metadata (such as permissions and symbolic links) on the mounted Windows drives.umask=22
: Sets the default permission of new directories to0755
and files to0644
.-
fmask=11
: Sets the default permission of new files to0666
, ensuring they are not executable by default. -
Restart WSL:
After saving the changes, restart your WSL environment:
Start WSL again, and your Windows drives should be mounted under /mnt/
, for example, /mnt/c
for the C:
drive.
- Access Your Windows Directories:
Now you can navigate to your Windows directories from within WSL, like this:
5. Install dependencies and start network
- Use the WSL extension on VSCode to connect to your WSL distribution.
- Install Node Version Manager (NVM) on your WSL distribution: https://learn.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-wsl#install-nvm-nodejs-and-npm
- Install
yq
andjq
on your WSL distribution: - At this point your WSL environment should be ready to use GalaChain. Follow the instructions on the Getting Started guide to install the CLI and initialize your project.