Setting Up Linux on Your Windows Machine

Setting Up Linux on Your Windows Machine

scotty profile picture

Scotty Parlor

Feb. 17, 2020

Read Time 4 min

As we continue to practice development for real world application, we will encounter a lot of different operating systems utilized. A lot of people use windows. It's what this generation grew up with and has a lot of awesome business application. But the world of Unix is growing continually and many companies employ it's systems for development. Mac and Linux are very closely related. I personally use Ubuntu for my work, but use a MacBook Pro for my actual professional job. A lot of what I will show you is going to be in the bash shell (standard with mac/linux). I don't want to limit my audience to just those users, so I figured that I would show you microsoft users how to utilize the linux shell without purchasing a new computer!

 

Option One: The Windows Subsystem for Linux (which is really, really, cool)

 

The first way I will describe is with the WSL or Windows Subsystem for Linux. Their documentation is pretty solid and even goes a little further with launching a node app. But for the sake of imagery I will lay it out here.

 

  1. Open Powershell as an administrator and run the following:

 

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

 

 

 

 

  1. Open the Microsoft Store application and search for linux.
  2. Choose the distro you want (I like Ubuntu).

 

 

  1. Launch it and wait for it to install. Once ready, follow the prompt to setup your account

 

 

  1. Now, its installed. Check out your current directory by running:
pwd

It should display /home/$yourUserName

Have some fun!

echo "Hello!"

 

Or maybe install python3 with apt!

sudo apt install python3

That's where i'm gonna leave it for right now. Lets take a look at another option that Mac users can employ as well!

 

Option Two: The Ubuntu Virtual Machine (Useful for many things, may be memory expensive and overkill for our learning usage)

 

We are going to use a free Orcale VM program called VirtualBox to create a virtual machine and install any operating system we want (I am going to use Ubuntu, again).

 

  1. Let's first download VirtualBox from https://www.virtualbox.org/wiki/Downloads and then install it!

    It should open automatically, but if not, open it.

     

 

 

 

  1. Next, let's download our linux distro. You can use anything you like, but I like Ubuntu.
  2. Once that .iso file is downloaded, let's swing back around to VirtualBox and create a new VM

 

click "Add"

Name the VM and select "Linux", "Ubuntu (64-bit)"

Give it whatever RAM you can afford. If you don't give it some juice, it will run very slow.

You can add hard disk space, (VDI)

 

  1. Now that we have created it, lets run it by double clicking it and install that ubuntu iso.

 

 

 

  1. Go through the install instructions and complete the process. You can now start this VM to use Linux whenever you want!

 

 

There is always the option to partition your drive, but I would not recommend it if you are just starting out. I tried out the WSL and I love it. I suggest you start there.