PCを新調したので Windows11 にアップグレードして wslg を試してみた。

その前に

WSLg

WSLg とは

ビジュアルは Wayland 、音声は PulseAudio で WSLg 仮想マシンに転送することで、 Linux の GUI アプリを使えるようにする仕組み。

Windows11 で試す

Windows11 では、 Windows Insider Program にせずとも使える。

unknown: delete => {"type":"delete","children":[{"type":"inlineCode","value":"Ubuntu-CommPrev","position":{"start":{"line":25,"column":3,"offset":848},"end":{"line":25,"column":20,"offset":865}}},{"type":"text","value":" をインストールすると ","position":{"start":{"line":25,"column":20,"offset":865},"end":{"line":25,"column":32,"offset":877}}},{"type":"inlineCode","value":"wslg","position":{"start":{"line":25,"column":32,"offset":877},"end":{"line":25,"column":38,"offset":883}}},{"type":"text","value":" できる。","position":{"start":{"line":25,"column":38,"offset":883},"end":{"line":25,"column":43,"offset":888}}}],"position":{"start":{"line":25,"column":1,"offset":846},"end":{"line":25,"column":45,"offset":890}}}
WSLで /mnt/wslg が存在していれば動作する状態になっている。 Distribution による特別な設定は不要?

Ubuntu-CommPrev の方が GPU driver が新しいなど違いあり。

glxinfo -B

X

特に何も設定しなくても xterm とか gvim などの X11 のアプリは動作する。

101キーボード

setxkbmap -layout us でなおった。 なおらないアプリもある。

PluseAudio

mpd から pluse audio に出力してみる

echo $PULSE_SERVER
/mnt/wslg/PulseServer

環境変数 $PULSE_SERVER にファイルパスが入っているときは unix socket を使うという意味。

/etc/mpd.conf

audio_output {
       type     "pulse"
       name     "My PULSE Device"
       server   "/mnt/wslg/PulseServer" # $PULSE_SERVER
}

という設定になる。TCP 経由ではなく UNIX SOCKET 経由なのに注意。

load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1

は使われない。

mpd client