I tried to display GUI on Mac with X Window System

■ Purpose

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.

■ Configuration image

Try X from a Mac Book in an On-Premises environment with an Internet connection to OCI 構成Internet_xeyes.png

■ Mac settings

● About X11 for Mac

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 MAC-HP01.png

● XQuartz download

Download XQuartz from xquartz.org

・ Xquartz.org: https://www.xquartz.org/ MAC-HP02.png

● xquartz installation

  1. Run .dmg file Click the downloaded .dmg file and click XQuartz.pkg MAC-HP03.png

  2. Welcome to the XQuartz installer screen Click [Continue] MAC-HP04.png

  3. Important information screen Click [Continue] MAC-HP05.png

  4. License agreement screen Check the license agreement and click [Continue] MAC-HP06.png

  5. You must agree to the terms of the software license agreement. screen If you agree to the license agreement, click [Agree] MAC-HP07.png

  6. Installation type screen Click [Install] MAC-HP08.png

  7. Installation screen ~ Installing ~ MAC-HP09.png

  8. 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] MAC-HP11.png

  9. Installation completed screen MAC-HP12.png

■ OCI Linux compute side settings

Set up X Window on Linux machines for remote access

● xorg-x11 package installation

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!

● xeyes installation

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 settings

・ 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

■ X window execution from MAC to OCI Linux Compute

● Start XQuartz

  1. Start XQuartz terminal Click the XQuartz icon in [Others] of Launchpad to start the terminal MAC-HP14.png

Terminal startup will start 00.png

  1. ssh connection to OCI instance Ssh connections run with the -X option to enable the X11 forwarding feature
bash-3.2$ ssh -X -i id_rsa [email protected]
	Last login: Mon Aug 10 12:50:03 2020 from 192.168.0.2
  1. Check the DISPLAY environment variable Confirm that the DISPLAY environment variable is automatically registered If it is not automatically registered, review the settings such as sshd.
[opc@oci-inst01 ~]$ env | grep DISP
	DISPLAY=10.0.0.2:11.0
  1. run xclock Confirm that GUI can be displayed with xeyes command
[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. xeyes01.png

Recommended Posts

I tried to display GUI on Mac with X Window System
I tried to draw a system configuration diagram with Diagrams on Docker
I want to AWS Lambda with Python on Mac!
I tried to build an environment for machine learning with Python (Mac OS X)
I tried to make GUI tic-tac-toe with Python and Tkinter
How to install Theano on Mac OS X with homebrew
I learned MNIST with Caffe and tried to draw it (MAC OS X El Capitan)
I want to set up a GUI development environment with Python or Golang on Mac
[Shell startup] I tried to display the shell on the TV with a cheap Linux board G-cluster
I tried to get started with Bitcoin Systre on the weekend
I tried to summarize everyone's remarks on slack with wordcloud (Python)
I tried to implement Autoencoder with TensorFlow
I tried to visualize AutoEncoder with TensorFlow
I tried to get started with Hy
I want to use Linux on mac
How to erase Python 2.x on Mac.
I tried to implement CVAE with PyTorch
I tried to solve TSP with QAOA
[Python] I tried to visualize the night on the Galactic Railroad with WordCloud!
I want to display an image on Jupyter Notebook using OpenCV (mac)
I tried with the top 100 PyPI packages> I tried to graph the packages installed on Python
I tried to build a Mac Python development environment with pythonz + direnv
Terms closely related to the X Window System
I tried to detect Mario with pytorch + yolov3
I tried to implement reading Dataset with PyTorch
I tried to use lightGBM, xgboost with Boruta
I tried to learn logical operations with TF Learn
I tried to move GAN (mnist) with keras
I tried to save the data with discord
I tried to detect motion quickly with OpenCV
I tried to integrate with Keras in TFv1.1
I want to display multiple images with matplotlib.
I tried to get CloudWatch data with Python
I tried to output LLVM IR with Python
I tried to touch Python's GUI library "PySimple GUI"
I tried to detect an object with M2Det!
I tried to automate sushi making with python
Put Python 2.7.x on Mac OSX 10.15.5 with pyenv
I tried to predict Titanic survival with PyCaret
I tried to operate Linux with Discord Bot
I tried to study DP with Fibonacci sequence
I tried to multiply bouncing balls (occasionally x100)
I tried to start Jupyter with Amazon lightsail
I tried to judge Tsundere with Naive Bayes
I tried playing with the calculator on tkinter
[Mac] I tried reinforcement learning with OpenAI Baselines
I tried to use Resultoon on Mac + AVT-C875, but I was frustrated on the way.
I tried to easily create a fully automatic attendance system with Selenium + Python
I tried to make Kana's handwriting recognition Part 3/3 Cooperation with GUI using Tkinter
I tried to display the infection condition of coronavirus on the heat map of seaborn
I tried to learn the sin function with chainer
I tried to find out how to streamline the work flow with Excel x Python ②
I tried to move machine learning (ObjectDetection) with TouchDesigner
I tried to make the weather forecast on the official line by referring to the weather forecast bot of "Dialogue system made with python".
I tried to create a table only with Django
I tried to extract features with SIFT of OpenCV
I tried to move Faster R-CNN quickly with pytorch
Preparing to use aws cli on Mac OS X
I tried to read and save automatically with VOICEROID2 2
I tried Python on Mac for the first time.
I tried to find out how to streamline the work flow with Excel x Python ④