ENABLE VIRTUALIZATIO ON WINDOWS OS TO ALLOW THE USE OF LINUX OS

Chibuokejuliet
5 min readAug 6, 2023

--

After so much hassle, I have been able to successfully set up my Windows OS PC to enable the use of virtual machine to run a Linux OS, specifically, Ubuntu. You might wonder, why? But, Windows OS doesn’t support some packages that you might need as a data professional, for example, Apache Airflow, which is a commonly used scheduler. Apache airflow typically runs on Linux OS and Mac OS

Now, on to the steps that will be covered in this post:

1. Enabling the WSL component on your Windows OS PC

2. Enabling virtualization on your PC

3. Getting Ubuntu and setting up your account

4. Setting the default version of WSL to version 2(current version as of the time this article was written — August 2023)

5. Setting the Linux distribution (Ubuntu) version to version 2.

Enabling The WSL Component On Your Windows OS PC

If you are not sure that your processor can allow for virtualization, you can easily check this by typing the name of your processor on any search engine to find out. To check your system’s processor type, right click on the home button and click on system.

Now that you know your system can allow for virtualization, the next step is to enable WSL on your system. To do this, type Feature on your search panel, then click on Turn Windows features on or off.

In the window that pops up, enable the following features — Hyper-V, Virtual Machine Platform, Windows Subsystem for Linux (WSL).

Once the above has been completed, you can proceed to enabling the virtualization component of your system.

Enabling Virtualization

Turn off your PC, then click on the power button and rapidly press the escape button as the PC is turning on (Note that this is for HP Elitebook folio 1040. Booting into BIOS setting is PC specific.), to launch you to the BIOS setting screen. On this screen, select BIOS setup (usually the f10 button on HP — worry not though, the key to press will be specified in this page on your PC).

Once in this BIOS setup menu, scroll to Advanced (You can navigate to this page by using the right and/or left arrow key on your PC’s keyboard).

On this page, click on System information. Once on this tab, click on Device configuration.

Once in this tab, scroll down to ‘Virtualization Technology (Vtx) and check this box. Scroll down to ‘Virtualization Technology For Directed I/O (Vtd) and click the check box as well. Save changes and exit. ( For HP Elitebook Folio 1040).

Getting Ubuntu And Setting Up Your Account

Ubuntu is one of the many Linux system distribution. To get this, on your search panel beside the windows logo on your pc, type in Microsoft store, then click on it to direct you to the store. Type in the search bar, Linux, once in the store. Then select Ubuntu to download it. After downloading it, you click on the launch button. However, if you accidentally close the page after download, you can always type in the search bar beside the windows logo in your pc, for Ubuntu. Click on it to start the Ubuntu terminal. Once the installation process on the terminal is complete, you would be prompted to create your username and password. Do not forget this. To do this, press Enter button on your keyboard.

Setting The Default Version Of WSL To Version 2

Run your Windows PowerShell as administrator. To do this, search for PowerShell on your PC, then select, run as administrator.

When prompted to allow this app make changes to your PC, click, “yes” .

On the terminal, type the following command to enable Hyper-V feature

Dism.exe /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V

Click the Enter button on your keyboard to run it. This will enable the Hyper-V feature on your windows PC.

Then restart your PC to enable the changes take effect.

To ensure that the feature has been enabled on your PC, run the following command in your Windows PowerShell as an administrator

Get-WindowsOptionalFeature-Online –FeatureName Microsoft-Hyper-V

If the Hyper-V feature has been successfully installed, you would get the message, State : Enabled

Still on the Windows PowerShell terminal as an administrator, set WSL to version 2 by running the following command

wsl --set-default-version 2

The above will ensure that the WSL version 2 is set as the default. Next, the Ubuntu distribution has to be set to version 2 as well. To do this, type in the following command

wsl --set-version Ubuntu 2

To verify that the WSL and Ubuntu set up to version 2 has been successfully implemented, run the following code

wsl --list --verbose

Restart your PC to ensure that changes get implemented.

I hope this post helped. Thank you for reading.

--

--