How to install linux on windows

How to install linux on windows

How to install linux on windows

1. Install Windows Subsystem for Linux (wsl)

Cheak if wsl is installed:
Type wsl -l -v in cmd
If wsl is not installed, install it by:
Type wsl --install to install wsl









2. Install a linux distribution

Go to microsoft store and install ubuntu
**Sometimes when you type wsl --install in cmd, windows will download the default linux distribution which is ubuntu for you.

3. Enable Hyper V

Type systeminfo in cmd to check if hyper v is enable

If hyper v is enable is will show:
"Hyper-V Requirements: A hypervisor has been detected. Features required for Hyper-V will not be displayed."



If hyper v is not enable, you can enable it according to this tutorial:
https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v

4. Download extension to access ubuntu in vscode

Install the Remote Development extension pack in vscode

5. Open Ubuntu

Open ubuntu and set up new user and password Type login yourusername in ubuntu terminal or vscode ubuntu terminal to login

**Note: when u type in password it wont show anything but your still typing in words so dont think the input is broken

6. Download gcc on ubuntu

Now you can use ubuntu in your vscode but when u try to run c/c ++ code it will not work
You need to download gcc in ubuntu through the terminal in vscode for ubuntu or the terminal when u run ubuntu
To install gcc just type sudo apt install gcc in cmd of the ubuntu
** its best to check for any update with sudo apt update before installing gcc

7. Run C/C ++ code on ubuntu through vscode

Now you can basically code in ubuntu through vscode :)

Additional commands

Type wsl --shutdown to forcibly stop the distribution

If you have any questions or any feedback please, feel free to leave a comment and consider sharing and/or sponsoring us, details below this post!

What's Your Reaction?

like

dislike

love

funny

angry

sad

wow