How to install Mate Desktop GUI on Ubuntu 20.04 WSL 1 or 2- Windows 10

WSL -Windows Subsystem Linux on Windows 10 doesn’t come with a Graphical user interface, thus, the command line is the main way to interface it. However, still, if you want to install some Linux Desktop environment then here is the tutorial in it.

We already have created a tutorial on installing the GUI interface on WSL using XFCE, however, this time here we are using MATE Desktop. It is a lightweight and traditional-looking system.

Note: This is just to learn, however, access to WSL with GUI wouldn’t give the performance as some native Linux Distro with Graphical Desktop environment running on PC, laptop, or Virtual Machine.

Enable WSL on Windows 10

Before showing the further steps, I am assuming that you already have the WSL 1 or WSL 2 installed on your system. If not then see these two tutorials: Enable WSL 1 and then WSL 2.

Open WSL Linux Distro and Update

Now, open the Ubuntu WSL Linux distro app and run the update and upgrade commands to make sure all the packages installed on the system are up to date.

sudo apt update
sudo apt upgrade

Install Mate Desktop GUI on WSL

To install the Mate Desktop environment, we don’t need to add any third-party repository. The packages for setting up the Mate are already on Ubuntu 20.04 or 18.04 LTS. Thus, use the below command:

sudo apt install mate-desktop

Install tigervnc server

To access the graphical user interface we need some tools such as VNC. So, we install the open-source VNC server on our WSL machine.

sudo apt install tigervnc-standalone-server tigervnc-xorg-extension tigervnc-viewer

Once the server is installed:

sudo vncserver -geometry 1600x900 :0

After entering the above command it will prompt to set the connection password, and it will prompt to enter it twice,

1600×900 in the above command is the resolution in which we want to get the GUI Desktop interface of Mate, whereas :0 means the desktop port number is zero.

The resolution and port number can be changed at will, as long as there is no error.

Install VNC client or viewer on your Windows 10 system

There are a handful of good VNC clients available online such as open-source RealVNC Viewer. You can download it on your PC using this link.

Once installed, run it, and enter the localhost address with the display port number of the VNC server. Example: 127.0.0.1:0

When it asks for the password, enter that you have set it while setting up the resolution and display port.

Enter password for WSL GUI connect to WSL desktop envrionment

 

Once connected you would get something like this:

VNC viewer to access WSL 2 desktop Ubuntu 20.04 LTS WSL with Mate Desktop GUI environment min WSL Ubuntu 20.04 GUI desktop running terminal

Google Chrome on WSL

I also installed Google Chrome on WSL GUI using the terminal. Initially, it gave an error — Sandbox is required. Thus, I used a command:

/usr/bin/google-chrome-stable --no-sandbox

It opens perfectly and also when it comes to loading the websites keep getting crashed. However, soon I will solve this problem and provide a tutorial on the same.

Google Chrome on WSL

 

11 thoughts on “How to install Mate Desktop GUI on Ubuntu 20.04 WSL 1 or 2- Windows 10”

  1. Can you just run the vnc each time after that or do you need to run powershell or anything else. Does WSL have to be opened first then you can use this. I can totally follow your instructions. Just wondering when you comeback in two days what steps are need if any to run the gui again…..

    Reply
    • Yes, we need to run VNC every time to connect it, and also WSL service should be running, I mean if you have restarted the PC then once we have to open WSL.

      Reply
  2. user@DESKTOP-NDPGQ9L:/root$ sudo vncserver -geometry 1600×900 :0
    New ‘DESKTOP-NDPGQ9L.localdomain:0 (root)’ desktop at :0 on machine DESKTOP-NDPGQ9L.localdomain
    Starting applications specified in /etc/X11/Xvnc-session
    Log file is /root/.vnc/DESKTOP-NDPGQ9L.localdomain:0.log
    Use xtigervncviewer -SecurityTypes VncAuth -passwd /root/.vnc/passwd :0 to connect to the VNC server.
    vncserver: Failed command ‘/etc/X11/Xvnc-session’: 256!
    =================== tail -15 /root/.vnc/DESKTOP-NDPGQ9L.localdomain:0.log ===================
    Copyright (C) 1999-2019 TigerVNC Team and many others (see README.rst)
    See https://www.tigervnc.org for information on TigerVNC.
    Underlying X server release 12008000, The X.Org Foundation
    Thu Mar 11 15:49:04 2021
    vncext: VNC extension running!
    vncext: Listening for VNC connections on local interface(s), port 5900
    vncext: created VNC server for screen 0
    X connection to :0 broken (explicit kill or server shutdown).
    Thu Mar 11 15:49:05 2021
    ComparingUpdateTracker: 0 pixels in / 0 pixels out
    ComparingUpdateTracker: (1:-nan ratio)
    Killing Xtigervnc process ID 9112… which seems to be deadlocked. Using SIGKILL!
    =============================================================================================
    Starting applications specified in /etc/X11/Xvnc-session has failed.
    Maybe try something simple first, e.g.,
    tigervncserver -xstartup /usr/bin/xterm

    Reply
  3. I got as far as creating the password after setting the resolution with ‘sudo vncserver -geometry 1920×1080 :0’

    It accepted both my passwords but then I got an error message saying:
    “/usr/bin/xauth: file /root/.Xauthority does not exist”
    and then tigervnv automatically terminated

    This was a fresh wsl/ windows 10 ubuntu install

    Reply
  4. I have the following issue after entering
    sudo vncserver -geometry 1920×1080 :0
    vncserver: /usr/bin/Xtigervnc did not start up, please look into ‘/home/USER/.vnc/MACHINE.localdomain:1.log’ to determine the reason! -1
    Killing Xtigervnc process ID 13938… success!

    LOG contents:
    Xvnc TigerVNC 1.10.0 – built Apr 9 2020 06:49:31
    Copyright (C) 1999-2019 TigerVNC Team and many others (see README.rst)
    See https://www.tigervnc.org for information on TigerVNC.
    Underlying X server release 12008000, The X.Org Foundation

    Mon Apr 19 19:11:04 2021
    vncext: VNC extension running!
    vncext: Listening for VNC connections on local interface(s), port 5900
    vncext: created VNC server for screen 0

    Mon Apr 19 19:11:34 2021
    ComparingUpdateTracker: 0 pixels in / 0 pixels out
    ComparingUpdateTracker: (1:-nan ratio)

    Reply
  5. Shouldn’t this work in WSLg just without having to install all the VNC server and client/viewer stuff, as the WSLg Virtual Machine (with Wayland/Weston and XWayland) runes FreeRDP on server side and Microsoft RDP on Windows host side?

    Reply
      • Are you sure it will work under WSLg now (did not for me under WSL – see above!? Then my question is if a WSLg install will need further configuration steps / changes to be performed after the “sudo apt install mate-desktop” command (if that works?) and if so, any idea which once that would be?

        Reply

Leave a Comment

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