# Setup Your Software Development Environment in Windows 11 (+WSL 2)

## Your Windows 11 and Windows Subsystem for Linux 2 / WSL 2

WSL 2 is a really cool feature that lets you run Linux apps on your Windows computer, without any complicated setup or messing around with virtual machines.

Basically, it's like having a secret Linux superpower inside your Windows machine! And the best part? You can use all your favorite Linux tools and workflows, right alongside your usual Windows stuff.

It's the perfect way to get the best of both worlds, whether you're a developer or just a curious tech enthusiast. So go ahead and give WSL 2 a try – you might be surprised at all the cool things you can do with it!

## **Install WSL 2**

1. Start **CMD** with administrative privileges
    
2. Run `wsl -l -o` to list other Linux releases.
    
3. Execute `wsl --install` command to install default distro.
    
4. You can install your favorite Linux distribution, use `wsl --install -d NameofLinuxDistro` .
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681049956202/66fcb54c-df73-406c-9f22-844abfe94a31.png align="center")

```plaintext
Ubuntu 22.04 LTS has been installed.                                                                                                                                                                                                         The requested operation is successful. Changes will not be effective until the system is rebooted.
```

1. Reboot the computer.
    
2. You then will be prompted to create a UNIX user and password.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681050522046/9eee6a2a-6c2c-4ec6-a2cf-c5203a443109.png align="center")

To access your Linux distro, search it from your app then click **Open.**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681051031615/23f2ee2c-dc75-413a-bdab-e04096a9e4a2.png align="center")

## Re-claim Your Dev Environment

* Download Hyper terminal from its official site: [https://hyper.is/](https://hyper.is/)
    
* Open Hyper properties, go to the **Compatibility** tab then check **"Run this program as an Administrator"**.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681056293346/df144d23-1d4f-411f-a8ad-81c0a81b6ad1.png align="center")
    
* Reopen Hyper and let's make it access WSL by default: **Edit &gt; Preferences**
    
* Find and update these lines:
    

```json
...
shell: 'C:\\Windows\\System32\\wsl.exe',
shellArgs: [~],
...
```

`shell` executes the **wsl.exe** command once Hyper is booted, then `shellArgs` changes the directory to the UNIX root.

* Install zsh and oh-my-zsh from Hyper:
    

```bash
sudo apt update && sudo apt upgrade -y

sudo apt install zsh -y
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681056340501/e707a246-06f7-44f4-8ac6-73ce4279281a.png align="center")

* Download and Install VSCode: [https://code.visualstudio.com/Download](https://code.visualstudio.com/Download). Be sure to select **Add to PATH** option so you can easily open a folder in WSL using the code command.
    
* From VSCode, search and install **Remote Development extension**.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681053828908/ce7627f5-19c5-4fa8-8df9-dfdbab22387a.png align="center")
    
* Update your Linux distributions. Some WSL Linux distributions are lacking libraries that are required by the VS Code server to start up. You can add additional libraries to your Linux distribution by using its package manager. Run `sudo apt update` .
    
* Open VSCode then click the green symbol on the left-bottom screen. Choose **Connect to WSL**. VSCode will configure everything.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681054347595/26aa6859-247a-4772-b06c-4c2d9ed6dca8.png align="center")
    
* Coding.
    

## Closing

In conclusion, WSL 2 is a powerful tool that brings the best of Linux and Windows together in one neat package. With its lightweight virtual machine, full Linux kernel, and built-in display server, it offers a seamless and efficient way to run Linux applications on a Windows computer.

Whether you're a developer looking to streamline your workflow or just a curious tech enthusiast, WSL 2 is definitely worth checking out. So why not give it a try and see what kind of cool things you can do with it? Who knows, it might just become your new favorite tool!

Keep an eye out for future posts where I'll delve into even more interesting topics. In the meantime, I hope this information has been helpful and I look forward to your continued engagement. Thanks again!
