LoginSignup
5
5

More than 3 years have passed since last update.

WSL2での開発メモ

Last updated at Posted at 2020-07-06

はまったところを書いていく
docker for Windowsは意地でも使わない
使用DistributionはopenSUSE 15.1

WSL2内でX11アプリケーションを起動し、Windows側で描画

  1. Windows側でvcXsrvを起動
  2. WSL側でexport DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
  3. WSL側でX11アプリケーション起動

WSL2はsystemdが使えない

WSL用のinitを使っているらしい

よってdockerdの自動起動ができない

dockerd --add-runtime oci=/usr/sbin/docker-runc
で手動で起動する

Windows側からWSLのファイルシステムにアクセスする

explorerのナビゲーションバー(?)に
\\wsl$
と入力してEnter

docker-composeでmappingしたportにwindowsから127.0.0.1経由でアクセスできない

localhostだとつながるのに、127.0.0.1だとつながらない

before.yaml
ports:
  - 80:80
after.yaml
ports:
  - 127.0.0.1:80:80

(追記)VirtualBoxに戻る

色々躓いたり妥協しないといけない点が多かったのでVirtualBoxのほうが良いという結論になった 

5
5
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
5
5