Skip to content

Instantly share code, notes, and snippets.

@suhailroushan13
Last active March 18, 2025 14:18
Show Gist options
  • Save suhailroushan13/18536695419546dcc0413211e0ea4ac6 to your computer and use it in GitHub Desktop.
Save suhailroushan13/18536695419546dcc0413211e0ea4ac6 to your computer and use it in GitHub Desktop.
Setting Up WSL
WSL ==> Windows SubSystem Linux
Why Linux
1.Open Source
2.Free of Cost
3.Full Control Access
4.Wide Developer Community
5.It Has Multiple Child Operating Systems depending varios roles
Linux is the Parent OS
- Distros/Child Of Linux
- 1.Ubuntu - Web Developers
- 2.Kali Linux - Cyber Security
- 3.Fedora Linux - Domestic Purpose
- 4. Parrot Linux - For Attacking Tools
// Wsl ==> We are setting up linux environment in windows
// WSL is for beginners
// Steps to Install WSL
1. Remove Unwanted Softwares from your windows ==> from control panel
2. Open your Microsoft Store and Install Windows Terminal Preview
3. Open Search Bar and Type PowerShell and Click on Run as Admin
Paste the below 2 commands in powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
4.Open your browser and paste this link
Download this file : https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
5. Paste this command in Powershell
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
6.Paste this command in Powershell
wsl --install
wsl --install -d Ubuntu-24.04
wsl --set-default-version 2
wsl --list --verbose
7.Open Search Bar and Search Ubuntu
Wait for 3 mins and and It will ask for username and password
Note : password will be hidden when you type
Note : Keep your username and password same
example :
username : suhail
password : suhail
8. Setting Ubuntu
Make sure it asks you username and password
if it didn't asked then you have messed up the process
also make sure you get green color username in terminal
9. Open Windows Terminal from Search Bar
10. Click on dropdown and setting and set
default profile to Ubuntu 24.04 last one
Default terminal Application set it to Windows Terminal Preview
click on save
11. Now you have your ubuntu terminal
-----------------------------------------------
Installing & Updating Packages
Example Nodejs and github
For Mac Users
1.Install iterm2 from internet
and open terminal
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
nvm install 22
Close your terminal and reopen it
node -v # Should print "v22.13.0".
npm -v
For Linux/Ubuntu Users
1.Open your Ubuntu Temrinal Windows Terminal Preview
2. sudo apt update && sudo apt upgrade
3. curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
Close your terminal and reopen it
4. nvm install 22
5. Close your Windows Terminal Preview
6. node -v
7. npm -v
if you see the version which you installed in -v commands then its succesfully installed
-----------------------------
Installing VS Code
1. Search VS code and donwload it
2. Open VS Code
3. click on extensions and install these
- wsl (ubuntu user)
- prettier code format - all
- auto close tag - all
- javascript (ES6) code snippets - all
- vscode icons - all
- live server / live preview - all
- path intellisense - all
- prettify json - all
-- To set a theme in vs code
- click on settings
- select themes and pick color themes
-------------------------------
Installing C lang in Ubuntu
1. Ubuntu
sudo apt update
// below command will install gcc
// gcc is used to run or execute c programs
sudo apt install build-essential
2. check gcc version
gcc -version
3. create a file hello.c
code hello world in c program
gcc hello.c
./a.out
-------------------------------
For Mac Users
pase the below command in terminal
1. xcode-select --install
2. clang --version
-----------------------------
Connecting VS Code to Terminal Ubuntu / Mac
For Mac ==>
1.Open Vs code
2. press control command p
3. and type code and select shell command code type path
4. open your iterm2 terminal
5. type this
code .
and it will open vs code
For Ubuntu
1. Open VS Code
2. select remote explorer icon from left side below extensions
3. select ubuntu and connect to it ..click on arrow of it
4. if you see below at vc code you will see ubuntu 24.04 in blue color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment