Installing the Rocky Linux System on Windows 10

Windows 10's WSL, or Windows Subsystem for Linux, can run the GNU/Linux environment, including most command line tools, utilities, and applications without the overhead of a traditional virtual machine or dual-boot setup.
Windows 10 versions greater than or equal to 1709 can install and use WSL.
This article will introduce how to enable WSL on Windows 10 and install Rocky Linux 8 system.

Turn on WSL on Windows 10

Run Powershell as an administrator and enter the following command. Wait a moment and you will be prompted whether to restart the computer immediately. Enter Y and press Enter to restart the system.

$ Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Install Rocky Linux system

Normally, you can install some Linux distributions through the Microsoft Store, such as Ubuntu, Debian, OpenSUSE, etc., but there is no Rocky Linux system.
At this point you need to download a Rocky Linux image that can be used for WSL.

Github address of Rocky Linux image:https://github.com/mishamosher/RL-WSL
Address for Rocky Linux 8:Rocky Linux 8.4

Here we take downloading Rocky Linux 8.4 as an example.
Download the RL8.zip file. Unzip it to any directory that does not contain Chinese characters, such as D:\Rocky8, enter its directory, right-click the Rocky8.exe file, and run it as an administrator.

Wait a moment for the installation to be completed. As shown below, you can press any key to exit the installation.

Start Rocky Linux 8.4.
Go back to the decompressed directory D:\Rocky8, and you will see 2 more directories, as shown below.

Right-click again and run Rocky8.exe as administrator, that is, you have successfully logged in to the system as the root user, as shown below:

Perform system update, as shown below:

Note: If you find that you cannot update the system, it is most likely that the DNS has not been set up and the domain name cannot be resolved.
Execute the following command to set the nameserver

$ cat > /etc/resolv.conf <<EOF
nameserver 8.8.8.8
nameserver 8.8.4.4
EOF

Uninstall Rocky Linux system

Run Powershell as an administrator and enter the following command (the execution path is subject to the actual installation path):

$ D:\Rocky8\Rocky8.exe clean

Other available commands

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button