Wednesday, 10 June 2026

Windows Subsystem for Linux (WSL)

Windows Subsystem for Linux (WSL) is a feature of Windows that allows you to run a Linux environment directly on Windows without installing a separate virtual machine or dual-booting your computer.

WSL enables developers, system administrators, and DBAs to use Linux command-line tools, scripts, and applications alongside Windows.

Why Use WSL?

WSL allows you to:

  • Run Linux distributions such as Ubuntu, Debian, and Oracle Linux.
  • Use Linux commands and shell scripting.
  • Install development tools (Git, Python, Java, Node.js).
  • Manage databases such as PostgreSQL and MySQL.
  • Run automation scripts.
  • Access Windows files from Linux and vice versa.

For Oracle DBAs and EBS administrators, WSL is useful for learning Linux administration, shell scripting, automation, Ansible, Git, and database tools without needing a dedicated Linux server.

WSL Architecture

WSL 1

  • Translates Linux system calls into Windows system calls.
  • Lower resource consumption.
  • Faster access to Windows files.
  • Limited compatibility.

WSL 2

  • Uses a real Linux kernel.
  • Better performance and compatibility.
  • Supports Docker and containerized applications.
  • Recommended for most users.

Prerequisites

  • Windows 10 (Version 2004+) or Windows 11
  • Administrator privileges
  • Virtualization enabled in BIOS

Check virtualization: Open Windows PowerShell

Windows PowerShell

Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\USER>systeminfo

Install WSL2 (Windows Subsystem for Linux) - Recommended

Open PowerShell as Administrator and run:

PS C:\Users\USER> wsl Windows Subsystem for Linux must be updated to the latest version to proceed. You can update by running 'wsl.exe --update'. For more information please visit https://aka.ms/wslinstall Press any key to install Windows Subsystem for Linux. Press CTRL-C or close this window to cancel. This prompt will time out in 60 seconds. The requested operation requires elevation. Downloading: Windows Subsystem for Linux 2.7.3 Installing: Windows Subsystem for Linux 2.7.3 Windows Subsystem for Linux 2.7.3 has been installed. The operation completed successfully. Windows Subsystem for Linux has no installed distributions. You can resolve this by installing a distribution with the instructions below: Use 'wsl.exe --list --online' to list available distributions and 'wsl.exe --install <Distro>' to install.

PS C:\Users\USER> wsl.exe --list --online The following is a list of valid distributions that can be installed. Install using 'wsl.exe --install <Distro>'. NAME FRIENDLY NAME Ubuntu Ubuntu Ubuntu-26.04 Ubuntu 26.04 LTS Ubuntu-24.04 Ubuntu 24.04 LTS Ubuntu-22.04 Ubuntu 22.04 LTS openSUSE-Tumbleweed openSUSE Tumbleweed openSUSE-Leap-16.0 openSUSE Leap 16.0 SUSE-Linux-Enterprise-15-SP7 SUSE Linux Enterprise 15 SP7 SUSE-Linux-Enterprise-16.0 SUSE Linux Enterprise 16.0 kali-linux Kali Linux Rolling Debian Debian GNU/Linux AlmaLinux-8 AlmaLinux OS 8 AlmaLinux-9 AlmaLinux OS 9 AlmaLinux-Kitten-10 AlmaLinux OS Kitten 10 AlmaLinux-10 AlmaLinux OS 10 archlinux Arch Linux FedoraLinux-44 Fedora Linux 44 FedoraLinux-43 Fedora Linux 43 eLxr eLxr 12.12.0.0 GNU/Linux OracleLinux_7_9 Oracle Linux 7.9 OracleLinux_8_10 Oracle Linux 8.10 OracleLinux_9_5 Oracle Linux 9.5 SUSE-Linux-Enterprise-15-SP6 SUSE Linux Enterprise 15 SP6

PS C:\Users\USER> wsl.exe --install Ubuntu-26.04 Downloading: Ubuntu 26.04 LTS Installing: Ubuntu 26.04 LTS Distribution successfully installed. It can be launched via 'wsl.exe -d Ubuntu-26.04' Launching Ubuntu-26.04... Provisioning the new WSL instance Ubuntu-26.04 This might take a while... Create a default Unix user account: ubuntu New password: Retype new password: passwd: password updated successfully usermod: no changes Help improve Ubuntu! Help us improve Ubuntu features and compatibility by sharing system reports with Canonical. Reports are sent anonymously and do not contain any personal data. For legal details, please visit: https://ubuntu.com/legal/systems-information-notice We will save your answer to Windows and will only ask you once. Would you like to opt-in to platform metrics collection (Y/n)? To see an example of the data collected, enter 'e'. [Y/n/e]: n

Verify Installation

After reboot:

PS C:\Users\USER> wsl --version WSL version: 2.7.3.0 Kernel version: 6.6.114.1-1 WSLg version: 1.0.73 MSRDC version: 1.2.6676 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.26100.1-240331-1435.ge-release Windows version: 10.0.26200.8457

PS C:\Users\USER> wsl --status

Default Distribution: Ubuntu-26.04 Default Version: 2

Check installed distributions:

PS C:\Users\USER> wsl -l -v NAME STATE VERSION * Ubuntu-26.04 Running 2

Start Linux

PS C:\Users\USER> wsl

ubuntu@Amit-Gupta:/mnt/c/Users/USER$ sudo apt update [sudo: authenticate] Password: Get:1 http://security.ubuntu.com/ubuntu resolute-security InRelease [137 kB] Get:2 http://archive.ubuntu.com/ubuntu resolute InRelease [136 kB] Get:3 http://security.ubuntu.com/ubuntu resolute-security/main amd64 Packages [201 kB] Get:4 http://security.ubuntu.com/ubuntu resolute-security/main Translation-en [54.0 kB] Get:5 http://security.ubuntu.com/ubuntu resolute-security/main amd64 Components [31.1 kB] Get:6 http://security.ubuntu.com/ubuntu resolute-security/main amd64 c-n-f Metadata [3312 B] Get:7 http://security.ubuntu.com/ubuntu resolute-security/universe amd64 Packages [103 kB] Get:8 http://security.ubuntu.com/ubuntu resolute-security/universe Translation-en [32.1 kB] Get:9 http://security.ubuntu.com/ubuntu resolute-security/universe amd64 Components [42.8 kB] Get:10 http://security.ubuntu.com/ubuntu resolute-security/universe amd64 c-n-f Metadata [2788 B] Get:11 http://security.ubuntu.com/ubuntu resolute-security/restricted amd64 Packages [201 kB] Get:12 http://security.ubuntu.com/ubuntu resolute-security/restricted Translation-en [35.1 kB] Get:13 http://security.ubuntu.com/ubuntu resolute-security/restricted amd64 c-n-f Metadata [396 B] Get:14 http://security.ubuntu.com/ubuntu resolute-security/multiverse amd64 Components [212 B] Get:15 http://security.ubuntu.com/ubuntu resolute-security/multiverse amd64 c-n-f Metadata [120 B] Get:16 http://archive.ubuntu.com/ubuntu resolute-updates InRelease [137 kB] Get:17 http://archive.ubuntu.com/ubuntu resolute-backports InRelease [136 kB] Get:18 http://archive.ubuntu.com/ubuntu resolute/main amd64 Packages [1480 kB] Get:19 http://archive.ubuntu.com/ubuntu resolute/main Translation-en [524 kB] Get:20 http://archive.ubuntu.com/ubuntu resolute/main amd64 Components [395 kB] Get:21 http://archive.ubuntu.com/ubuntu resolute/main amd64 c-n-f Metadata [32.4 kB] Get:22 http://archive.ubuntu.com/ubuntu resolute/universe amd64 Packages [16.0 MB] Get:23 http://archive.ubuntu.com/ubuntu resolute/universe Translation-en [6329 kB] Get:24 http://archive.ubuntu.com/ubuntu resolute/universe amd64 Components [4556 kB] Get:25 http://archive.ubuntu.com/ubuntu resolute/universe amd64 c-n-f Metadata [313 kB] Get:26 http://archive.ubuntu.com/ubuntu resolute/restricted amd64 Packages [152 kB] Get:27 http://archive.ubuntu.com/ubuntu resolute/restricted Translation-en [25.8 kB] Get:28 http://archive.ubuntu.com/ubuntu resolute/restricted amd64 Components [556 B] Get:29 http://archive.ubuntu.com/ubuntu resolute/multiverse amd64 Packages [290 kB] Get:30 http://archive.ubuntu.com/ubuntu resolute/multiverse Translation-en [127 kB] Get:31 http://archive.ubuntu.com/ubuntu resolute/multiverse amd64 Components [50.0 kB] Get:32 http://archive.ubuntu.com/ubuntu resolute/multiverse amd64 c-n-f Metadata [8276 B] Get:33 http://archive.ubuntu.com/ubuntu resolute-updates/main amd64 Packages [208 kB] Get:34 http://archive.ubuntu.com/ubuntu resolute-updates/main Translation-en [55.8 kB] Get:35 http://archive.ubuntu.com/ubuntu resolute-updates/main amd64 Components [37.2 kB] Get:36 http://archive.ubuntu.com/ubuntu resolute-updates/main amd64 c-n-f Metadata [3428 B] Get:37 http://archive.ubuntu.com/ubuntu resolute-updates/universe amd64 Packages [107 kB] Get:38 http://archive.ubuntu.com/ubuntu resolute-updates/universe Translation-en [33.4 kB] Get:39 http://archive.ubuntu.com/ubuntu resolute-updates/universe amd64 Components [49.0 kB] Get:40 http://archive.ubuntu.com/ubuntu resolute-updates/universe amd64 c-n-f Metadata [2676 B] Get:41 http://archive.ubuntu.com/ubuntu resolute-updates/restricted amd64 Packages [201 kB] Get:42 http://archive.ubuntu.com/ubuntu resolute-updates/restricted Translation-en [35.1 kB] Get:43 http://archive.ubuntu.com/ubuntu resolute-updates/restricted amd64 c-n-f Metadata [392 B] Get:44 http://archive.ubuntu.com/ubuntu resolute-updates/multiverse amd64 Packages [3328 B] Get:45 http://archive.ubuntu.com/ubuntu resolute-updates/multiverse Translation-en [772 B] Get:46 http://archive.ubuntu.com/ubuntu resolute-updates/multiverse amd64 Components [216 B] Get:47 http://archive.ubuntu.com/ubuntu resolute-updates/multiverse amd64 c-n-f Metadata [256 B] Get:48 http://archive.ubuntu.com/ubuntu resolute-backports/main amd64 Components [212 B] Get:49 http://archive.ubuntu.com/ubuntu resolute-backports/main amd64 c-n-f Metadata [112 B] Get:50 http://archive.ubuntu.com/ubuntu resolute-backports/universe amd64 Components [216 B] Get:51 http://archive.ubuntu.com/ubuntu resolute-backports/universe amd64 c-n-f Metadata [116 B] Get:52 http://archive.ubuntu.com/ubuntu resolute-backports/restricted amd64 Components [216 B] Get:53 http://archive.ubuntu.com/ubuntu resolute-backports/restricted amd64 c-n-f Metadata [120 B] Get:54 http://archive.ubuntu.com/ubuntu resolute-backports/multiverse amd64 Components [216 B] Get:55 http://archive.ubuntu.com/ubuntu resolute-backports/multiverse amd64 c-n-f Metadata [120 B] Fetched 32.2 MB in 6s (5033 kB/s) 34 packages can be upgraded. Run 'apt list --upgradable' to see them.

ubuntu@Amit-Gupta:/mnt/c/Users/NICSI$ cd

ubuntu@Amit-Gupta:~$ sudo su -

                                    OR

ubuntu@Amit-Gupta:/mnt/c/Users/USER$ sudo su - (Switch to root User) Welcome to Ubuntu 26.04 LTS (GNU/Linux 6.6.114.1-microsoft-standard-WSL2 x86_64) * Documentation: https://docs.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/pro System information as of Tue Jun 9 10:27:27 UTC 2026 System load: 0.06 Processes: 37 Usage of /: 0.1% of 1006.85GB Users logged in: 0 Memory usage: 6% IPv4 address for eth0: 172.29.53.113 Swap usage: 0% This message is shown once a day. To disable it please create the /root/.hushlogin file. root@Amit-Gupta:~#

Access Windows Files from Linux

Windows C: drive appears as:

root@Amit-Gupta:~# cd /mnt/c

root@Amit-Gupta:~# cd /mnt/c/Users
root@Amit-Gupta:~# ls

Access Linux Files from Windows

Linux files are stored under:

\\wsl$\

Open File Explorer(Win + E) and enter:

\\wsl$\

No comments:

Post a Comment