Windows 10: Cannot run GUI app on WSL 2

Discus and support Cannot run GUI app on WSL 2 in Windows 10 Network and Sharing to solve the problem; I want to open some GUI apps on WSL 2 using Windows Insider 19640, but it doesn't work. For example, if I want to open gthumb in Ubuntu terminal, it... Discussion in 'Windows 10 Network and Sharing' started by allantanaka, Jun 9, 2020.

  1. Cannot run GUI app on WSL 2


    I want to open some GUI apps on WSL 2 using Windows Insider 19640, but it doesn't work. For example, if I want to open gthumb in Ubuntu terminal, it throws an error:


    lemma@DESKTOP-TE65AIF:~$ xhost +

    xhost: unable to open display ":0"

    lemma@DESKTOP-TE65AIF:~$ gthumb

    Unable to init server: Could not connect: Connection refused



    ** gthumb:17130: CRITICAL **: 18:42:10.819: Failed to parse arguments: Cannot open display:


    In .bashrc file, I set:

    export DISPLAY=':0'

    export LIBGL_ALWAYS_INDIRECT=1

    :)
     
    allantanaka, Jun 9, 2020
    #1

  2. WSL 2, GUI Applications using XServer

    I've seen this question before, but none of the solutions are working for me. I know the steps that are mentioned everywhere to get GUI applications working for WSL 2 on the Windows 10 Pro Insider Preview.

    1. Install XServer on your windows 10 machine (here I used VcXsrv)
    2. Run the XServer
    3. Install something in WSL 2 that you want to display (for me it was terminator)
    4. Run DISPLAY=:0 terminator -u to get it running.

    However, when I do number 4, I get:

    When I echo $DISPLAY it returns :0 as expected.

    When I try to open something simple like xclock I get Error: Can't open display: :0

    The X server is definitely running as I set it up and it exists in the Windows 10 system tray. I've tried many configurations for the X server, and I get the same thing every time. I've also tried just setting the $DISPLAY in the .bashrc file, with the same results.

    I've also tried the solutions proposed here, by exporting DISPLAY to localhost:0.0, which the same results (also tried 0.0, :0, and a few others).

    I've tried rebooting, uninstalling and reinstalling things, and I get the same results every time. I'm not sure what to try next.
     
    trueCamelType, Jun 9, 2020
    #2
  3. LOL
    lol Win User
    Blurry fonts on using Windows default scaling with WSL GUI applications (HiDPI)

    Is there a way to fix blurry fonts in linux GUI applications when being run from WSL (Ubuntu 18.04) using the default Windows scaling? Things I have tried so far:

    With Xming:

    1. Tried disabling Windows scaling and setting it from linux side using GDK_DPI_SCALE=2.5, the problem with this is several things like context menu icons don't play nicely and are often not scaled. Without GDK_DPI_SCALE=2.5, applications are basically unusable since the text is extremely tiny.
    2. Tried installing all the fonts from C:\Windows\Fonts to C:\Program Files\Xming\fonts\TTF and running mkfontscale, couldn't make it work this way either.
    3. Tried using VcXsrv, has the same issue.

    Screenshots

    • Clion:


    Cannot run GUI app on WSL 2 6H3Ej.png


    • Comparison between emacs (WSL) and VS Code (Windows native)


    Cannot run GUI app on WSL 2 [​IMG]


    All the resources I have looked up so far:

    1. Why are WSL GUI apps rendered with blurry fonts with Xming?: The answer here is specifically for just firefox and electron based applications.
    2. Gnome-Terminal blurry on Xming: Doesn't have anything helpful in particular either other than a suggestion to disable scaling and using something else than Xming.
    3. DPI issues running GUI programs on a 4K screen: Suggests using VcXsrv.

    The main purpose of doing all this is to be able to run text editors(emacs)/IDE(Clion) from WSL. And, the reason I cannot install their windows equivalent is we develop only for linux.

    Few system details:

    Screen

    4K (3840x2160) - 15.6"

    OS

    • Windows: Windows 10 Home v1803 Build: 17134.345
    • WSL: Ubuntu 18.04 (Linux username 4.4.0-17134-Microsoft #345-Microsoft Wed Sep 19 17:47:00 PST 2018 x86_64 x86_64 x86_64 GNU/Linux)
     
  4. jimbo45 Win User

    Cannot run GUI app on WSL 2

    WSL and Linux apps

    Hi there

    @decimus
    @margrave55

    if you install an X-server for Windows you can actually run some Linux GUI apps (you won't get a full Linux GUI though but some individual apps work quite well)

    This X-server works for me : VcXsrv Windows X Server download | SourceForge.net

    What I like is that any Linux file manager can handle long path / directory and file names --the 266 limitation on standard windows apps has irritated me for ages -- especially with large disk capacities in RAID configurations.

    WSL can also handle Linux formatted file systems and run SAMBA. I think UBUNTU is the easiest to use on WSL --to get some GUI apps you can install the KDE plasma desktop via Ubuntu's package manager, start the Windows X-Server, connect to a screen on your Ubuntu and then try and start some apps. Dolphin (file manager) and kpatience (spider solitaire etc) work perfectly. GRSYNC - another great program for backing up data works a treat too -- note this is for DATA backup --for system imaging I use like a lot of people on these boards the excellent Macrium Free edition.

    here' s two examples on Ubuntu using WSL on W10 -- have fun !!!!


    Cannot run GUI app on WSL 2 [​IMG]



    Cannot run GUI app on WSL 2 [​IMG]


    Cheers
    jimbo
     
    jimbo45, Jun 9, 2020
    #4
Thema:

Cannot run GUI app on WSL 2

Loading...
  1. Cannot run GUI app on WSL 2 - Similar Threads - Cannot run GUI

  2. Can't run lunix application GUI via WSL 2

    in Windows 10 Gaming
    Can't run lunix application GUI via WSL 2: Dears.I hope you doing well and Thanks for you effort.I install Ubuntu via WSL 2 and it's work fine with line command but when want to run an application i get the below message, i try all the solution that find in the internet but it's not work with me, i don't know if the...
  3. Can't run lunix application GUI via WSL 2

    in Windows 10 Software and Apps
    Can't run lunix application GUI via WSL 2: Dears.I hope you doing well and Thanks for you effort.I install Ubuntu via WSL 2 and it's work fine with line command but when want to run an application i get the below message, i try all the solution that find in the internet but it's not work with me, i don't know if the...
  4. Can't run lunix application GUI via WSL 2

    in Windows 10 BSOD Crashes and Debugging
    Can't run lunix application GUI via WSL 2: Dears.I hope you doing well and Thanks for you effort.I install Ubuntu via WSL 2 and it's work fine with line command but when want to run an application i get the below message, i try all the solution that find in the internet but it's not work with me, i don't know if the...
  5. Notepad running next to gedit using the initial WSL GUI app support

    in Windows 10 Ask Insider
    Notepad running next to gedit using the initial WSL GUI app support: [ATTACH] submitted by /u/itsme-alan [link] [comments] https://www.reddit.com/r/Windows10/comments/n0fnll/notepad_running_next_to_gedit_using_the_initial/
  6. Couldn't use wsl gui

    in Windows 10 Drivers and Hardware
    Couldn't use wsl gui: [ATTACH] Please don't direct me to any other forum. [ATTACH] https://answers.microsoft.com/en-us/windows/forum/all/couldnt-use-wsl-gui/43e9e847-7b06-42f5-9510-b0d1a5c43857
  7. Introducing Linux GUI apps running on Windows using the Windows Subsystem for Linux (WSL)

    in Windows 10 Ask Insider
    Introducing Linux GUI apps running on Windows using the Windows Subsystem for Linux (WSL): [ATTACH] submitted by /u/no_quests [link] [comments] https://www.reddit.com/r/Windows10/comments/mvlwj9/introducing_linux_gui_apps_running_on_windows/
  8. Kali Linux on Windows in 5min (WSL 2 GUI)

    in Windows 10 Ask Insider
    Kali Linux on Windows in 5min (WSL 2 GUI): [ATTACH] submitted by /u/scadonl [link] [comments] https://www.reddit.com/r/Windows10/comments/iq8t11/kali_linux_on_windows_in_5min_wsl_2_gui/
  9. Cannot install WSL 2

    in Windows 10 Installation and Upgrade
    Cannot install WSL 2: I'm running build 18945.1001. I installed Windows Subsystem for Linux from the store as per https://docs.microsoft.com/en-us/windows/wsl/install-win10. I can go to the store, click Debian, click Launch and get a Bash terminal. I rebooted, ran Enable-WindowsOptionalFeature...
  10. Cannot run Ubuntu with WSL

    in Windows 10 Installation and Upgrade
    Cannot run Ubuntu with WSL: I have Windows 10 Education build 18272.rs_prerelease.181026-1425. I have turned on Windows Subsystem for Linux, but I cannot run Ubuntu. I have tried installing the apps "Ubuntu" and later "Ubuntu 18.04 LTS" from the Windows store and running them. Upon installing either app...

Users found this page by searching for:

  1. wsl 2 kde VcxSrv

    ,
  2. macrium error wsl2