Skip to content

A simple guide based on my experience on setting up a linux distribution (ubuntu) on VS Code for windows 11 using wsl (Windows Subsystem for Linux).

Notifications You must be signed in to change notification settings

Yang8823/How-to-install-linux-on-windows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 

Repository files navigation

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

About

A simple guide based on my experience on setting up a linux distribution (ubuntu) on VS Code for windows 11 using wsl (Windows Subsystem for Linux).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published