The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

If you can read me, I'm broken!

Views: 308,757β€…    Votes:  102β€…
Tags: gui   windows-subsystem-for-linux   yad  
Link: πŸ” See Original Answer on Ask Ubuntu ⧉ πŸ”—

URL: https://askubuntu.com/q/993331
Title: What's the easiest way to run GUI apps on Windows Subsystem for Linux?
ID: /2018/01/07/What_s-the-easiest-way-to-run-GUI-apps-on-Windows-Subsystem-for-Linux_
Created: January 7, 2018    Edited:  June 7, 2019
Upload: March 26, 2024    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false


VcXsrv

I chose to use VcXsrv in WSL (Windows 10 Subsystem for Linux). I recommend everyone do their research between xming (the accepted answer) and [VcXsrv][1] before selecting one or the other for Graphical User Interface (GUI) support in Windows 10 Ubuntu 16.04.

Installation

Installation is straight forward. As of March 17, 2019 you can simply accept the defaults. If you want to call gedit from within your Bash Shell / Terminal you need to edit ~/.bashrc and insert this line:

export DISPLAY=localhost:0.0

What can you do after VcXsrv is installed?

I was able to run:

sudo apt install ubuntu-desktop
sudo apt install yad
sudo apt install gedit

… to install GUI desktop software. This then allowed me to run gedit and nautilus. Also I was then able to install specific GUI applications through the CLI (Command Line Interface) using apt or apt-get commands.

When I want to try many of my Ubuntu bash scripts within WSL VcXsrv must be installed so zenity and yad x-windows dialog boxes are displayed for user input.

As others have noted GUI within WSL is not perfect and you can expect to spend time problem-solving some issues. Also some GUI software simply won’t work in WSL.

Setup notes

I modified /etc/environment to tweak GUI drop down menus:

PATH="/mnt/e/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
export LIBGL_ALWAYS_INDIRECT=Yes
export DISPLAY=localhost:0.0
⇧ How to automate keyboard backlight ON at boot Ubuntu 17.04 has a Unity 8 option besides the default. Can I remove one of the options, and which one should I keep?  β‡©