Get AI summaries of any video or article — Sign up free
Linux on Windows......Windows on Linux thumbnail

Linux on Windows......Windows on Linux

NetworkChuck·
6 min read

Based on NetworkChuck's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.

TL;DR

Enable virtualization in BIOS/UEFI (Intel VTX or AMD-V) because WSL 2 runs lightweight virtual machines.

Briefing

WSL 2 turns a Windows PC into a multi-distro Linux workstation—running Ubuntu and Kali Linux side by side—while letting Linux and Windows commands, files, GUI apps, Docker containers, and even GPU access work together. The practical payoff is speed and convenience: install Linux once, then use Linux tooling (including security and networking utilities) without leaving Windows, and still reach Windows drives and apps from the Linux environment.

Getting there starts with requirements. WSL 2 needs a 64-bit processor (x86_64) and supports ARM, with at least 4GB of RAM recommended and 16GB suggested for a smoother experience. Virtualization must be enabled in BIOS/UEFI—Intel systems look for Intel VTX, while AMD systems look for AMD-V—because WSL 2 relies on lightweight virtual machines.

On the Windows side, Windows 11 is positioned as the best match, while Windows 10 remains supported only if it’s on build 19041 or higher. After confirming the Windows version, the install itself is straightforward: open Windows Terminal with admin privileges and run the single command `wsl --install`. That command enables the necessary platform service, installs the default Linux distribution (Ubuntu in this walkthrough), and then prompts a reboot. After restart, Linux asks for a username and password, and the user can enter and exit the environment using the terminal or `wsl -d <distro>`.

Adding more distros is done two ways: from the command line with `wsl --list --online` and `wsl --install <distro>`, or through the Microsoft Store for a smoother experience—especially for Kali Linux. Once both Ubuntu and Kali are running, Kali starts minimal, but `cali-tweaks` can install a curated set of tools (the transcript highlights “top 10 tools”).

A key theme is interoperability. From Linux, Windows commands can be invoked—`ipconfig` runs inside Linux, Windows Notepad can open files via an `.exe` call, and Windows Explorer can be launched with `explorer.exe .` to browse the current Linux directory. The reverse works too: in PowerShell, Windows `ipconfig` output can be piped into Linux commands like `grep` (invoked as `wsl grep ...`), and Linux file tools like `cat` can read files from the Windows side.

The walkthrough also demonstrates real tooling. SpiderFoot, an open-source OSINT tool, is installed and run inside WSL, then served via a local web server on port 5001 and accessed at `localhost:5001`. A scan against a named target returns personal data, underscoring how easily public and brokered information can be aggregated.

Beyond the command line, WSL 2 supports GUI apps through WSLG: installing and launching Wireshark from Ubuntu opens a graphical interface inside Windows. Kali also uses a Windows integration tool (Winex) to run full GUI apps. For development, VS Code connects to WSL directly via the WSL extension, and Docker can run containers inside WSL—either by installing Docker Engine from the terminal or using Docker Desktop configured to use WSL 2.

Finally, the transcript goes deeper into management and configuration. WSL commands can list distros, shut down all instances (`wsl --shutdown`), terminate a specific distro (`wsl --terminate <distro>`), set a default distro, and unregister (remove) a distro. It also shows how to access Windows drives from Linux (`/mnt/c/...`) and how to mirror networking mode by editing WSL config files—switching from NAT to mirrored mode and noting an “eight second rule” for changes to take effect. For portability, WSL instances can be backed up with `wsl --export` to a tar file and restored on another machine with `wsl --import`, including specifying the user on first connection.

Cornell Notes

WSL 2 lets Windows run real Linux environments (Ubuntu, Kali Linux, openSUSE Tumbleweed, and more) with tight integration: Linux and Windows commands can call each other, Linux can access Windows drives under `/mnt`, and Windows can browse Linux files via Explorer. WSLG enables Linux GUI apps (like Wireshark) to open as Windows-style windows, while VS Code can attach directly to WSL for a seamless dev workflow. Docker Desktop can use WSL 2 for container management, and GPU access is available from Linux via NVIDIA tooling (e.g., `nvidia-smi`). The setup hinges on enabling virtualization in BIOS and using Windows 11 (or Windows 10 build 19041+).

What prerequisites make WSL 2 work smoothly on a Windows machine?

WSL 2 requires virtualization enabled in BIOS/UEFI because it uses lightweight virtual machines. Intel systems should enable Intel VTX; AMD systems should enable AMD-V. Hardware-wise, it’s aimed at 64-bit processors (ARM supported too), with at least 4GB RAM recommended and 16GB or more suggested for better performance. On the OS side, Windows 11 is recommended; Windows 10 is supported only on build 19041 or higher.

How does someone install WSL 2 and enter Linux from Windows?

With admin privileges in Windows Terminal, run `wsl --install`. That command enables the virtual machine platform service, installs the default distro (Ubuntu in the walkthrough), and then requires a reboot. After restart, Linux prompts for a username and password. To run a distro again, use `wsl -d <distro>` (or `wsl -d Ubuntu`), and to exit, type `exit` or close the terminal window.

What are the two main ways to add additional Linux distributions like Kali Linux?

One method uses the command line: `wsl --list --online` shows available distros, then `wsl --install <distro>` installs one. The other method uses the Microsoft Store: search for Kali Linux in the Store and install from there, which then launches a terminal session that asks for a Linux username and password.

How do Linux and Windows interoperate for commands and files?

From Linux, Windows executables can be launched by calling `.exe` files—examples include running `ipconfig`, opening Notepad, and launching Windows Explorer with `explorer.exe .` to view the current Linux directory. From Windows PowerShell, Linux commands can be invoked by piping into `wsl`—for example, filtering `ipconfig` output with `wsl grep ...`. File access is bidirectional: Linux can browse Windows drives under `/mnt/c/...`, and Windows can access Linux locations via the Explorer sidebar locations for each distro.

What does WSLG add, and how does it change app usage?

WSLG enables Linux GUI apps to launch from the Linux command line and display as graphical windows inside the Windows desktop environment. The walkthrough installs Wireshark in Ubuntu and then runs `sudo wireshark` to bring up a GUI Wireshark window on Windows. It also shows Kali integration via Winex to get full GUI behavior in Kali.

How can WSL instances be managed, configured, and backed up?

Management commands include `wsl --list --verbose` (status), `wsl --shutdown` (stop everything), `wsl --terminate <distro>` (stop one), `wsl --set-default <distro>` (change default), and `wsl --unregister <distro>` (remove). Configuration can be done per-distro in `/etc/wsl.conf` (e.g., enabling systemd) and globally via a Windows-side WSL config file. Networking mode can be changed from NAT to mirrored mode by setting `networkingMode=mirrored`, and changes take effect after an “eight second rule.” Backups use `wsl --export <distro> <file.tar>` and restores use `wsl --import <name> <install-location> <file.tar>`, with the option to specify the user on first connect using `wsl -d <distro> -u <user>`.

Review Questions

  1. What BIOS/UEFI settings must be enabled for WSL 2, and why are they necessary?
  2. Describe two concrete examples of Linux-to-Windows and Windows-to-Linux command interoperability mentioned in the walkthrough.
  3. How would you back up an Ubuntu WSL instance and restore it on another machine using the export/import workflow?

Key Points

  1. 1

    Enable virtualization in BIOS/UEFI (Intel VTX or AMD-V) because WSL 2 runs lightweight virtual machines.

  2. 2

    Use Windows 11 for the smoothest experience; Windows 10 requires build 19041 or higher.

  3. 3

    Install WSL 2 quickly with `wsl --install`, then enter Linux via the default distro or `wsl -d <distro>`.

  4. 4

    Add distros either via `wsl --list --online` + `wsl --install <distro>` or through the Microsoft Store for a simpler Kali Linux setup.

  5. 5

    Use WSLG to run Linux GUI apps on the Windows desktop, and use VS Code’s WSL extension to attach directly to WSL files and terminals.

  6. 6

    Leverage interoperability: call Windows `.exe` from Linux (e.g., `ipconfig`, `notepad.exe`, `explorer.exe`) and invoke Linux tools from PowerShell using `wsl` in pipelines.

  7. 7

    Manage and protect your environments with WSL commands (shutdown/terminate/unregister) and backups using `wsl --export` and `wsl --import` tar files.

Highlights

WSL 2 enables Ubuntu and Kali Linux to run side by side on the same Windows machine, with shared access to files and commands.
Linux GUI apps can open as Windows GUI windows via WSLG—Wireshark is launched from Ubuntu and appears graphically on Windows.
SpiderFoot can run inside WSL and serve a web interface on `localhost:5001`, demonstrating how OSINT tooling works with minimal friction.
Switching WSL networking from NAT to mirrored mode can align WSL networking with the local LAN, but changes require waiting for the documented “eight second rule.”
WSL instances can be exported to tar files and imported onto another machine, preserving a configured environment like Ubuntu or Kali.

Topics

  • WSL 2 Setup
  • Kali Linux Tools
  • WSL Interoperability
  • WSLG GUI Apps
  • Docker on WSL
  • WSL Networking
  • WSL Backup/Restore

Mentioned

  • WSL
  • WSL 2
  • UAC
  • OSINT
  • GUI
  • GPU
  • NAT
  • VS Code
  • NAS
  • IP
  • GUI