How to install elementary OS on WSL for Windows 10 and 11
The Windows Subsystem for Linux (WSL) is an incredibly powerful tool for both Windows 10 and Windows 11 with a raft of easily installable distros at hand in the Microsoft Store. But you’re not limited to only those available through the Store. With the right tools and know-how, you can get just about any distro working.
In some cases, such as Ubuntu, you can install the latest rolling release with an official image. In others, we turn to the WSL community for assistance, and that’s where we’re at with elementary OS.
Thanks to a project hosted on GitHub, installing elementary OS onto WSL is a simple process that takes a matter of minutes, followed by some pretty simple setup.
How to install elementary OS on WSL
Source: Windows Central
So, if you want to use it on WSL, you’ll be wanting to use a community project simply called ElementaryWSL. It’s hosted at GitHub, so the first port of call is to load up its repository. It’s also only built for WSL 2, so if you aren’t using that yet, check out our full guide to get ready.
Source: Windows Central
It’ll take a few seconds (or longer depending on your hardware) to run its installation, but the installer doesn’t require any interaction from you. It’ll open a terminal window, and when it’s complete you’ll be asked to press Enter. The terminal window will then close.
If you use Windows Terminal, Elementary will now show in the dropdown menu to launch the next time you load it up. If you don’t, you can launch it through PowerShell the same as any other Linux distro with this command:
wsl -d Elementary
By default you’ll only have root access, so you’ll need to do some basic setup before you get rolling.
How to set up elementary OS on WSL
Source: Windows Central
root@
. As with any other Linux distro on WSL, you’ll want to add a user with the right permissions before doing anything. You don’t have a password, either, so you’ll need to add one of those before beginning.
In the terminal enter:
passwd
Source: Windows Central
useradd -m <username>
Source: Windows Central
passwd <username>
Again, follow the prompts to add your password. These commands have added a root password, a user, and a user password.
The next step is to add the right permissions to your user to be able to use the sudo command, otherwise you’ll be met with an error. We can do this by entering:
usermod -aG sudo <yourusername>
Source: Windows Central
su <username>
The next thing to do is to ensure that when you launch elementary, you’re doing so as user and not root (which is advisable). There are two ways to do this, the first is with the wsl.conf file and the second is by configuring Windows Terminal if you use that.
You won’t have a wsl.conf file out of the box so we’ll need to create that and enter the right settings. As we’re going to be inside the /etc/ directory it’s easiest to be root for this one. In the terminal as root enter:
nano /etc/wsl.conf
Source: Windows Central
# Set the user when launching a distribution with WSL.
[user]
default=YourUserName
Hit Ctrl + X followed by Y and then Enter to save and exit. Close down your elementary instance, wait a few seconds (eight is the official line from Microsoft), and then when you relaunch you should be ready to go, already logged in as user.
Alternatively, if you’re using Windows Terminal, open the Settings, find your Linux Mint install in the sidebar, and then in the command line box ensure this command is stored:
wsl.exe -d <distroname> -u <yourusername>
This will have the same effect once closed down and restarted. Setting up a wsl.conf file is preferable, though, as it ensures you’re always entering as user and can also store additional settings for your distro.
You’ll also find a number of fairly basic functions and apps that don’t seem to be installed (at least in the build at the time of writing). For example, I had to install the Nano text editor, Git, and wget in the course of setting up elementary OS. Those are three you should definitely add and all are available in the apt repository.
sudo apt install nano wget git
Using the bash shell with elementary OS on WSL
Source: Windows Central
bash
in the terminal, but that’s going to get tedious. So we need to set it up to do it for us.
Note, these steps can also apply to other shells such as Fish or zsh, but we’re using bash for the purposes of this guide as it’s already installed. There are two things you can do.
The first is to use the chsh
command which, as you may guess, changes shell. Enter chsh
into the terminal followed by your password. When prompted enter /usr/bin/bash
as your choice and hit Enter. Close down your instance, give it the eight seconds, then next time you load it up you’ll be in the bash shell instead.
Source: Windows Central
wsl.exe -d Elementary bash
This is a quick fix, but the chsh
method is recommended. And naturally, the course of action for anyone using a different terminal application.
Additionally, you can run multiple instances of elementary OS on WSL. For each subsequent installation, simply change the name of the elementary.exe file from the top of this guide to something else, then run it again. The new instance will be set up with the changed file name, but it does allow you at least to run multiple instances alongside one another.
Dying Light 2 review: Going quietly into the night
Dying Light 2 is an admirable effort from Techland, following up the original game seven years later. High-stakes nighttime play elevates what might have otherwise been a fairly forgettable open-world zombie flick, which will likely find itself a fond place among fans of games with co-op sandbox mayhem.
Ask Windows Central: Will there be a Surface Duo 3?
Welcome to the 10th episode of Ask Windows Central, a show where we answer our community’s most asked questions around Microsoft, Windows, Surface, Xbox, and the general tech industry. In today’s episode, we answer questions about Windows 11, Surface Duo, Your Phone, and more!