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
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.
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
Install the Remote Development extension pack in vscode
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
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
Now you can basically code in ubuntu through vscode :)
Type wsl --shutdown
to forcibly stop the distribution