DEV Community

Cover image for Run a Full Linux Desktop on Windows Without Dual-Booting (WSL2 Guide)
Abdullah Musa
Abdullah Musa

Posted on • Originally published at musabase.com

Run a Full Linux Desktop on Windows Without Dual-Booting (WSL2 Guide)

For years I thought my only options were dual booting or using a clunky virtual machine. Dual boot meant constant reboots, and VirtualBox ate my RAM. Then I discovered Windows Subsystem for Linux 2, and honestly it changed how I work.

Now I run a complete Ubuntu desktop right next to my Windows applications. I can code in a native Linux environment, test web servers, and even fire up Linux-only GUI tools without ever leaving my main OS. Let me walk you through why WSL matters and how to set it up, including a full desktop environment.

Why Do We Need WSL on Windows?

WSL isn’t just a novelty. It solves real problems for developers and tinkerers.

First, a lot of modern development tooling assumes you’re on Linux. Servers run Linux. CI/CD pipelines run Linux. Containers are built on Linux kernel features. On plain Windows you’re constantly fighting path differences, missing packages, and subtle bugs that don’t appear in production. WSL gives you an actual Linux kernel running inside Windows, so your local environment matches your deployment target.

Second, performance. WSL1 used a translation layer that worked but got slow with heavy file operations. WSL2 runs a lightweight virtual machine with a real Linux kernel. I saw my npm install times drop significantly after switching. It also supports systemd, Docker, and even GPU acceleration for machine learning tasks. You get the speed of bare metal without the resource overhead of VirtualBox.

Third, it’s seamless. You can access your Windows files from Linux and vice versa. You can run VS Code on Windows with a remote connection to your WSL instance. You can copy files between the two with a simple /mnt/c/ path. No shared folders to configure, no network bridges to set up.

And if you add a desktop environment, you gain a visual workspace for things like GIMP, Krita, or browser testing, all integrated neatly into your Windows desktop. It’s the best of both worlds, and once you use it, going back feels like a step backward.

Getting WSL2 Up and Running

The installation is almost too easy now. On Windows 10 version 2004 or later, or Windows 11, you need just a couple of commands.

First, enable the necessary Windows features. Open PowerShell as Administrator and run these two lines. They turn on the subsystem and the virtual machine platform.

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /noresta
Enter fullscreen mode Exit fullscreen mode

Enabling WSL features from Powershell on Windows 11
Restart your PC. Then open PowerShell as Admin again and type:

wsl --install
Enter fullscreen mode Exit fullscreen mode

That’s it. This one command downloads the Linux kernel, sets WSL2 as your default, and installs Ubuntu. After another reboot, you’ll find an Ubuntu shortcut in your Start menu. Launch it and you’ll be asked to create a username and password. You’re now inside a minimal Ubuntu terminal running on Windows.

From here you can run sudo apt update and install any CLI tool you like. But what if you want a graphical desktop?

Adding a Full Desktop Environment

WSL2 is headless by default. It has no display server, so GUI apps can’t draw anything. We can solve that by using an X server on Windows.
I prefer this approach because Linux apps appear as normal windows on your desktop. You need an X server for Windows; I use VcXsrv, which is free and reliable.

First, inside your Ubuntu terminal, install the GNOME desktop.

sudo apt update
sudo apt install ubuntu-desktop gnome
Enter fullscreen mode Exit fullscreen mode

Now comes a critical fix most guides skip. The acpid package handles ACPI events like power button presses. WSL2 doesn’t have that hardware, so if acpid gets installed or upgraded later, it will flood your logs with errors and crash the desktop session. Hold it so it never gets installed.

sudo apt-mark hold acpid
Enter fullscreen mode Exit fullscreen mode

Next, enable systemd. Edit the WSL config file with sudo nano /etc/wsl.conf and add:

[boot]
systemd=true
Enter fullscreen mode Exit fullscreen mode

Enabling Systemd for Desktop session on WSL on Windows 11
Save and exit. Then shut down WSL from PowerShell using wsl --shutdown so the change applies.

We also need to create a runtime directory for user services and point the DISPLAY variable to our X server. Add these lines to your ~/.bashrc file.

export DISPLAY="$(ip route | awk '{print $3; exit}')":0
export XDG_RUNTIME_DIR="/run/user/1000"
Enter fullscreen mode Exit fullscreen mode

Now create that directory and set the right ownership.

sudo mkdir -p /run/user/1000
sudo chmod 700 /run/user/1000
sudo chown $(whoami): /run/user/1000
Enter fullscreen mode Exit fullscreen mode

Making directory and giving user ownershup for desktop session on WSL

You’re almost there. Launch VcXsrv from the Start menu (search for XLaunch). Choose "One large window" or "Fullscreen", then "Start no client". On the extra settings screen, tick all boxes and add -dpms in the additional parameters. Click Finish, and a black screen appears.

Back in your WSL terminal, start the desktop.

dbus-launch --exit-with-session gnome-session
Enter fullscreen mode Exit fullscreen mode

GNOME Desktop session on WSL

Your Ubuntu desktop will fill the VcXsrv window. You can resize it, move it around, and use Linux GUI apps alongside Windows programs seamlessly.

What I’ve Learned From Using This Daily

The desktop environment does work, but I’ll be honest: it’s clunky and a bit slow compared to a traditional virtual machine. That’s not the point of WSL, though. WSL was built to give you a bare‑minimum Linux system for running and testing applications and code, all without leaving Windows or dual booting. The desktop is a bonus, not the main event.

The acpid hold trick saved me hours of debugging early on. Before I knew about it, my GNOME session kept crashing after a package update, and the logs were nothing but acpid error loops. Now I mark that package on hold every time I set up a new WSL instance. It’s one of those tiny fixes you only discover by breaking things.

With or without a desktop. You can run Docker, code in Python or Node, and test websites, all while keeping your Windows comfort zone intact.

For a full walkthrough with every screenshot, detailed VcXsrv configuration, and alternative desktop options, check out my complete guide on MusaBase: How to Install a Linux Distribution on Windows 10/11 with WSL and WSL2
. I go deeper into each step and show exactly what you should see on screen.

Hope this helps you stop dual booting and start doing more actual work. Give it a try and let me know how it goes.

Top comments (0)