Mac linux x window

On this page:

UNIX/Linux applications with a graphical user-interface require the use of special display software when connecting from a remote location. Two methods are currently supported: X-windows and VNC. X-windows (X11) is recommended for most users, but VNC is useful when certain applications fail to run properly under X-windows, or when a persistent connection to the remote display is required. See Using VNC for information about VNC.

X-windows is the native display technology on UNIX and Linux systems and is designed for networked use. Because secure connections are required in the Stanford timeshare environment, SSH must be used to encrypt the X-windows connection; most SSH clients have built-in support for X display forwarding.

Using XQuartz on OS X

XQuartz is a free X11 server implementation for OS X. You can download the XQuartz application at MacOSForge.

  1. Verify that XQuartz is installed and launch the XQuartz application (located in the Utilities subfolder of the Applications folder). An xterm window should open by default. If no terminal window opens, start one by selecting Terminal from the File menu or pressing COMMAND + N.
  2. You may need to restart your computer after the installation of XQuartz, so try that if the following doesn’t immediately work for you.
  3. In xterm, connect to any Stanford timeshare using the ssh command. You must specify the -X option to enable display forwarding. (If the -X option doesn’t work try -Y.) For example:

ssh -X sunetid@rice.stanford.edu

In some cases, enabling compression by specifying the -C option can improve performance, especially when connecting from outside the campus network:

Using MobaXterm on Windows

The easiest thing to do on Windows is to use the free personal version of MobaXterm which includes an X11 server: https://web.stanford.edu/group/farmshare/cgi-bin/wiki/index.php/Mobaxterm

Using Xming on Windows

Xming is a freely available X server for Windows. It uses PuTTY, a built-in SSH client, to forward the display.

Note: These instructions assume you are using the version of PuTTY built into and distributed with Xming. You do not need to have a separate copy of PuTTY installed; if you do have a separate copy installed you should not start a separate instance of PuTTY with X-Windows forwarding enabled before connecting, unless you have configured Xming accordingly. Users of PuTTY may want to review the suggested configuration.

  1. Download and install the public domain releases of Xming and Xming-fonts.
    The default installation options for Xming should be sufficient. The 100dpi, Trutype, and Deja Vu fonts available in Xming-fonts are optional, but recommended.
  2. Once installation is complete, run Xming.
    • You can configure the display settings for each session as desired, but Multiple windows is standard.
    • Select the option to Start a program.
    • Use the default program, xterm, but choose Run Remote Using PuTTY Link (plink.exe) and make sure With compression is checked.
    • — You may connect to any Stanford timeshare computer (e.g., corn.stanford.edu). Log in using your SUNet ID, but leave the Password field blank; you will be prompted for your SUNet ID password upon connection.
    • No special parameter settings are required.
  3. Optionally, save this configuration for future use, and then connect, providing your password when required.
    An xterm window will open and the remote machine will display a standard UNIX prompt, as with normal connections. However, remote applications with a graphical user-interface will automatically use the local display.
  4. To end the session, quit all remote applications, type exit to close the xterm window. Xming will quit automatically when the xterm window is closed.

Using X11 on UNIX/Linux

Because X11 is the native display technology on UNIX and Linux systems it is possible to connect to any Stanford timeshare for remote display simply by opening a Terminal window and running ssh with the -X option.

    Open a Terminal window and connect to any Stanford timeshare using the ssh command with the -X option. (If the -X option doesn’t work try -Y.) For example:

ssh -X sunetid@rice.stanford.edu

In some cases, enabling compression by specifying the -C option can improve performance, especially when connecting from outside the campus network:

Источник

Tips and Tricks on Mac

Sometimes you might want to ssh to a linux box and be able to fire up X applications and see the X windows on your Mac running X11. However, there are some customizations you need to do before everything works.

  1. Fire up X11.app (It’s located in /Applications/Utilities/X11.app)
  2. On Mac box: go to X11 preferences and enable «Allow connections from network clients» (Make sure it looks like below)
  3. Restart X11.app
  4. Open a terminal in X11 and do: xhost +
  5. ssh to your linux box and do: export DISPLAY=IP_OF_MAC_BOX:0.0

Bingo! On the linux box, you can now run any X app, say xterm and the X window will pop up on your Mac box.

5 comments:

Thank you so much. This thing was driving me crazy, it was your tip to restart X11 that did the trick.

(only now I realize that the settings dialog explicitly say that a restart is required. Shame on me).

Won’t «ssh -X» do the same thing, and you won’t need to use xhost? xhost is not very secure. Much better to tunnel things through ssh.

Hi!
And what about all the way around?
Can i access my Mac using X11 forwarding from another Mac (or even from a linux machine)?
I’m trying to do this for a while but always unsuccessful

Great this is what i wanted..works great.

Источник

■ 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

構成Internet_xeyes.png

Try X from a Mac Book in an On-Premises environment with an Internet connection to OCI

■ 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.

MAC-HP01.png

・ XQuartz project: https://support.apple.com/ja-jp/HT201341

● XQuartz download

Download XQuartz from xquartz.org

MAC-HP02.png

・ Xquartz.org: https://www.xquartz.org/

● 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

[[email protected] 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.

[[email protected] 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)

[[email protected] ssh]# vi /etc/ssh/sshd_config | grep X11 ・ ・ ・ X11Forwarding yes X11DisplayOffset 10 X11UseLocalhost no ・ ・ ・ 

・ Check sshd_config settings

[[email protected] ssh]# cat /etc/ssh/sshd_config | grep X11 X11Forwarding yes X11DisplayOffset 10 X11UseLocalhost no # X11Forwarding no 
[[email protected] ssh]# systemctl restart sshd 

■ X window execution from MAC to OCI Linux Compute

● Start XQuartz

MAC-HP14.png

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

00.png

Terminal startup will start

  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 opc@1.2.3.4 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.
[[email protected] ~]$ env | grep DISP DISPLAY=10.0.0.2:11.0 

xeyes01.png

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.

Источник

Читайте также:  Сборка ядра kali linux
Оцените статью
Adblock
detector