The Windows subsystem for Linux is useful for development, especially web development. Part of web development is testing your website on different browsers.
With the ability to run graphical Linux apps using the Windows Subsystem for Linux 2, you can test your websites in Linux browsers without having to set up a separate Linux desktop or virtual machine.
Here are some of the best web browsers you can install with WSL 2.
Although Firefox has been overtaken in usage by Google Chrome, it’s still very popular in the Linux world due to the privacy-friendly stance of its developer, the Mozilla Foundation. While the Windows version is easy to download, you can install the Linux version in Ubuntu as well.
To install Firefox on Debian-based distributions, run:
sudo apt install firefox
2. Google Chrome/Chrome
Google Chrome is still the world’s most popular browser statcounter. It’s not even a close race between Chrome and the second most popular browser, Apple’s Safari.
Chrome runs on a whopping 62 percent of all devices, compared to Safari’s 19 percent. On desktop alone, Chrome almost tops out 65 percent worldwide.
Chrome’s popularity means it’s your primary market when designing a web app. While you should create an app that works in as many browsers as possible, the vast majority of your users will likely view it through Chrome. This includes Linux users, so it’s worth testing via WSL.
There are two ways you can install the Linux version of Chrome on your Windows computer. You can download the standard version of Chrome from Google’s website or install the open-source Chromium version from the package manager.
To install Chrome, just go to the website and download it. By default, the Windows version is suggested, but you can download an alternative version. Make sure to download the DEB package when prompted.
Download: Google Chrome for Linux
To install Chrome, use the cd command to navigate to the directory where you downloaded it. This will be on the Windows side, so you are in the /mnt/c/ Hierarchy.
Once you get there, use dpkg to install it:
sudo dpkg -i google-chrome-stable_current_amd64.deb
The other way to install Linux Chrome browser is through Chromium. This is where open-source development for Chrome happens. To install it in WSL Ubuntu, type:
sudo apt install chromium-browser
3. Microsoft Edge
Microsoft Edge is notorious for how its parent company is trying to make it the browser of choice over Google’s far more popular offering. Microsoft has even claimed Chrome is outdated, despite the fact that the two browsers are very similar under the hood, as they share a rendering engine. If that’s not bad enough, they also support a Linux version.
Jokes aside, Microsoft releasing a browser for Linux a few years ago would have seemed impossible. All Edge users developing a web app or extension for Microsoft Edge must install it on their system for testing purposes.
It might seem strange to install a Linux version of a browser that comes natively with the host operating system, but it’s also easy. You just go to the website and download the DEB file and use dpkg, similar to installing Chrome.
sudo dpkg -i microsoft-edge-stable_*.deb
Download: Microsoft Edge
Modern browsers like Firefox, Chrome and Edge are full-featured behemoths. Dillo takes a different approach, aiming for a minimal footprint. It’s just a browser and nothing more. There is no way to install plugins that extend its functionality. This can be a disadvantage when you need access to more advanced features.
The benefit of this approach is that you know what your browser is doing. There is no native Windows version of this browser available, so you must use the Linux version unless you want to compile it yourself.
You can install it with this command:
sudo apt install dillo
From minimal to fully equipped again, there is Opera. Compared to the relative newcomers of Chrome and Edge, Opera is a perennial favorite with its first version released in 1995. With a browser approaching 30, it must be doing something right.
Opera’s continued cult following is due to its cross-platform support. Aside from PCs, everything from mobile phones (the pre-smartphone variety) to gaming consoles supports Opera. And yes, there is a Linux version.
It’s not exactly the same browser as it was in the ’90s, having switched to the Chromium engine used by Chrome and Edge in 2013. It has some interesting features that are worth checking out.
The developers have made privacy a focus of Opera, with built-in access to a VPN, as well as built-in ad and tracker blockers.
For those longing for the days of ChatZilla on Firefox, there’s a built-in chat client that supports Facebook Messenger, WhatsApp, VKontakte, and Telegram. You can also share files between devices running Opera. A cryptocurrency wallet is also integrated.
Installing Opera is similar to installing Chrome and Edge. You just go to the website and download the DEB file, navigate to the directory where you downloaded it and then run dpkg.
sudo dpkg -i opera-stable_*.deb
Brave is another browser that aims to compete with the big browsers. Like Dillo, it claims to be smaller and faster than Chrome.
Like Opera, Brave advertises itself as a privacy-friendly browser, with its own ad and tracker blocker enabled by default. As an alternative to targeted ads, you can earn a cryptocurrency called Basic Attention Token based on Ethereum by enabling Brave’s own ads in your browser.
You can install the Linux version on WSL by going to the Linux download page and pasting the code provided by Brave to install some packages and adding the repository to APT.
Run the following commands one by one to download the GPG keys:
sudo apt install apt-transport-https curl
sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main"|sudo tee /etc/apt/sources.list.d/brave-browser-release.list
Then make sure your packages are up to date and install Brave:
sudo apt update
sudo apt install brave-browser
Lots of browsers to try WSLg
Whether you’re trying to build a web app or debugging a hot new extension, WSL with Windows 11 gives you options when testing in Linux browsers.
You don’t need to install a VM or try to find a desktop machine to install Linux. Running graphical apps on WSL ensures users get the most out of the Linux environment installed in Windows.
How to run Linux GUI apps with WSL2 on Windows
About the author