Setting up Windows for development
Tags: windowsterminal, windows, development, environment
Published: 2020-07-06 14:40:49

---
title: Setting up Windows for development
published: true
description: Steps to setup windows terminal for development
tags: windowsterminal,windows,development,environment
cover_image: https://betanews.com/wp-content/uploads/2019/06/windows-terminal.jpg
---

# Contents
1. [Introduction](#introduction)
2. [Notes before you start](#notes-before-you-start)
3. [Make your Windows fast](#make-your-windows-fast)
4. [Enable developer mode](#enable-developer-mode)
5. [Install chocolatey](#install-chocolatey)
6. [Install Git and other basic softwares](#install-git-and-other-basic-softwares)
7. [Setting up Windows Terminal for development](#setting-up-windows-terminal-for-development)
8. [Install Windows Subsystem for Linux (WSL)](#install-windows-subsystem-for-linux-wsl)

# Introduction

After a smooth upgrade to Windows 10 2004 May 2020 edition, I can finally conclude that this is all a developer needs. A Windows environment for writing programs in Windows and a Linux kernel to write programs in Ubuntu (which can also be almost shipped to MAC-OS X).

Finally this makes Windows the best developer platform. But, this setup doesn't come by default. Not all Windows users are developers after all (well, most of them are not). Therefore, this post will serve as a go-to guide for all the developers out there to setup the perfect Windows development environment for all kinds of development.

# Notes before you start

1. If you don't have Windows this guide is not for you.
2. You might need a good internet connection. You might spend around 3-4 GB of data during this process. But its a one time thing, so don't worry.
3. This is a highly opinionated guide. Comments are welcome.
3. This guide will be for fresh installation of Windows. But you can still follow the guide even if you have various tools installed.
4. If you have a pirated copy of Windows. Well. Activate it. Its important! :P
5. This article will keep on getting updated with time. So, its not constant. This is a reference guide kind of article for users who need to make Windows suitable for developers.

# Make your Windows fast.

This is a highly opinionated section. I am not a pretty big fan of the GUI and stuffs. I like to keep it minimal so as to make Windows run faster. Windows is indeed a heavy operating system. This helps me not worry about performance while working (which I do most of the time.). Let's see how we can make our Windows fast.

1. **Uninstall all the anti-virus softwares and enable Windows defender.** I won't go in very details into this topic. As a developer you can be in peace with Windows Defender which is just fantastic. For more information on how to do it, checkout: [TechAdvisor - Do you need an antivirus?](https://www.techadvisor.co.uk/feature/windows/do-you-need-antivirus-3668819/)
[Enable Windows Defender Windows 10](https://howtoway.com/enable-windows-defender-windows-10/)

2. *Disable startup programs*. You can disable all the startup programs using the Task Manager:
a. Simply press: `Ctrl+Shift+Esc`. It opens up the Task Manager.
b. Then open `Startup` tab.
c. Disable everything. I have disabled all the third-party updaters and everything. Docker, Slack, Adobe, OneDrive, GDrive, Sound and Graphics Driver utilities, etc. Disable them all. Start them manually only when you need it. Don't worry. It won't do any harm to your PC. I have done it and I am at peace.

3. *Disable special effects and themes*: This is optional as people like to have a sexy looking animation and themes on Windows. I actually prefer to have a simple one. Let's see how we can do it.
a. Press `Win + I`. (Open Windows settings)
b. Go to `Personalization` and then select `Colors`.
c. Disable `Make Start, taskbar and action center transparent` in old versions of Windows 10. In the latest version, deselect the options under `Show accent color...`
d. Close the settings window.
e. Right click on the **Start menu** and select *Advanced System settings`. In `Visual Effects` tab, select `Adjust for best performance`. That's it. Animations will be off but performance gets a slight boost.
f. Now, open settings again. (`Win + I` key).

3. *Lower your resolution.*. This is optional but a guaranteed hack to make your PC fast. So, if you are ready to sacrifice a tad-bit of resolution for faster workflow. Do it.
a. Go to `System` option and then `Display`.
b. Scroll down to display resolution. change it to `1366 x 768` or nearby. `1980x1080` will make your laptop slower if your resolution is high.

Still if you are facing issues refer to this link: [CNET - Speed up windows 10](https://www.cnet.com/how-to/easy-ways-to-speed-up-windows-10/)

# Enable developer mode:

Performance tuning is over. Now, we have to enable Developer mode to run a few applications meant for developers like Windows Subsystem for Linux. Follow the instructions:
1. Press `Win + I` to open Windows settings.
2. Go to `Update & Security`.
3. Go to `For Developers` section on the left menu bar.
4. Select `Developer mode`. Wait for sometime. This might take a while. After the loading finishes. Move on to the next step.

# Install Chocolatey

Chocolatey is a simple package manager for Windows that helps install necessary software on a Windows machine. For installing Chocolatey:
1. Start menu
2. Find `powershell`. Right click on it. And `more > Run As Administrator`.
3. Click `yes` on prompt.
4. Type in the following:
```Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))```
This will download Chocolatey and install it
5. Test the installation:
```choco --version```
6. Install *gsudo*. (gsudo acts like `sudo` command for linux i.e. it gives admin privilege to your commands)
```choco install gsudo```
7. From now on we will extensively use chocolatey and gsudo.


# Install Git and other basic softwares

We will now install a lot of softwares required for development:
1. First we need to install chocolatey as in the last step.
2. Then simply paste the following code:
```gsudo choco install git visualstudio2019buildtools microsoft-windows-terminal vscode notepadplusplus.install```
3. This might take time depending on your PC and internet connection. This is most of the software you will require.
4. Once it's done. You will have the following softwares on your platform:
* *Git*: Version control. Probably you will use git more than ever.
* *Visual Studio Build Tools 2019*: Build tools for running native applications. If you are a python/nodejs user, you might feel this is necessary. In fact. you will realize its necessity one day or the other.
* *Python*: Many tools/build-scripts are written with Python. Even if you will never code in Python in your life, this will still be of use somewhere or the other.
* *Microsoft Windows Terminal*: The best terminal in the world!
* *VSCode*: This is an opinionated choice, but well! Its awesome to it core.
* *Notepad++*: This acts like a perfect replacement for Notepad plus lots of features. Its super fast too! It lies somewhere in between the heavy VSCode and Notepad.

# Setting up Windows Terminal for development

1. Open powershell and type in:
```cd $USERPROFILE
git clone https://github.com/kerol2r20/Windows-terminal-context-menu
cd Windows-terminal-context-menu
gsudo .\SetupContextMenu.ps1```
2. You have the Windows Terminal installed in your context menu. Right click on any file or empty folder space in Windows Explorer.
3. Next open Windows Terminal and click on the downward facing caret icon on top and then select settings.
4. Copy and paste all the contents of this [Github Gist](https://gist.githubusercontent.com/Himujjal/5bcab21bc33de5d879ad22383924f5c3/raw/ffcb3d82824951a0f8be909ba903488b0c95bf53/settings.json) in the `settings.json` file that opens up in Notepad or VS code.

# Install Windows Subsystem for Linux (WSL)

This is the whole freaking Linux on your Windows. Yes. You heard it right.

WSL 1.0 is more of an simulated environment for Linux running on Windows NT kernel. But WSL 2.0 ships with a full Linux kernel!

We are going to install WSL 2.0. Let's get started.
1. Update Windows to 2004 edition.
a. Yes! For WSL 2.0, you need to update Windows 10 v2004 May 2020 edition. For manual update, download the updater [Windows May 2020 Update](https://www.microsoft.com/en-us/software-download/windows10) And follow the screen instructions.
b. Update done? Restart your Windows and come back to this dev post.

2. Enable Hyper-V
a. You computer also needs to support Hyper-V Virtualization to run WSL 2.
b. To enable Hyper-V, open Powershell and type in:
```gsudo Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All```
d. Restart your PC after the last command.

3. Install WSL:
There are two ways to intall WSL in Windows. First is through the Windows store. Windows Store is a bit tedious and really bad. Although it works fine for me. Anyways, we are going to install `WSL` without Windows Store.
a. Go to [WSL install manual](https://docs.microsoft.com/en-us/windows/wsl/install-manual).
b. Download the distro of your choice from the links. We are going with [Ubuntu 20.04](https://aka.ms/wslubuntu2004).
c. An **.appx** will be downloaded. 
d. In the folder where the distro is downloaded, simply open up terminal as we have done in the previous section.
e. Now put in the following code:
```Add-AppxPackage .\<your_download_distro_name>.appx```
In my case the name of the distro is `Ubuntu_2004.2020.424.0_x64.appx`
f. Now once your installation is done, in the same terminal put:
```dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart```
g. Restart your machine.
h. Now open terminal (wherever you like) and type:
```wsl --set-default-version 2```
That's it! From start menu open up Ubuntu.

There will be more to come. But I am hoping this will keep you from being a happy developer for now!

Follow me on Github: [@Himujjal](https://github.com/Himujjal)
Follow me on Twitter: [@HimujjalU](https://twitter.com/HimujjalU)

Looking forward to reactions in the comments section.