Use Linux on Windows

Run linux on windows without overhead of Virtual machines...

Table of contents

For linux beginners it is recommended that, they should not install linux as their primary operating system, but should install it in the virtual machines. But wait, what if you're a student who doesn't have enough RAM for running virtual machines smoothly, or need your local files from windows to the linux environment. This article is a kind of tutorial for your linux environment on the top of Windows 10.

WSL only allows you to to use CLI(command line interface), you'll not be able to use the linux desktop or GUI applications

Let's dive into the steps:

Setup

We'll run linux on top of WSL. In windows 10 WSL is shipped as optionalFeature, therefore we need to enable it.

  1. Open your powershell as administrator, and execute below command in it
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
    
  2. You can also use GUI to enable wsl
    • Open run prompt with windows+r
    • Type optionalFeatures and hit enter
    • Just tick the checkbox in front of windows subsystem for linux image.png

Restart the computer when prompted.

Install Linux

After a fresh restart, WSL is ready to use. Now, we'll just download and install a OS. This is similar to downloading and booting an ISO step in virtual machine. I'll be installing a Debian image. Other images available are Ubuntu, Fedora remix(paid), Alpine and openSUSE.

  • Head over to Microsoft Store and search for Debian.
  • On the Debian info page, click on Get to install the app. image.png

  • Upon successful download, just search for debian in your windows search bar. image.png

  • Wait for the OS to install and configure.
  • Upon prompts, Enter new username and password for the linux user. Note that this username and password has nothing to do with the windows password. image.png

With this you can now use your debian terminal.

  • You can access your local folders from this terminal.
  • You can now download and use various packages, services such as apache, python, nodejs, nasm etc.
  • Services running on debian can be accessed in your windows at http://localhost or http://127.0.0.1.
  • For developers: VSCode has excellent support for WSL