4
3

More than 1 year has passed since last update.

M1 Mac でXQuartz(Xwindow)の設定方法

Last updated at Posted at 2021-07-08

はじめに

Dockerから,windowをXで下ろしてきたかったのですが,少し設定に手こずりました.
M1(Arm)だから出来なかった訳ではないと思いますが,
XQuartzの設定を忘れてしまったので,設定方法を備忘録として残します.

インストール

brew install xquartz

権限の設定

$ sudo su

(rootになる必要はないかもしれません)

$ xhost +

動かないいくつかの原因

以下の記事に記載されている.

私は,上記の記事の通り,".Xauthority"を消去しました.

$ ls -ld ~/.Xauthority*
-rw-------  1 yasu  staff  400 Jun 23 13:45 /Users/yasu/.Xauthority
$ rm -rf ~/.Xauthority

そして,消去後にXQuartzを再起動したら,以下のようにちゃんとディレクトリができていました.
再起動は必須です.

$ ls -ld ~/.Xauthority*
drwxr-xr-x   2 yasu  staff     64 Jun 23 13:57 .Xauthority/

テスト実行

$ docker run --rm \
    -e DISPLAY=$(hostname):0 \
    -v ~/.Xauthority:/root/.Xauthority \
    test

かわいい目が追っかけてくれたら成功です.

4
3
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
4
3