MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Run Linux on Windows with WSL

Diagram of VS Code on Windows connecting to VS Code Server in WSL via exposed port and /mnt/c mount

Windows Subsystem for Linux (WSL)

WSL, or Windows Subsystem for Linux, is a compatibility layer provided by Microsoft for Windows 10 and Windows Server that allows running Linux distributions natively on Windows without the need for virtual machines or dual-boot setups. It provides a way to run Linux command-line tools, utilities, and applications directly on a Windows system.

WSL consists of two distinct versions: WSL 1 and WSL 2.

WSL 1:

This version uses a translation layer to convert Linux system calls into Windows system calls, allowing Linux binaries to run on Windows. It provides good compatibility and allows you to run many Linux tools. However, it has limitations in terms of performance and full compatibility with Linux kernel features.

WSL 2:

This version introduced a more advanced architecture. It includes a lightweight virtual machine running a full Linux kernel. This allows for better performance, improved compatibility with Linux system calls, and support for features like Docker containers. WSL 2 provides a more complete Linux experience within Windows.

With WSL installed, you can choose and install Linux distributions directly from the Microsoft Store, including popular options like Ubuntu, Debian, Fedora, and more. Once a Linux distribution is installed, you can launch it from the Start menu or command line and access a Linux shell environment, where you can use Linux tools, run scripts, and even install and use development frameworks and applications.

WSL has been well-received by developers, as it allows them to work seamlessly across different platforms and leverage the power of both Windows and Linux environments simultaneously.

How to install WSL in windows?

To install Windows Subsystem for Linux (WSL) on Windows 10, you can follow these steps:

  1. Open the Start menu and search for “PowerShell.”
  2. Right-click on “Windows PowerShell” and select “Run as administrator.” This will open an elevated PowerShell window.

Note: If you’re using Windows 11, you can search for “Windows Terminal” instead and launch it as an administrator.

PowerShell command wsl --install, which enables required components and prompts a restart
  1. In the PowerShell window, run the following command to enable the Windows Subsystem for Linux feature:
  2. After restarting, open the Microsoft Store by searching for it in the Start menu.
  3. In the Microsoft Store, search for the Linux distribution you want to install, such as Ubuntu, Debian, or Fedora.
  4. Select the desired Linux distribution and click on the “Install” button.
  5. Wait for the installation to complete. It may take some time depending on your internet connection speed.
  6. Once the installation is finished, launch the installed Linux distribution from the Start menu or by searching for its name.
  7. The first time you launch the Linux distribution, it will initialize and ask you to create a new user account and password. Follow the prompts to set up the user account.
WSL2 architecture diagram: Linux utility VM and Windows NT kernel both running on a hypervisor
WSL 2 architecture overview: lightweight Linux utility VM beside Windows NT kernel on the hypervisor

To use WSL, you need to enable it on your Windows system. Here’s a general outline of the steps to set up WSL:

  1. Open the Start menu, search for “Turn Windows features on or off,” and open it.
  2. Scroll down and locate “Windows Subsystem for Linux.”
  3. Check the box next to “Windows Subsystem for Linux” and click “OK.”
  4. Windows will apply the changes and may ask you to restart your computer.

Once you have enabled WSL, you can install a Linux distribution from the Microsoft Store or by using the command line. Here’s how you can install Ubuntu from the Microsoft Store:

  1. Open the Microsoft Store.
  2. Search for “Ubuntu” and select the desired Ubuntu distribution.
  3. Click the “Install” button to download and install Ubuntu.

How to Configure WSL for SSH use?

Enabled SSHD for login from remote

$ sudo systemctl enable ssh
$ sudo service ssh restart

Enabled Password based authentication

$ vi /etc/ssh/sshd_config

Sshd_config in WSL Ubuntu with PasswordAuthentication set to yes
$ sudo service ssh restart

What are the things you can do in Linux created with a help of WSL

When using Ubuntu through Windows Subsystem for Linux (WSL), you can perform various tasks and utilize a wide range of tools and applications available in the Ubuntu ecosystem. Here are some common things you can do in Ubuntu on WSL:

  1. Run Linux Commands: You can execute Linux commands and utilities directly from the Ubuntu terminal on WSL, just like you would on a regular Linux system.
  2. Install Packages: Ubuntu on WSL allows you to use the APT package manager to install, update, and manage software packages. You can install development tools, programming languages, web servers, databases, and other applications using APT.
  3. Develop and Program: WSL provides a convenient environment for software development. You can write and compile code in programming languages like Python, Java, C++, or JavaScript. Integrated development environments (IDEs) like Visual Studio Code and command-line text editors like Vim or Emacs are available for use.
  4. Access File System: Ubuntu on WSL provides access to the Windows file system, allowing you to work with files and directories seamlessly. You can navigate, create, edit, and delete files using the Ubuntu terminal or graphical file managers like Nautilus.
  5. Network Tools: Ubuntu on WSL includes various network utilities and tools. You can use commands like ping, wget, curl, and ssh to test connectivity, download files, and establish secure shell connections.
  6. Web Development: With Ubuntu on WSL, you can set up a local web development environment. Install web servers like Apache or Nginx, configure databases like MySQL or PostgreSQL, and develop web applications using frameworks like Node.js or Django.
  7. Version Control: Git, a popular version control system, is available in Ubuntu on WSL. You can use Git to track changes in your projects, create branches, and collaborate with other developers using platforms like GitHub or GitLab.
  8. Run Linux Applications: Ubuntu on WSL supports running Linux graphical applications. You can install and launch applications that have a graphical user interface (GUI) using an X server like X410 or VcXsrv.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

How to login linux server using ssh?

You log in to a Linux server over SSH by running ssh username@server-ip from an SSH client, then proving who you are with either a password or…

Read More

Wetty – How to Install & Access Wetty (Web-based SSH) on AWS EC2 linux to access using browser

Wetty is a web-based terminal. It runs a small Node.js server that opens an SSH session and streams it to your browser over WebSockets, so you can…

Read More

Complete Tutorial: Use Two GitHub Accounts on One Mac with SSH

This tutorial explains how to configure two GitHub accounts on the same MacBook using separate SSH keys, without repeatedly switching accounts or breaking your existing Git configuration….

Read More

Development Workflows with an FTP and SFTP Client for Mac: From Local Files to Staging

An FTP and SFTP client for Mac is best suited when it displays the project that you are working on in one window and the remote server…

Read More

Linux Commands and Shell Scripting Reference for Linux Admins and DevOps Engineers

A structured Linux command and shell scripting reference for operations and DevOps work, rebuilt from the original link collection. It includes a practical learning workflow, command comparison tables, ready-to-use examples, and curated source links.

Read More

SSH Passwordless Login with ssh-keygen and ssh-copy-id (Step-by-Step)

Learn how to configure SSH key-based authentication so you can log in without typing the remote account password each time. This updated guide covers setup, verification, ssh-agent usage, and safe hardening options.

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x