ENG Version instructions for running the full Moonbeam node in Ubuntu 18.04 / 20.04 on WSL2 (Windows system component for running Linux applications inside Windows 10 and Windows Server 2019)
There are already many guides for installing the moonbeam node, but many windows users trying to set up the moonbeam node using wsl2 experience great difficulties, since not all commands are suitable and have their own specifics (for example, with docker). This instruction is perfect for those who might want to install a node on Windows 10 or Windows Server 2019.
Enabling the Windows Subsystem for Linux.
Before installing Linux distributions on Windows, the Windows Subsystem for Linux add-on must be enabled.
Start PowerShell as an administrator and run the following command.

dism.exe /online /enable-feature /featurename:Microsoft-Windows- Subsystem-Linux /all /norestart

To upgrade to WSL 2, wait until your computer restarts and proceed to the next step. If the system does not ask for a restart, restart windows manually.
Checking requirements for running WSL 2.
Windows 10 is required to upgrade to WSL 2.
For 64-bit systems: version 1903 or later with build 18362 or later.
For ARM64 systems: version 2004 or later with build 19041 or later.
Builds below 18362 do not support WSL 2. Use Windows Update Assistant to upgrade your Windows version
To check the version and build number, press Windows Key + R, type winver, and then click OK. (Or enter the ver command at the Windows command prompt). From the Options menu, update to the latest version of Windows.
If you have automatic update enabled, your version of Windows most likely already meets the necessary requirements.


Enabling the virtual machines component.
Before installing WSL 2, you must enable the optional Virtual Machine Platform component. To use this function on your computer, you need virtualization capabilities
Start PowerShell as an administrator and run the following command.
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Downloading the Linux kernel update package.
Download the latest package:
https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi



Choosing WSL 2 as the default version.
Open PowerShell and run the following command to set WSL 2 as the default version when installing a new Linux distribution:
wsl — set-default-version 2

Installing a Linux distribution of choice.
Open the Microsoft Store and select your preferred Linux distribution.
Below are links to Microsoft Store pages for each distribution:
- Ubuntu 16.04 LTS
- Ubuntu 18.04 LTS
- Ubuntu 20.04 LTS
- openSUSE Leap 15.1
- SUSE Linux Enterprise Server 12 SP5
- SUSE Linux Enterprise Server 15 SP1
- Kali Linux
- Debian GNU/Linux
- Fedora Remix for WSL
- Pengwin
- Pengwin Enterprise
- Alpine WSL
On the distribution page click "Get"





Click the "Run" button. A console window will open. There will be a slight delay on first launch. In the future, the launch will take no more than a second.
You will then need to create a user account and password for the new Linux distribution. Come up with an account name and a strong password.

At this stage, you have configured a Linux distribution that is fully integrated with the Windows operating system.
Install your distribution version to WSL 1 or WSL 2
You can check the WSL version assigned to each of your installed Linux distributions by opening a PowerShell command prompt and entering the command (available only on Windows build 18362 or higher): wsl -l -v.
wsl — list — verbose

To configure a distribution for one of the WSL versions, run:
wsl — set-version <distribution name> <versionNumber>
Remember to replace <distribution name> with the actual distribution name and <versionNumber> numbered "1" or "2". You can always revert to WSL version 1 by running this command and replacing "2" with "1".
If you want to make WSL 2 the default architecture, run the following command:
wsl — set-default-version 2
This will install a version of any new distribution installed in WSL 2.

Installing docker on Ubuntu 18.04 WSL 2
First, we update the existing package list:
sudo apt update

Then we install the necessary packages that allow apt to use packages over HTTPS:
sudo apt install apt-transport-https ca-certificates curl software-properties-common

Then we add the GPG key of the official Docker repository to our system:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Add the Docker repository to the list of APT package sources:
sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable”
Next, update the package database with the Docker package information from the newly added repository:
sudo apt update

Make sure we are installing Docker from the Docker repository and not the default Ubuntu repository:
apt-cache policy docker-ce

Next, install Docker:
sudo apt install docker-ce


Docker is now installed, the daemon is running, and the process will start when the system boots. Make sure the process is running:
sudo systemctl status docker

An error may occur here as in the screenshot. To fix it, run the command:
sudo service docker start
and check the Docker status:
sudo service docker status

Installing a node in Ubuntu 18.04 WSL 2
Further, the commands do not differ from the usual instructions for installing a node (docker is already running).
Port opening
sudo ufw allow 30333/tcpsudo ufw allow 30334/tcp
Creating a directory, setting access rights
mkdir /var/lib/alphanet-datachmod 777 /varchmod 777 /var/libchmod 777 /var/lib/alphanet-data
Running a node
docker run -p 30334:30334 -p 30333:30333 -v "/var/lib/alphanet-data:/data" \
purestake/moonbase-parachain-testnet:v0.5.1 \
/moonbase-alphanet/moonbase-alphanet \
--base-path=/data \
--chain alphanet \
--name="YOUR-NODE-NAME" \
--execution wasm \
--wasm-execution compiled \
--state-cache-size 4 \
-- \
--name="YOUR-NODE-NAME (Embedded Relay)"
After - name inside in two lines “ “ enter only the name of your node.

Pay attention to the following positions on the screen and copy (write) them:


When you continue to work with the node, you will see something like the following on the screen:

To access the node logs:
sudo docker logs container id -f --tail="100" - launches the node logs
View running containers:
sudo docker ps
Starting and stopping containers
Starting a stopped container:
sudo docker start container id
Stop:
sudo docker stop container id
Reboot:
sudo docker restart container id
Connecting to an existing container:
sudo docker attach container id
Installing Windows Terminal for the convenience of working with a node in Ubuntu 18.04 WSL 2
Open the Microsoft Store and select your preferred Linux distribution.




Through the terminal, you can connect to separate windows under different users, switch between several versions of Ubuntu if you have several, it is convenient to switch between tmux or screen sessions.
Thanks for attention. If you have any questions about configuring WSL2 and configuring the moonbeam node on Ubuntu in WSL2, you can contact the b_u_ggg # 3791 discord.