Windows Subsystem for Linux で Firefox を実行する

  • 投稿者:
  • 投稿カテゴリー:windows

Windows 10の設定

Windows 10 へVcXsrv X Serverをインストールして、実行する
https://sourceforge.net/projects/vcxsrv/

インストール後は[xlaunch]で検索して実行する

[Multiple windows]は選択しないほうが良いといくつかのサイトに記載されていた

Windows Subsystem for Linuxの設定

# apt install dbus-x11
# service dbus start
# apt install ubuntu-desktop
...(かなりの時間を要した)
# apt install firefox
# firefox

上記コマンドを実行することでVcXsrvにFirefox画面が表示された

後日談

Windows 10 を再起動したところ、以下のようなエラーがでてVcXsrvへ表示されなくなった

# firefox
Error: no DISPLAY environment variable specified

その場合は環境変数にDISPLAYを登録する

# vi .bash_profile
...
export DISPLAY=localhost:0

参考

http://rolandtanglao.com/2019/01/02/p1-howto-make-firefox-work-on-wsl/
https://royalwin.blog.so-net.ne.jp/2018-04-21
http://www.mikitechnica.com/11-xming-teraterm.html