1
2

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.

【メモ】WSL2でGUIを使うために

1
Last updated at Posted at 2020-12-01

背景

WSL2 で X11 を使いたかったが、紹介されている方法でどうにもうまく接続できなかった。皆さん nameserver でいけるようですが、私のは何故かダメ。

解法

ホストのIPv4アドレスを指定すれば良さそうだったので、次のようにした。
まず ifconfig を使いたいので、インストール。

sudo apt-get install net-tools

次に下記を .bashrc に書き込むと毎度 export コマンドを実行しなくても X Window が表示できるようになった。

export DISPLAY=$(ifconfig | grep inet | awk '{if (NR==3) print $0}' | awk '{print $2}'):0

参考

1
2
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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?