Score:0

Use external X server for application (emacs) on WSL1 (recently upgraded)?

ru flag

On Jan. 23, 2022, I was led by MS Windows 10 to upgrade the WSL on my Windows 10 (20H2). It promised to support WSL2 and WSLg.

However, the support of graphic display is not possible. I can only start emacs using the terminal of an Ubuntu/WSL in terminal mode (not GUI).

The problem is that even running vcXsrv, the Ubuntu/WSL1 application would not be able to use the external X server to run as GUI app.

According to the latest WSL documentation, my Windows is too old to have WSL2 and WSLg supported. But Windows nevertheless asked me to upgrade.

I also confirmed that my Ubuntu is still in WSL1 mode, and I could not convert it to WSL 2 mode.

Here is the detailed my Windows:

Edition Windows 10 Enterprise
Version 20H2
Installed on    ‎10/‎21/‎2021
OS build    19042.2486
Experience  Windows Feature Experience Pack 120.2212.4190.0

And the version of wsl:

wsl --version
WSL version: 1.0.3.0
Kernel version: 5.15.79.1
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19042.2486

and the mode of wsl:

wsl --list --verbose
  NAME            STATE           VERSION
* Ubuntu          Stopped         1
  Ubuntu-22.04    Running         1

(Ubuntu was broken, when I tried to reset it to try to change to run with WSL2. I had installed Ubuntu-22.04 afresh, but the problem with the clipboard is the same.)

So my wish now is to go back to the older version or behavior of WSL using VcXsrv as X server for graphic display.

NotTheDr01ds avatar
vn flag
Hmm - If you are using WSL1, then nothing *should* have changed. WSLg always has required WSL2, so if your Ubuntu is still on WSL1, then you would still be using VcXsrv. Are you saying that VcXsrv doesn't work the same? Also, can you `wsl --version` and add that to your question? `wsl -l -v` might also be useful info. Thanks!
Yu Shen avatar
ru flag
It's proven that emacs can run in non-terminal mode even without running external X server, vcXsvr.
Score:0
ru flag

The problem is solved: Inspired by https://github.com/hubisan/emacs-wsl/blob/master/run-emacs-wsl-1/wsl-1_2-emacs.bat I changed to the following

export DISPLAY=:0.0

from export DISPLAY=127.0.0.1:0.0

But I don't know why, and what the difference made.

then I can start GUI app in Ubuntu/WSL1 again.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.