{"id":29861180,"url":"https://github.com/atharvbyadav/mastering-wsl","last_synced_at":"2026-02-08T00:32:12.467Z","repository":{"id":289219724,"uuid":"970502430","full_name":"atharvbyadav/Mastering-WSL","owner":"atharvbyadav","description":"A comprehensive guide to mastering Windows Subsystem for Linux (WSL) - from installation to advanced configuration. Perfect for developers and Linux enthusiasts looking to leverage WSL's power on Windows.","archived":false,"fork":false,"pushed_at":"2025-06-25T08:11:42.000Z","size":2311,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-30T04:36:25.880Z","etag":null,"topics":["linux-development","linux-on-windows-developer-tools","terminal-guide","windows-development","windows-subsystem-for-linux","wsl","wsl-guide","wsl2"],"latest_commit_sha":null,"homepage":"https://atharvbyadav.github.io/Mastering-WSL/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atharvbyadav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-22T05:42:05.000Z","updated_at":"2025-07-13T13:17:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"2871f9fd-eaed-4808-86c0-5e02ae6b7c4c","html_url":"https://github.com/atharvbyadav/Mastering-WSL","commit_stats":null,"previous_names":["atharvbyadav/mastering-wsl"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/atharvbyadav/Mastering-WSL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atharvbyadav%2FMastering-WSL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atharvbyadav%2FMastering-WSL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atharvbyadav%2FMastering-WSL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atharvbyadav%2FMastering-WSL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atharvbyadav","download_url":"https://codeload.github.com/atharvbyadav/Mastering-WSL/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atharvbyadav%2FMastering-WSL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29214394,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T00:10:47.190Z","status":"ssl_error","status_checked_at":"2026-02-08T00:10:43.589Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linux-development","linux-on-windows-developer-tools","terminal-guide","windows-development","windows-subsystem-for-linux","wsl","wsl-guide","wsl2"],"created_at":"2025-07-30T04:13:03.250Z","updated_at":"2026-02-08T00:32:12.453Z","avatar_url":"https://github.com/atharvbyadav.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Mastering WSL (Windows Subsystem for Linux)**\n*A Beginner-Friendly Guide to Using WSL on Windows*\n---\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/atharvbyadav/Mastering-WSL/main/banner.png\" alt=\"Mastering WSL\" width=\"600\" /\u003e\n\u003c/p\u003e\n\n## 🔗 **Repository**\n[**Mastering-WSL by @atharvbyadav**](https://github.com/atharvbyadav/Mastering-WSL)\n\n---\n\n## Table of Contents\n\n1. [Introduction \u0026 Getting Started](#part-1-introduction--getting-started)  \n2. [Managing WSL Distros \u0026 Configuration](#part-2-managing-wsl-distros-and-system-configuration)  \n3. [File Access, Interoperability \u0026 Advanced Tips](#part-3-interoperability-file-access--advanced-wsl-configuration)\n\n---\n\n## **Part 1: Introduction \u0026 Getting Started**\n\n### **What is WSL?**\nWSL (Windows Subsystem for Linux) is a compatibility layer developed by Microsoft that allows you to run a GNU/Linux environment directly on Windows—without the need for a traditional virtual machine or dual-boot setup.\n\nThis means you can run Linux commands, tools, and applications alongside your Windows software, all on the same computer.\n\n---\n\n### **Why Use WSL?**\n- Run **Linux development tools** (e.g., `bash`, `gcc`, `apt`, `git`) natively on Windows.\n- Use **both Windows and Linux applications** side-by-side.\n- Avoid using heavy virtual machines or dual-booting.\n- Ideal for web development, system administration, scripting, and learning Linux.\n\n---\n\n### **WSL Versions**\n- **WSL 1**: Lightweight and fast, but doesn't offer full system call compatibility.\n- **WSL 2**: Uses a real Linux kernel with better performance and compatibility (recommended).\n\n---\n\n## **Installing WSL (The Easy Way)**\n\n### **Step-by-Step Installation**\n#### For Windows 10 (2004+) or Windows 11:\n\n1. Open **PowerShell as Administrator**.\n2. Run the following command:\n   ```bash\n   wsl --install\n   ```\n   - This installs WSL and sets **WSL 2** as the default version.\n   - It also installs **Ubuntu** as the default Linux distribution.\n\n3. **Restart your computer** if prompted.\n4. On reboot, a terminal window will launch asking you to set up your **Linux username and password**.\n\n---\n\n### **Installing a Specific Linux Distro**\nIf you want a different distribution (like Debian, Kali Linux, etc.), run:\n```bash\nwsl --install -d \u003cDistroName\u003e\n```\n\n#### Example:\n```bash\nwsl --install -d Debian\n```\n\n---\n\n### **Checking Installed Distros**\n```bash\nwsl --list --online\n```\nThis shows all available distros you can install.\n\n---\n\n### **Switching Between WSL Versions**\nBy default, WSL uses version 2. To manually switch a distro's version:\n```bash\nwsl --set-version \u003cDistroName\u003e 2\n```\n\n#### Example:\n```bash\nwsl --set-version Ubuntu 2\n```\n\n---\n\n### **Setting Default Version for New Installs**\n```bash\nwsl --set-default-version 2\n```\n\n---\n\n## **Using WSL for the First Time**\nTo launch your installed Linux distro:\n```bash\nwsl\n```\n\nOr to launch a specific one:\n```bash\nwsl -d \u003cDistroName\u003e\n```\n\n---\n\n## **Useful First Commands (Inside WSL Terminal)**\n\n| Command | Description |\n|---------|-------------|\n| `ls` | Lists files in the current directory. |\n| `cd` | Changes directory. |\n| `pwd` | Prints the current directory path. |\n| `mkdir \u003cdir\u003e` | Creates a new directory. |\n| `sudo apt update \u0026\u0026 sudo apt upgrade` | Updates your Linux packages. |\n| `exit` | Exits the WSL terminal and returns to Windows. |\n\n---\n\n### **Accessing Windows Files from WSL**\nYour C: drive is mounted inside WSL at `/mnt/c`. You can access any file using:\n```bash\ncd /mnt/c/Users/\u003cYourWindowsUsername\u003e/\n```\n\n---\n\n### **Accessing WSL Files from Windows**\nOpen File Explorer and type:\n```\n\\\\wsl$\n```\nYou'll see all installed Linux distributions and their file systems.\n\n---\n\n# **Part 2: Managing WSL Distros and System Configuration**\n\nIn this section, you'll learn how to manage your installed Linux distributions on WSL and customize your setup. Perfect for keeping things clean, organized, and optimized!\n\n---\n\n## **1. Listing Installed Distros**\n\nTo see all the Linux distributions you have installed:\n\n```bash\nwsl --list\n```\nor\n```bash\nwsl -l\n```\n\n### Example Output:\n```\nWindows Subsystem for Linux Distributions:\nUbuntu (Default)\nDebian\nKali-Linux\n```\n\nTo see which ones are currently **running**:\n\n```bash\nwsl --list --running\n```\n\nTo see versions (WSL 1 or 2) of each installed distro:\n\n```bash\nwsl -l -v\n```\n\n---\n\n## **2. Setting a Default Distro**\n\nIf you use one distro more than others, make it the default:\n\n```bash\nwsl --set-default \u003cDistroName\u003e\n```\n\n### Example:\n```bash\nwsl --set-default Debian\n```\n\nNow, running just `wsl` will launch Debian.\n\n---\n\n## **3. Uninstalling a Distro**\n\nTo remove (unregister) a distro and **delete all its data**:\n\n```bash\nwsl --unregister \u003cDistroName\u003e\n```\n\n### Example:\n```bash\nwsl --unregister Ubuntu\n```\n\n\u003e **Warning:** This permanently deletes the Linux file system for that distro!\n\n---\n\n## **4. Exporting and Backing Up a Distro**\n\nTo create a backup of your entire Linux distro:\n\n```bash\nwsl --export \u003cDistroName\u003e \u003cPathToFile.tar\u003e\n```\n\n### Example:\n```bash\nwsl --export Ubuntu ubuntu-backup.tar\n```\n\nThis file can be stored and later restored.\n\n---\n\n## **5. Importing a Distro from Backup**\n\nTo import your saved distro to a new location:\n\n```bash\nwsl --import \u003cNewDistroName\u003e \u003cInstallLocation\u003e \u003cBackupFile.tar\u003e\n```\n\n### Example:\n```bash\nwsl --import UbuntuBackup C:\\WSL\\Ubuntu\\ ubuntu-backup.tar\n```\n\n---\n\n## **6. Changing WSL Version (1 or 2)**\n\nYou can choose which version each distro uses:\n\n```bash\nwsl --set-version \u003cDistroName\u003e \u003c1|2\u003e\n```\n\n### Example:\n```bash\nwsl --set-version Kali-Linux 2\n```\n\nTo set **WSL 2** as the default for all new installs:\n\n```bash\nwsl --set-default-version 2\n```\n\n---\n\n## **7. Shutting Down and Terminating**\n\n- **Shut down all WSL instances:**\n  ```bash\n  wsl --shutdown\n  ```\n\n- **Terminate a specific distro:**\n  ```bash\n  wsl --terminate \u003cDistroName\u003e\n  ```\n\nThis is useful if something hangs or you want to free up resources.\n\n---\n\n## **8. Checking System Configuration**\n\nRun this to see:\n- Default distro\n- Default version\n- Kernel version\n- Whether WSL is running\n\n```bash\nwsl --status\n```\n\n---\n\n## **9. Updating the WSL Kernel**\n\nMicrosoft occasionally updates the WSL 2 kernel. To update:\n\n```bash\nwsl --update\n```\n\nIf something breaks and you want to roll back:\n\n```bash\nwsl --update rollback\n```\n\n---\n\n## **10. Full Help Command**\n\nTo see everything WSL can do, use:\n\n```bash\nwsl --help\n```\n\nThis gives a list of all commands and options.\n\n---\n\nHere's **Part 3** of your complete WSL README guide — focused on **interoperability, file system access, and advanced configuration**.\n\n---\n\n# **Part 3: Interoperability, File Access \u0026 Advanced WSL Configuration**\n\n---\n\n## **1. Accessing Windows Files from Linux (WSL)**\n\nInside your WSL terminal, Windows drives are mounted under `/mnt/`.\n\n### Examples:\n| Action | Command |\n|--------|---------|\n| Navigate to `C:\\Users\\YourName\\Downloads` | `cd /mnt/c/Users/YourName/Downloads` |\n| List contents of D: drive | `ls /mnt/d` |\n\n---\n\n## **2. Accessing WSL Files from Windows**\n\nTo explore your WSL file system through Windows File Explorer:\n\n1. Press `Win + R`\n2. Type:  \n   ```\n   \\\\wsl$\n   ```\n3. Hit Enter\n\nThis opens a network-style view of all installed Linux distros. You can drag/drop files in and out from here.\n\n---\n\n## **3. Running Linux Commands from Windows (PowerShell or CMD)**\n\nYou can execute Linux commands directly from a Windows terminal using:\n\n```bash\nwsl \u003clinux-command\u003e\n```\n\n### Examples:\n```bash\nwsl ls -la\nwsl cat /etc/os-release\n```\n\nTo run a Linux command in a specific distro:\n```bash\nwsl -d \u003cDistroName\u003e \u003ccommand\u003e\n```\n\n---\n\n## **4. Running Windows Programs from Linux (WSL)**\n\nInside WSL, you can launch Windows apps using their `.exe` names.\n\n### Examples:\n```bash\nnotepad.exe\ncode.exe            # Opens VS Code\nexplorer.exe .      # Opens current directory in File Explorer\n```\n\nYou can also use Windows paths in commands, just prefix them with `/mnt/`:\n\n```bash\ncat /mnt/c/Users/YourName/Desktop/note.txt\n```\n\n---\n\n## **5. Advanced Configuration Files**\n\nWSL supports two config files for custom behavior:\n\n---\n\n### **A. Global Config: `.wslconfig`**\nLocation:  \n`C:\\Users\\\u003cYourWindowsUsername\u003e\\.wslconfig`\n\nThis file affects **all WSL 2** distributions.\n\n#### Example `.wslconfig`:\n```ini\n[wsl2]\nmemory=4GB\nprocessors=2\nswap=2GB\nlocalhostForwarding=true\n```\n\n| Option | Description |\n|--------|-------------|\n| `memory` | Max RAM WSL can use |\n| `processors` | Number of CPU cores |\n| `swap` | Swap file size |\n| `localhostForwarding` | Enables Windows to Linux networking |\n\n\u003e After editing this file, restart WSL:\n```bash\nwsl --shutdown\n```\n\n---\n\n### **B. Per-Distro Config: `wsl.conf`**\nLocation:  \nInside each distro at `/etc/wsl.conf`\n\n#### Example `wsl.conf`:\n```ini\n[automount]\nenabled = true\nroot = /mnt/\noptions = \"metadata,umask=22,fmask=11\"\n\n[network]\ngenerateResolvConf = false\n```\n\nThis file controls:\n- How drives are mounted\n- File permission behavior\n- Network settings\n\n\u003e Restart the WSL distro after editing this config.\n\n---\n\n## **6. Tips \u0026 Best Practices**\n\n- **Use WSL 2** unless you have specific needs for WSL 1.\n- **Keep backups** of your important Linux distros using `--export`.\n- Use **VS Code with WSL** (`code .`) for full-featured Linux dev on Windows.\n- Run `sudo apt update \u0026\u0026 sudo apt upgrade` frequently to keep Linux packages updated.\n- Avoid editing Linux files using Windows tools directly (use `/mnt/` instead).\n\n---\n\n## **7. Troubleshooting Common Issues**\n\n| Problem | Solution |\n|--------|----------|\n| WSL not launching | Restart computer or run `wsl --shutdown` |\n| File permission errors | Check mount options in `wsl.conf` |\n| Can't access Windows files | Try navigating to `/mnt/c/Users/` |\n| WSL commands not recognized | Make sure Windows features are enabled (see Part 1) |\n\n---\n\n## **Want More?**\n\n- [Official WSL Docs](https://learn.microsoft.com/en-us/windows/wsl/)\n- [WSL GitHub Repo](https://github.com/microsoft/WSL)\n- [WSL Issues \u0026 Discussions](https://github.com/microsoft/WSL/issues)\n\n---\n\n## **Conclusion**\n\nYou've now mastered:\n- Installing and launching WSL\n- Managing multiple distros\n- Running commands across Linux and Windows\n- Configuring WSL to match your system and workflow\n\nThis guide is made to be saved, starred and shared. Happy coding!\n\n---\n\n## Made with love for learners \u0026 devs.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatharvbyadav%2Fmastering-wsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatharvbyadav%2Fmastering-wsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatharvbyadav%2Fmastering-wsl/lists"}