5 Things to Do to Improve Your WSL Experience - Make Tech Easier

2022-07-29 23:13:36 By : Mr. Qiang Wang

Get the best out of your WSL experience.

Microsoft’s Windows Subsystem for Linux (WSL) has been a game changer that lets you get the best of both worlds (Windows and Linux). However, to get the best out of WSL you can’t just rely on how it comes out of the box. In this article, we will go over 5 things that can make your WSL experience even better.

We will be using WSL 2 and Ubuntu throughout this article, but you can apply these tips to any distro of your choice.

Also read: How to Install Linux on Windows with WSL

Zsh, also known as Z-shell, is a more powerful and customizable shell than Bash shell, which is the default shell for most Linux distros. Zsh comes with advanced features like autocompletion, autocorrection, built-in Git integration, and supports installing themes and plugins.

Now we have Zsh installed. However, to manage your Zsh you can install frameworks like Oh My Zsh.

Oh My Zsh is an open source, community-driven framework which lets you manage themes and plugins for Zsh in a more convenient way.

You can install Oh My Zsh using curl and git, which come preinstalled with most of the WSL distros. If you don’t have them installed, you can always install them using sudo apt install curl git.

Now that we have cURL and Git installed, run:

This will clone the repository and install Oh My Zsh. In the installation process, you will be prompted with the question “Do you want to change your default shell to zsh?.” Press Y and Enter to make it your default shell.

Also read: How to Reset a WSL User Password

You might have noticed some weird symbols showing on the terminal. This is because we don’t have the appropriate fonts (Powerline) installed.

This will clone the fonts in your Windows home directory of Windows.

As we already have Oh My Zsh installed, which comes with so many themes preinstalled, we can use them by configuring our “~/.zshrc” file.

You can find the names of all the preinstalled themes of Oh My Zsh here.

Also read: 8 of the Best Linux Distros for Windows Users

WSL can be quite resource hungry and a memory hog, especially when you are using applications like Docker which can take up a lot of your usable memory. The problem is, sometimes it doesn’t deallocate your memory even if it doesn’t need that extra memory anymore. This can result in your entire PC slowing down and even lagging. You can easily fix this issue by limiting how much memory and how many CPU cores WSL can access.

This will set the maximum memory usage limit to 3GB and WSL will have access to 2 virtual processors. For example, if your CPU has 4 threads, WSL can now access 2 of those.

You can also configure your WSL for things like limiting the swap usage, turning on console debugging, and using a custom kernel. You can check out Microsoft’s official docs for all the configurable options.

If you have used Git in WSL, you might have already noticed that WSL keeps asking for your Git credentials every time you push something on GitHub.

To fix this, you can use your Windows Git credential manager for WSL and have the same credentials across Windows and WSL.

To set your WSL’s Git to use Windows Git credential manager, run the following command in your WSL terminal:

Also read: How to Mount a Windows Share Folder on Linux

Although WSLg can run GUI apps, it’s only limited to Windows 11 and Windows 10 insider versions. Also, running a desktop environment is a mess in WSLg. A VNC server can come in handy if you want to access your Linux distros remotely.

This will prompt you with two options for your display manager. You can choose either one. I’m using lightdm here. Select “Ok” after choosing your preferred display manager.

Now that we have a VNC server installed and running. We can use a VNC server to access it.

and from the output, copy the port number under the “Local Address” column. In my case, it is showing 0.0.0.0.0:5912 under the first “Local Address” column. The port number starts after : which is 5912. If you face issues like VNC Viewer taking too long to connect, you can retry with a different port from the “Local Address” column.

Now we can use our WSL’s Linux distro in a GUI environment. You can now install any GUI app in your Linux distro and use it through the VNC viewer.

The VNC server creates a new display session every time you run vncserver. We can create a script to avoid that.

This will kill the first display session and remove the files associated with the session.

From now on you can run “~/startvnc.sh” to start your VNC server at the first display session.

Also read: 8 Reasons to Switch from Windows to Linux

Although you can transfer files from Windows to WSL, having a GUI environment for copying and moving your files comes in handy. You can use the built-in File Explorer of Windows for transferring your files using a graphical interface.

This will open your WSL distros’ directories.

Yes, you can use IDE in your Linux distribution using WSL. Although the performance is not the same as native apps, it’s quite usable.

No. Besides the preinstalled themes, you can also install third-party themes for Zsh.

No. Any configuration changes to WSL will be applied to all of your installed Linux distros.

Our latest tutorials delivered straight to your inbox

How to Convert Legacy BIOS to UEFI in Windows

Stop Your PC from Making Random USB Noises

How to Set up and Use a RAM Drive in Windows

How to View Network Adapter Details in Windows

How to Use vDos to Run Old DOS Programs on Windows

Settings App Not Working in Windows? Here Are the Fixes

How to Install Android Studio and SDK Tools in Windows

How to Fix 'Bad System Config Info' Error in Windows

Windows 11 Search Bar Not Working? Here's 9 Ways to Fix It

How to Connect a Laptop Screen as External Monitor in Windows

Affiliate Disclosure: Make Tech Easier may earn commission on products purchased through our links, which supports the work we do for our readers.

© 2022 Uqnic Network Pte Ltd. All rights reserved.