About

As of March 2018 Debian is available for Windows users through the Windows store as an app for the Windows Subsystem for Linux (WSL).

The app gives you a Debian stable command line environment running on the Windows kernel (WSL1) or Hyper-V with the new WSL 2 interface depending on your Windows 10 release version. Most of the packages in Debian stable should "just work".

Install

To use the store app you have to enable the WSL subsystem first by following the guide.

Afterwards just install the Debian app from the Microsoft Store.

You will be asked to define a user and password upon first start. This user will also be given sudo rights.

There is a way to install the Debian WSL distro offline & without using Microsoft Market.

Further information about the ongoing development of WSL can be found in the WSL tag of the Microsoft blog.

WSL 2 with systemd support

Microsoft partnered with Canonical to bring systemd support to WSL 2, and it is also available for Debian and other GNU/Linux distributions.

WSL 2 with systemd is probably what you want for your freshly installed Debian GNU/Linux system, as WSL 2 is a prerequisite for GUI application support, and systemd is a prerequisite for many Debian packages. Read more about GUI apps here.

At the time of this writing, 2024-06-28, the documentation over at Microsoft Learn for acieving a Debian install in a WSL 2 subsystem with systemd activated is rather fragmented. Therefore the process is detailed here.

Lengtly description follows here:

To prepare your system:

  1. Make sure your computer has the Virtualization features enabled in UEFI Settings (some may refer to this as BIOS Settings).
  2. Activate and install the needed features and software on your Windows host OS. Open PowerShell in Administrator mode and type these commands:

     dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
     dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
  3. Reboot your Windows 11 host
  4. Update your WSL Linux kernel update package. Open PowerShell in administrator mode and enter the ffollowing command

     wsl.exe --update
    • This will install and update WSL from Microsoft Store
    • If you do dot wish or cannot use Microsoft Store, please consult this Microsoft Learn article

To install Debian GNU/Linux

  1. Giong forward we are in usermode. So you must open normal PowerShell without administrator mode for the steps in this section.

  2. Set WSL 2 as you default WSL version. This is a per-user setting in Windows.
     wsl --set-default-version 2
  3. Install Debian
     wsl --install -d Debian
    • This takes some time
  4. Set a username and password for your Debian GNU/Linux installation when prompted

    • You are now logged in to your Debian system in command line mode
  5. Add some text to the file /etc/wsl.conf to activate systemd mode on next boot of WSL 2

     sudo echo '
     [boot]
     systemd=true' >> /etc/wsl.conf
    Provide the user password you set in the previous step when prompted.
  6. Verify the content of the file /etc/wsl.conf and correct any errrors. There should be only one section [boot] and exactly one instance of the line systemd=true in it.

     sudo editor /etc/wsl.conf
  7. Exit to PowerShell by issuing the command logout, or by pressing [Ctrl] + D

  8. Shut down your Debian WSL 2 instance from PowerShell

     wsl --shutdown -d Debian
  9. Start your Debian instance and log back in
     wsl -d Debian -u <username>
  10. Use apt to upgrade your WSL 2 Debian and apt or aptitude to install some packages (mesa-utils is required on the Debian side for the GUI apps integration to work)

     sudo apt update
     sudo apt upgrade
     sudo apt install aptitude
     sudo aptitude install mesa-utils firefox-esr-l10n-nb-no
  11. The installed programs can be started from a Debian shell, or from the Windows start menu.

Advanced Usage

WSL 2 brings GUI application and sytemd support to WSL. That is, you now can run Debian apps in an integrated desktop mode.

To activate the new GUI application support you have to update your WSL 2 environment to Debian bookworm or later.

After that you need to install mesa-utils this will install all the necessary packages for th GUI app support to work.

Most of the GUI apps in Debian should now just work out-of-the-box (e.g., try firefox).

Feedback

Please use the Microsoft Store review/feedback to report bugs or feature requests for now.

There is a IRC channel on OFTC to discuss WSL related stuff: #debian-wsl

You can also leave patches and issues at the WSL repo on Salsa.

Known Issues

Any software relying on systemd or low-level hardware accessibility might fail due to missing support from the current Windows kernel or virtualization interface.

systemd support has been added to WSL 2. See description of this above.

As WSL is a pretty new project from Microsoft improvement can be expected to happen with every new Windows stable channel release (approx. every 6 months). The app launcher will be updated to support stable release features continuously.

If WSL itself is installed from Microsoft Store, for example by issuing wsl --update in an elevated PowerShell prompt on the Windows Host, Microsoft claims WSL will be updated more frequently and independently of the Windows stable chanel releases.

FAQ

How do I keep my Debian environment up-to-date

as with any other Debian installation use apt/apt-get to install and update software from the official Debian mirrors (e.g., apt update && apt dist-upgrade)

How do I install a newer release?
You can install the app, change your sources.list and upgrade your install as with every other Debian installation.
How many people are using Debian via WSL?
Approximately 1,746,662 at last count (unique installs according to the Microsoft Partner Center dashboard 2024-11-20).

Code & Issues

The full app code and all build dependencies can be found in the WSL repo on salsa.