0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Windows10 の wsl で X Window System が使えないと思ったら

Posted at

結論:Windows11にしましょう。

Windows10 の環境で wsl のバージョンを上げ、例えばターミナルで以下のようなバージョンが表示されるとします。

PS C:\Users\pcuser\Desktop> wsl --version
WSL バージョン: 1.2.5.0
カーネル バージョン: 5.15.90.1
WSLg バージョン: 1.0.51
MSRDC バージョン: 1.2.3770
Direct3D バージョン: 1.608.2-61064218
DXCore バージョン: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows バージョン: 10.0.19045.2846

WSLg が来てるじゃないですかやったー、と思って Ubuntu-20.04 を呼び出して xeyes とか実行しようと思うわけですよ。

demouser@demopc:/mnt/c/Users/pcuser/Desktop$ xeyes
Error: Can't open display:
demouser@demopc:/mnt/c/Users/pcuser/Desktop$ xset -q
xset:  unable to open display ""

なんでー??

WSLgに対応している Windows のビルドバージョンをよく読む

詳細は https://github.com/microsoft/wslg/wiki/Diagnosing-%22cannot-open-display%22-type-issues-with-WSLg に書かれている通りなのですが、Windows のビルドバージョンは 21364 以上 を求められます。で、Windows 10 の主なビルドバージョンは以下の通りです。(2023年5月時点)

  • Windows 10 (22H2) 一般提供(GAC) 19045.xxxx
  • Windows 10 (21H2) 長期サービス(LTSC) 19044.xxxx

  • Windows 10 Inside Preview Build 21390

ところがもう Inside Preview Program はとっくに Windows11 になっていますので、今からこれを適用するのはお勧め出来ません。(というか2023年5月時点で出来るんでしょうか?)

というわけで普通の Windows10 では WSLg が動かないので諦めて Windows11 にするか、あるいは既に他の記事などで紹介されている、VcXsrvなどといった Xサーバプログラムを Windows10 で動かすやり方がおすすめ、ということになるようです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?