How to run Linux desktop environment with Linux subsystem for Windows 10

You have probably heard of Windows Subsystem for Linux or WSL, this is a feature that you can enable in Windows 10 to natively run Linux command, and application on your Windows machine without running in a separate virtual machine.

Microsoft made a couple of Linux distributions available to name a few

and more, just search for Linux in the Microsoft public Store

 

I choose to install openSUSE, and wanted to see if it was possible to run a desktop environment as well.

There is a free and open-source desktop environment for Linux and Unix called Xfce, if you heard of GNOME it is similar to this (but Xfce is not GNOME fork)

 

How do you get all this going then? Well first enable Windows  Subsystem for Linux

image

 

Choose to install you favorite Linux distribution from Microsoft Store, my choice this time is ubuntu, but I have tested the same with Kali Linux.

image

 

What for the installation and launch the Linux prompt, search for ubuntu in the start menu.

image

First make sure to update your Linux installation, with these commands

sudo apt-get update

sudo apt-get dist-upgrade

 

Now time to install wget to download Xfce, may not be needed on some distributions

sudo apt-get install wget

 

Now time to download and install Xfce, goodies (optional), and start the service

sudo apt-get install xfce4

sudo apt-get install xfce4-goodies

sudo apt-get install xrdp

sudo sed -i ‘s/port=3389/port=3390/g’ /etc/xrdp/xrdp.ini

sudo service xrdp start

image

If you are running For Kali Linux, these are the commands

wget https://kali.sh/xfce4.sh

chmod +x xfce4.sh

sudo ./xfce4.sh

sudo /etc/init.d/xrdp start

 

OK done! How do you connect to the Linux desktop? Run Remote Desktop Connection, mstsc.exe

Enter the Computer: 127.0.0.1:8890, press Connect

image

image

 

What is your best tips with Linux on Windows 10? Share it in the comments, and Have fun!

Comments

13 responses to “How to run Linux desktop environment with Linux subsystem for Windows 10”

  1. King Cat

    Actually, I would enter localhost instead of 127.0.0.1:8890 becuase 127.0.0.1:8890 just didn’t work for me. I like this because it is basically a nice little dual-boot but without the chaos of dual-booting or the risks. Just one problem, xfce’s web browser didn’t open due to an Input/Output error.

    Liked by 1 person

  2. Hi!
    I would like to ask you..
    How to go back to Windows 10..
    Thank you!

    Like

  3. RR

    what session did you choose on login screen?

    Like

  4. Thomas Debeuret

    Great work !

    You’ve just made a little error in your tuto :
    You said “Enter the Computer: 127.0.0.1:8890, press Connect” but, as shown in your picture, we actually have to enter 127.0.01.3390

    If some of you are interrested, I’ve made a tuto to make a one click Xubuntu desktop launcher from Windows based on your solution :

    Liked by 2 people

  5. Morsel Mahmud

    Its not working for me.. sudo sed -i ‘s/port=3389/port=3390/g’ /etc/xrdp/xrdp.ini command isn’t working for me. and shows error while connecting remote desktop/

    Like

    1. Eric Hensler

      me too. i’m new to this and the faulty script has had me running around the web for hours! i know this guy does this for nothing and i appreciate that but i need help! please???

      Like

    2. The single quote is wrong.. please manually replace this

      Like

  6. Aneesh Raj

    How could we run GNOME instead of XFCE4 desktop ?

    Like

    1. sure, why not, I haven’t tested it myself, but se no reason why it shouldn’t work

      Like

  7. Thomas Debeuret

    It works perfectly !
    It’s the only solution that worked to get a graphical desktop with WSL on my laptop.

    Why do you have to change the TCP port ? (sudo sed -i ‘s/port=3389/port=3390/g’ /etc/xrdp/xrdp.ini)

    Thanks a lot !

    Like

    1. RR

      sudo sed -i ‘s/port=3389/port=3390/g’ /etc/xrdp/xrdp.ini

      This line didn’t work it says:
      sed: -e expression #1, char 1: unknown command: `’

      Like

    2. remrobem

      I did a copy/paste and had same issue. Fixed it by overtyping the ‘ (single quotes). Looks like copy/paste copied it as a different character

      Liked by 1 person

  8. Joao Kho

    Very good sharing

    Liked by 1 person

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.