I use windows for most of my daily tasks, and almost all the software I prefer for my daily tasks, are windows based. Almost 90% of my time is spent on Windows, but still, the gap is there which can only be filled by Linux. Being a developer, I needed Linux for most of my tasks, one of them is deployment. Unlike Windows, Linux is free and most of the Linux versions are open-source.
As the need for Linux came, I completely made a shift to ubuntu. After shifting, I realize that there are plenty of reasons I should shift back to windows. Well, my favorite software which I used in my free time was missing there especially Adobe illustrator(I seriously love this software and this lets you explore your creativity). I came back to windows and opted for the virtual machine.
Think of a Virtual machine as a machine inside your real machine. It’s basically a concept, where most of the resources are split and are made available as a new virtual machine, though this new machine is totally virtual and acts as a real machine. This new virtual machine can be used to install another OS inside your main machine. I hope that now you have a concept of the virtual machine but as a reference, you can also read this definition by Wikipedia.
In computing, a virtual machine is the virtualization/emulation of a computer system. Virtual machines are based on computer architectures and provide functionality of a physical computer. Their implementations may involve specialized hardware, software, or a combination.
Virtual Machine is better when it comes to dual boot. As every tool has some flaws too. Virtual machine too has some cons. As I alluded, a virtual machine runs on your real machine. So each and every hardware resource which our virtual machine will need have to request from the main machine. It means that our main machine will access hardware indirectly, thus its performance will be impacted. So, what is the alternative which can be the best fit for our needs? It’s Windows Subsystem for Linux (WSL).
The WSL is a type of resource within windows OS that allows users to run a Linux command-line interface(CLI) in windows. In WSL, you can do almost all the tasks which you can perform on Linux Terminal.
WSL is based on a Virtual machine. When we download a preferred Linux distro, we are not creating a VM instance. Instead, WSL provides a layer for translating Linux system calls to Windows system calls. Thus Linux binaries are able to run in windows unmodified. We can also have the Linux process communicate with Windows Process. WSL also maps Windows services, like the filesystem and networking, as devices that Linux can access.
Instead of using a VM instance, WSL virtualizes a Linux kernel interface on top of the Windows kernel. it means that running WSL only requires a small amount of memory. And when it’s not in use, the WSL driver isn’t loaded into memory, making it much more efficient than a solution based on a VM.
In order to use WSL in windows, you have to set up and install it first to do that we need some configuration and some Linux kernel installed in our machine, Don’t worry this isn’t as tedious as it sounds.
WSL is a Windows feature and it is by default off and to enable it you need to open
powershell as administrator and run the following command
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
After enabling the WSL feature then we need to enable virtualization functionality to run WSL on windows. In order to enable VM features on your machine, you need to run the command given below in Powershell.
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Open Powershell and run the command given below, you can skip this command. If you don’t want to work with WSL2, you can also work with WSL1. In my case, I would prefer to go for WSL2.
wsl --set-default-version 2
After installing, you need to open ubuntu and for the first time, you have to give a username and a password which will only be for ubuntu and will be used afterward to login and do other
sudo stuff in ubuntu. With all that congrats on installing and setting up WSL on your machine.
I am not against the dual boot, virtual machine instances, or anything else like that. I still use Virtual Machine for some of the Linux applications. The point I am trying to make in this article is that, if you need Linux to just fulfill your developer needs then WSL is the best choice to go for. If you still prefer some other tool and technology that’s totally fine. Choices are our own. With that thanks for reading this article and don’t forget to support me by clicking clap and sharing this with other developers. Cheers!