Difference between revisions of "Xwindows"

From UCT EE Wiki
Jump to navigation Jump to search
Line 46: Line 46:
 
   2. Once installed (and started, which happens after install by default) you will get a XMing logo appear in your taskbar:
 
   2. Once installed (and started, which happens after install by default) you will get a XMing logo appear in your taskbar:
  
[[File:Xminglogo intaskbar.jpg|center|40px|xming]]
+
[[File:Xminglogo intaskbar.jpg|center|xming]]

Revision as of 08:39, 11 March 2022

Overview

The X Window System, or X11, is a windowing system used for Linux and Unix operating systems. X provides the basic infrastructure for a GUI environment. A useful aspect of this is that you can export the display from your Linux shell login to a different display on the PC you are using or to a desktop on a remote computer. Or even a virtual desktop that you can set up using VNC or TightVNC - this VNC desktop you can then view on the same or different computer from either Windows or Linux.

The X.Org Foundation leads the X project and hosts reference implementation for it. X is available as free and open-source software under the MIT License. For more information on the X standard see the X.Org Foundation https://x.org/wiki/, and https://en.wikipedia.org/wiki/X_Window_System.

Exporting X display

You can export your Linux X display using the DISPLAY environment variable in Linux. This can be done either to another Linux machine or to a Windows machine where you are running a X server. The tips below indicate the procedure of how to export the display.

Export display from Linux to Linux

Assuming you have your Linux desktop open, and you want to log into another machine, let's call it remotepc, via ssh.

How to export display automatically via ssh -X option:

Open a terminal window. Type in the following:

 xhost +           # this will allow other systems to display to your machine
 ssh -X remotepc   # this will login in to remotepc and export the display to where you logged in from

This is all you should need to export the display to the desktop you logged in from. Test it out by starting another terminal, e.g. run: xterm & and see that the terminal pops up on your desktop.

If the -X option did not work, then from your local machine do as follows:

 ifconfig                       # find what IP address your machine is using
                                # e.g. consider that your machine has IP 192.168.0.1
 xhost +                        # allow other machines to connect to your display
 ssh remotepc                   # this login in to remotepc but doesn't attempt to automatically export display
 export DISPLAY=192.168.0.1:0   # explicitly export display to your local machine, to desktop 0

You should now be able to start programs on the remote machine and have any GUI for the program open up on your local machine. You could test it using xtern & and see if a new terminal window pops up.

Export display from Linux to Windows

In order to export the display from Linux to Windows, you need to have an XWindows server installed on your local machine. An excellent and free option is use of the XMing server available for Windows, see https://sourceforge.net/projects/xming/.

Alternatively, you can set up a VNC server on the Linux machine you are logging in to, to create a virtual desktop. Then export the display to the VNC virtual display, and use a VNC viewer on Windows (or Linux) to view and interact with the virtual display.

On Ubuntu Linux, you can simply install a vncserver using apt-get, TightVNC server is suggested as it can save bandwidth, can install using: sudo apt install tightvncserver.

The following indicates how to setup and access a Linux GUI displays using XMing viewer on Windows:

 1. First install XMing on your Windows machine (see: https://sourceforge.net/projects/xming/)
 2. Once installed (and started, which happens after install by default) you will get a XMing logo appear in your taskbar: