Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Run Ubuntu Desktop on Windows 10

· 4 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can run the native Ubuntu desktop on Windows 10 using the Windows Subsystem for Linux (WSL) with a graphical interface. This setup allows you to use Ubuntu's full desktop environment—including its window manager, applications, and tools—directly on Windows without dual-booting or using a virtual machine. It requires enabling WSL, installing a Linux distribution, and adding a display server to support GUI apps.

What You'll Need

  • Windows 10 version 2004 or higher (Build 19041 or later)
  • Administrator access on your Windows machine
  • An active internet connection
  • At least 5 GB of free disk space (more recommended for full desktop use)
  • A compatible graphics driver that supports WSLg or a third-party X server

Step-by-Step

  1. Open PowerShell as Administrator: Press Start, search for PowerShell, right-click it, and select "Run as administrator".
  2. Enable WSL by running this command: wsl --install. This command automatically enables the required features (Virtual Machine Platform and WSL), downloads Ubuntu as the default distribution, and installs it.
  3. If your system does not support wsl --install, manually enable the features by running:
    dism.exe /online /enable-feature /featurename:Microsoft-WSL /all /norestart
    dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
    Then restart your computer.
  4. Set WSL 2 as the default version. After restart, open PowerShell as admin and run: wsl --set-default-version 2.
  5. Install Ubuntu from the Microsoft Store. Open the Microsoft Store, search for "Ubuntu", and install the official "Ubuntu" app (published by Canonical). Launch it after installation.
  6. Complete the Ubuntu setup: The first launch prompts you to create a username and password. These are separate from your Windows credentials and are used within the Linux environment.
  7. Update the Ubuntu system: Once logged in, run sudo apt update && sudo apt upgrade -y to ensure all packages are current.
  8. Install a desktop environment. Run:
    sudo apt install ubuntu-desktop-minimal -y
    This installs a lightweight version of the Ubuntu desktop. For a full desktop, use ubuntu-desktop instead.
  9. Install a display server. WSLg (Windows Subsystem for Linux GUI) is included in Windows 11 and newer Windows 10 builds. If not available, install an X server like VcXsrv. Download VcXsrv from its official site, install it, and launch XLaunch. Choose "Multiple windows", set display number to 0, and enable "Disable access control".
  10. Configure Ubuntu to use the X server. In Ubuntu, run:
    echo "export DISPLAY=:0" >> ~/.bashrc
    source ~/.bashrc
    This tells Linux apps where to display their windows.
  11. Start the Ubuntu desktop. Run:
    sudo service dbus start
    startplasma-x11 (if using KDE) or gnome-session (if using GNOME). For Ubuntu’s default, run export $(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $USER gnome-session)/environ) before launching.
  12. Access the desktop: A new window will open running the Ubuntu desktop environment. You can now launch terminal apps, browsers (like Firefox), and other GUI tools directly from Ubuntu.

Common Mistakes

  • Skipping the WSL 2 requirement: Using WSL 1 limits GUI support and performance. Always set WSL 2 as default.
  • Forgetting to enable "Disable access control" in VcXsrv: This causes connection refusal errors when launching GUI apps.
  • Not setting the DISPLAY variable: Without it, GUI apps won’t know where to render.
  • Installing the full ubuntu-desktop without enough disk space: This can fill up small drives. Use ubuntu-desktop-minimal if space is limited.
  • Running GUI commands as root without proper DBUS setup: This leads to blank windows or crashes. Always source the DBUS address when needed.

Tips

  • Use WSLg if available: It simplifies GUI support without third-party tools.
  • Keep Windows and Ubuntu updated: Microsoft frequently improves WSL performance and compatibility.
  • Use code . to open files in VS Code from Ubuntu: If VS Code is installed on Windows, this integrates seamlessly.
  • Mount Windows drives in Ubuntu: They are automatically accessible under /mnt/c, /mnt/d, etc.
  • Backup your WSL environment: Use wsl --export Ubuntu ubuntu_backup.tar to create a portable backup.

Troubleshooting

If the desktop fails to start, first verify WSL version with wsl --list --verbose. Ensure it shows version 2. If not, run wsl --set-version Ubuntu 2.

If GUI apps don’t display, check that the X server (VcXsrv) is running and that the firewall isn’t blocking it. Temporarily disable the firewall to test. If using WSLg, ensure your Windows build supports it (requires KB5004546 or later).

If you see "Cannot open display" errors, recheck the DISPLAY variable with echo $DISPLAY. It should return :0. If not, re-export it.

Black screen after login? The desktop session may be starting but not rendering. Try switching to a different display manager or reinstall the desktop package.

Slow performance? Ensure virtualization is enabled in BIOS and that GPU drivers are updated. WSL uses hardware acceleration when available.

Frequently Asked Questions

Can I run Ubuntu desktop without WSL?

No, WSL is required to run native Linux on Windows 10. Alternatives like virtual machines work but are not native.

Is this the same as dual-booting?

No. This method runs Ubuntu inside Windows without rebooting. Dual-boot requires partitioning and restarting.

Does this work on Windows 10 Home?

Yes, as long as it’s version 2004 or higher and supports WSL 2.

Can I use graphics-intensive apps like GIMP or Inkscape?

Yes, but performance depends on WSL and GPU driver support. Basic use works; heavy editing may lag.

Will my Ubuntu files be lost after a Windows update?

No. WSL preserves your Linux file system across updates unless you uninstall it.

Can I run other Linux desktops like KDE or XFCE?

Yes. Install kde-plasma-desktop or xfce4 instead of ubuntu-desktop.