StudyLover
  • Home
  • Study Zone
  • Profiles
  • Typing Tutor
  • Contact us
  • Sign in
StudyLover WSL or VirtualBox setup
Download
  1. Linux
Linux Filesystem Overview : Basic terminal commands
Linux

Quick decision guide

·         Choose WSL if you’re on Windows 10/11 and mostly need a Linux terminal for coding (C/C++/Python/Java, Git, DBs, web servers, Docker). It’s fast, easy, and integrates with Windows.

·         Choose VirtualBox if you want a full Linux machine (with its own desktop, kernel modules, custom networking) or you’re practicing OS/Networking at a lower level.


A) WSL (Windows Subsystem for Linux) — Best for most beginners

1) Check prerequisites

·         Windows 11 or Windows 10 version 2004 (build 19041+).

·         Virtualization enabled in BIOS (Intel VT-x / AMD-V).
To check in Task Manager → Performance → CPU → “Virtualization: Enabled”.

2) One-command install (Windows 11 / recent Windows 10)

Open PowerShell as Administrator and run:

wsl --install -d Ubuntu

This:

·         Enables required Windows features,

·         Installs WSL2,

·         Installs Ubuntu (you can pick others later).

If prompted, reboot. After first launch, create your Linux username & password.

Alternate: If wsl isn’t recognized (older Windows 10)

Run (Admin PowerShell):

dism /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

dism /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

wsl --set-default-version 2

Reboot, then install Ubuntu from Microsoft Store.

3) First-time setup inside Ubuntu

sudo apt update && sudo apt upgrade -y

sudo apt install -y build-essential git curl wget python3 python3-pip

4) Useful integration tips

·         Windows files in Linux: cd /mnt/c/Users/<YourName>/Documents

·         Linux files in Windows: Explorer → address bar → \\wsl.localhost\Ubuntu\home\<yourname>

·         Windows Terminal (nice tabs & profiles): install from Microsoft Store.

5) Enable systemd (so services like Docker, PostgreSQL work smoothly)

Create/edit /etc/wsl.conf:

sudo nano /etc/wsl.conf

Add:

[boot]

systemd=true

Then in PowerShell (Windows):

wsl --shutdown

Reopen Ubuntu.

6) (Optional) Install Docker in WSL

Simplest path: Docker Desktop for Windows with “Use the WSL 2 based engine” enabled.
CLI only (inside Ubuntu) is also possible, but Docker Desktop is beginner-friendly.

7) Performance & quality-of-life

·         Keep project files in Linux home (e.g., ~/code) for best performance (faster than /mnt/c).

·         Increase file watchers for web dev:

echo "fs.inotify.max_user_watches=524288" | sudo tee -a /etc/sysctl.conf

sudo sysctl -p

·         Update WSL kernel (if needed):

wsl --update

8) Quick lab (15 minutes)

mkdir -p ~/lab/wsl101 && cd ~/lab/wsl101

sudo apt install -y nginx

sudo systemctl start nginx

# In Windows, visit http://localhost to see Nginx welcome page


B) VirtualBox — Full Linux VM with desktop

1) Install VirtualBox

·         Download & install Oracle VirtualBox (current 7.x).

·         Ensure Virtualization is enabled in BIOS (VT-x/AMD-V).

2) Download a Linux ISO

·         Ubuntu LTS (beginner-friendly). Save the .iso file.

3) Create a new VM

VirtualBox → New:

·         Name: Ubuntu-22.04 (example)

·         Type: Linux, Version: Ubuntu (64-bit)

·         Memory: 4 GB (4096 MB) minimum (8 GB if you can)

·         CPUs: 2 (or 4 if you have many cores)

·         Disk: Create virtual disk VDI, dynamically allocated, 30–40 GB+

4) Attach the ISO & install

·         Settings → Storage → select the empty optical drive → choose your ISO.

·         Start the VM → the Ubuntu installer appears.

·         Pick Install Ubuntu, keyboard, timezone, user/password.
(Inside VM only: “Erase disk and install” is safe—it formats the
virtual disk, not your host.)

5) Post-install essentials

Remove the ISO (VirtualBox may do this) and reboot into your new Ubuntu VM.

Install Guest Additions (for better display/clipboard/filesharing)

In the VM window: Devices → Insert Guest Additions CD image, then:

sudo apt update

sudo apt install -y build-essential dkms linux-headers-$(uname -r)

sudo mount /dev/cdrom /mnt

sudo /mnt/VBoxLinuxAdditions.run

sudo reboot

Now you get auto-resize display, shared clipboard, and drag-and-drop (enable in VM Settings → General → Advanced: set both to Bidirectional).

Shared folders (exchange files with Windows host)

·         VM Settings → Shared Folders → add a folder from Windows (tick Auto-mount & Make Permanent).

·         Inside Ubuntu:

sudo usermod -aG vboxsf $USER

# Log out/in (or reboot). Your shared folder appears under /media/sf_<Name>

Networking modes (know these for labs)

·         NAT (default): VM has internet; host can’t directly reach VM unless you set Port Forwarding.

·         Bridged Adapter: VM gets an IP on your LAN (good for server/network labs).

·         Host-only: VM & host talk privately (no internet unless you add a 2nd adapter).

Snapshots (lifesaver)

Before experiments: Machine → Take Snapshot.
If you break something,
restore in one click.

6) Quick lab (30 minutes)

Inside the VM:

sudo apt update && sudo apt install -y nginx

ip a  # find VM IP (e.g., 192.168.x.y)

·         If Bridged networking: on your Windows host, open http://192.168.x.y → Nginx page should load.

·         If NAT: set Port Forwarding (VirtualBox → VM Settings → Network → NAT → Port Forwarding, map HostPort 8080 → GuestPort 80). Then open http://localhost:8080.


Common issues & fixes

WSL

·         wsl not recognized → Update Windows; enable features via DISM (see above); reboot.

·         “Requires kernel update” → wsl --update in Admin PowerShell.

·         No internet in WSL → wsl --shutdown, disable/enable network adapter, or reboot Windows.

·         Services don’t start → ensure systemd is enabled in /etc/wsl.conf (see above).

VirtualBox

·         “VT-x/AMD-V not available” → enable virtualization in BIOS; close other hypervisors (e.g., Hyper-V/WSL can conflict on some setups—disable Hyper-V if needed).

·         Guest Additions install fails → ensure dkms and matching linux-headers-$(uname -r) are installed; rerun the script.

·         Black screen / display issues → disable 3D acceleration or switch graphics controller to VMSVGA in VM Settings → Display.

·         Shared folder permission denied → add user to vboxsf group and reboot (see above).


What to do after setup (practice checklist)

·         Compiler toolchain: sudo apt install -y build-essential cmake gdb

·         Python: sudo apt install -y python3-venv && python3 -m venv .venv && source .venv/bin/activate

·         Git: sudo apt install -y git → git config --global user.name "Your Name"; git config --global user.email "you@example.com"

·         Web server: sudo apt install -y nginx → open http://localhost (WSL) or VM IP (VirtualBox)

·         Database (extra): sudo apt install -y postgresql → sudo systemctl status postgresql


TL;DR

·         WSL = fastest path to a Linux terminal on Windows; perfect for coding and most course labs.

·         VirtualBox = full Linux desktop/server in a VM; perfect for OS/networking practice and “real server” feel.
Set up either (or both), run the quick lab, and you’re ready for your Linux coursework.

 

Linux Filesystem Overview Basic terminal commands
Our Products & Services
  • Home
Connect with us
  • Contact us
  • +91 82955 87844
  • Rk6yadav@gmail.com

StudyLover - About us

The Best knowledge for Best people.

Copyright © StudyLover
Powered by Odoo - Create a free website