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

Posted by

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!

Advertisements

13 comments

  1. 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. 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

  3. 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. 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

  4. 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. 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. 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

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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