When managing a server, it is usually the CLI, but sometimes I want to use the GUI as well. At that time, I use VNC, but I also want to try X Window. So, let's try X Window the GUI display of Linix Compute of Oracle Cloud with MAC.
Try X from a Mac Book in an On-Premises environment with an Internet connection to OCI

X11 is no longer included with the Mac, but the X11 server and client libraries are available from the XQuartz project.
・ XQuartz project: https://support.apple.com/ja-jp/HT201341

Download XQuartz from xquartz.org
・ Xquartz.org: https://www.xquartz.org/

Run .dmg file
Click the downloaded .dmg file and click XQuartz.pkg

Welcome to the XQuartz installer screen
Click [Continue]

Important information screen
Click [Continue]

License agreement screen
Check the license agreement and click [Continue]

You must agree to the terms of the software license agreement. screen
If you agree to the license agreement, click [Agree]

Installation type screen
Click [Install]

Installation screen
~ Installing ~

Pop-up
You will need to log out and log back in to make XQuartz your default X11 server
Check the contents and click [OK]

Installation completed screen

Set up X Window on Linux machines for remote access
If the xorg-x11 package is not installed Install the following two with the yum command
-Xorg-x11-xauth.x86_64 -Xorg-x11-server-utils.x86_64
[root@oci-inst01 opc]# yum install -y xorg-x11-xauth.x86_64 xorg-x11-server-utils.x86_64
Loaded plugin:langpacks, ulninfo
Resolving dependencies
	-->Performing transaction confirmation.
	--->Package xorg-x11-server-utils.x86_64 0:7.7-20.install el7
	-->I'm dealing with dependencies: libXxf86misc.so.1()(64bit)Package: xorg-x11-server-utils-7.7-20.el7.x86_64
	-->I'm dealing with dependencies: libXrandr.so.2()(64bit)Package: xorg-x11-server-utils-7.7-20.el7.x86_64
	-->I'm dealing with dependencies: libXinerama.so.1()(64bit)Package: xorg-x11-server-utils-7.7-20.el7.x86_64
	-->I'm dealing with dependencies: libXi.so.6()(64bit)Package: xorg-x11-server-utils-7.7-20.el7.x86_64
	--->Package xorg-x11-xauth.x86_64 1:1.0.9-1.install el7
	-->Performing transaction confirmation.
	--->Package libXi.x86_64 0:1.7.9-1.install el7
	--->Package libXinerama.x86_64 0:1.1.3-2.1.install el7
	--->Package libXrandr.x86_64 0:1.5.1-2.install el7
	--->Package libXxf86misc.x86_64 0:1.0.3-7.1.install el7
	-->Dependency resolution finished.
Resolved the dependency
	==========================================================================================
Package architecture
Version repository capacity
	==========================================================================================
During installation:
	xorg-x11-server-utils        x86_64        7.7-20.el7            ol7_latest        178 k
	xorg-x11-xauth               x86_64        1:1.0.9-1.el7         ol7_latest         29 k
Dependency related installation:
	libXi                        x86_64        1.7.9-1.el7           ol7_latest         40 k
	libXinerama                  x86_64        1.1.3-2.1.el7         ol7_latest         13 k
	libXrandr                    x86_64        1.5.1-2.el7           ol7_latest         27 k
	libXxf86misc                 x86_64        1.0.3-7.1.el7         ol7_latest         19 k
Transaction summary
	==========================================================================================
Installation 2 package(+Package of 4 dependencies)
Total download capacity: 305 k
Installation capacity: 629 k
	Downloading packages:
	(1/6): libXi-1.7.9-1.el7.x86_64.rpm                                |  40 kB  00:00:00
	(2/6): libXrandr-1.5.1-2.el7.x86_64.rpm                            |  27 kB  00:00:00
	(3/6): libXxf86misc-1.0.3-7.1.el7.x86_64.rpm                       |  19 kB  00:00:00
	(4/6): libXinerama-1.1.3-2.1.el7.x86_64.rpm                        |  13 kB  00:00:00
	(5/6): xorg-x11-server-utils-7.7-20.el7.x86_64.rpm                 | 178 kB  00:00:00
	(6/6): xorg-x11-xauth-1.0.9-1.el7.x86_64.rpm                       |  29 kB  00:00:00
	------------------------------------------------------------------------------------------
4 in total.2 MB/s | 305 kB  00:00:00
	Running transaction check
	Running transaction test
	Transaction test succeeded
	Running transaction
During installation: libXrandr-1.5.1-2.el7.x86_64                              1/6
During installation: libXxf86misc-1.0.3-7.1.el7.x86_64                         2/6
During installation: libXinerama-1.1.3-2.1.el7.x86_64                          3/6
During installation: libXi-1.7.9-1.el7.x86_64                                  4/6
During installation: xorg-x11-server-utils-7.7-20.el7.x86_64                   5/6
During installation: 1:xorg-x11-xauth-1.0.9-1.el7.x86_64                       6/6
During verification: libXi-1.7.9-1.el7.x86_64                                  1/6
During verification: libXinerama-1.1.3-2.1.el7.x86_64                          2/6
During verification: libXxf86misc-1.0.3-7.1.el7.x86_64                         3/6
During verification: libXrandr-1.5.1-2.el7.x86_64                              4/6
During verification: xorg-x11-server-utils-7.7-20.el7.x86_64                   5/6
During verification: 1:xorg-x11-xauth-1.0.9-1.el7.x86_64                       6/6
Installation:
	xorg-x11-server-utils.x86_64 0:7.7-20.el7      xorg-x11-xauth.x86_64 1:1.0.9-1.el7
I have installed dependency related:
	libXi.x86_64 0:1.7.9-1.el7                libXinerama.x86_64 0:1.1.3-2.1.el7
	libXrandr.x86_64 0:1.5.1-2.el7            libXxf86misc.x86_64 0:1.0.3-7.1.el7
Has completed!
Install xeyes, a GUI tool for checking X operation This will also install xclock etc.
[root@tokyo-inst01 opc]# yum install xeyes
Loaded plugin:langpacks, ulninfo
	ol7_UEKR5                                                          | 2.8 kB  00:00:00
	ol7_addons                                                         | 2.8 kB  00:00:00
	ol7_developer                                                      | 2.8 kB  00:00:00
・ ・ ・
Installation:
	xorg-x11-apps.x86_64 0:7.7-7.el7
I have installed dependency related:
	dejavu-fonts-common.noarch 0:2.33-6.el7      dejavu-sans-fonts.noarch 0:2.33-6.el7
	fontconfig.x86_64 0:2.13.0-4.3.el7           libICE.x86_64 0:1.0.9-9.el7
	libSM.x86_64 0:1.2.2-2.el7                   libX11.x86_64 0:1.6.7-2.el7
	libX11-common.noarch 0:1.6.7-2.el7           libXau.x86_64 0:1.0.8-2.1.el7
	libXaw.x86_64 0:1.0.13-4.el7                 libXcursor.x86_64 0:1.1.15-1.el7
	libXext.x86_64 0:1.3.3-3.el7                 libXfixes.x86_64 0:5.0.3-1.el7
	libXft.x86_64 0:2.3.2-2.el7                  libXmu.x86_64 0:1.1.2-2.el7
	libXpm.x86_64 0:3.5.12-1.el7                 libXrender.x86_64 0:0.9.10-1.el7
	libXt.x86_64 0:1.1.5-3.el7                   libXxf86vm.x86_64 0:1.1.4-1.el7
	libfontenc.x86_64 0:1.1.3-3.el7              libxcb.x86_64 0:1.13-1.el7
	libxkbfile.x86_64 0:1.0.9-3.el7
Has completed!
・ Sshd_config setting Set the following (# Is commented out, so let's remove it)
[root@oci-inst01 ssh]# vi /etc/ssh/sshd_config | grep X11
・ ・ ・
	X11Forwarding yes
	X11DisplayOffset 10
	X11UseLocalhost no
・ ・ ・
・ Check sshd_config settings
[root@oci-inst01 ssh]# cat /etc/ssh/sshd_config | grep X11
	X11Forwarding yes
	X11DisplayOffset 10
	X11UseLocalhost no
	#	X11Forwarding no
・ Sshd restart
[root@oci-inst01 ssh]# systemctl restart sshd

Terminal startup will start

bash-3.2$ ssh -X -i id_rsa [email protected]
	Last login: Mon Aug 10 12:50:03 2020 from 192.168.0.2
[opc@oci-inst01 ~]$ env | grep DISP
	DISPLAY=10.0.0.2:11.0
[opc@oci-inst01 ~]$ xeyes 
If xeyes cannot be executed and error: "Can't open display" etc. is displayed, check the environment such as Firewall to see if port 6000 is free.

Recommended Posts