Run XFCE in Windows 10 via WSL

Run XFCE in Windows 10 via WSL

Windows 10’s WSL is gaining a lot popularity lately. The fact that we are able to natively-ish run Linux apps on Windows is definitely something we only dreamed about before.

Here, we will cover what’s needed in order to run XFCE on Windows

Install WSL

Installing WSL is very simple: First you need to enable the Developer Mode and Windows Linux Subsystem via Applications and Features, as covered in this official guide.

  • Open Settings -> Update and Security -> For developers
  • Enable Developer Mode
  • From the start menu search for “Turn Windows features on or off”
  • Select Windows Subsystem for Linux (beta).
  • Open the Command Prompt (cmd) and run ‘bash’
  • Follow the instructions and restart if asked.

Install XFCE

First, add the display to your .bashrc

1
echo 'export DISPLAY=:0' >> ~/.bashrc && . ~/.bashrc

Configure dbus

As explained on Reddit, you need to change the session.conf file in dbus settings to communicate via TCP instead of sockets.

Now we need to fix dbus: The issue with this was that by default, dbus uses unix sockets to communication, which windows bash at the moment doesn’t support. So we just need to tell it to use tcp. In /etc/dbus-1/session.conf, you need to replace unix:tmpdir=/tmp with tcp:host=localhost,port=0 and then you are done. Note this file needs root to edit. An easy way to do this is to execute the following:

1
sudo sed -i 's$<listen>.*</listen>$<listen>tcp:host=localhost,port=0</listen>$' /etc/dbus-1/session.conf

And now close bash, and open it again. Feel free now to run whatever: Firefox and virt-manager work. Chrome sadly doesn’t for another reason of note.

Install VcXserv

From: https://sourceforge.net/projects/vcxsrv/

VcXserv is an X server for Windows. This is needed for rendering GUI applications on Windows.

Once installed you need to run it before you run any GUI app.

ALSO READ: Install Manjaro Linux on VMWare

Install XFCE

Perhaps the easiest part of the tutorial. This is done by running ‘bash’ from the start menu, then enter:

sudo apt-get install xubuntu-desktop -y
It will take a while but, once it’s installed you should be able to run it by typing

1
xfce4-session

If everything is fine you should be able to see XFCE and it’s included apps. So far we tested running Firefox, Gitg, SmartGit, glxgears and few more. Chrome/Electron based apps won’t run, like Chrome, Chromium, Visual Studio Code, etc.

Once you are done with XFCE, you can press the XFCE start button and select Logoff.

Credits

Photo: https://www.reddit.com/r/unixporn/comments/4aokkr/xfce_xfce_running_in_windows10/

More Content