DEPARTMENT OF COMPUTING

Resources: View X-Windows Programs

Some applications require a server for the “X Window System”. This is one of original windowed (pixel based) environments used in Unix-style operating systems. This document is specifically for students in CS 3005, CS 4300, and other courses that have a need for this system.

The X Window System treats the display as a server application that has full rights to the video card, monitor, keyboard, mouse, and any other user input/output devices. Any application that wishes to communicate with the user by displaying to the screen, reading from input devices, etc. is a client in this system.

Installing the X Window System

Debian, Ubuntu, Other GNU/Linux based systems

If you have a graphical interface, it already has an X Server running. Just log into the graphical console. You can launch applications on the system through the menu system or command line, and they will be able to connect to your display server.

If you are on a text-console installation, you need to install the “Desktop” options to have a graphical system.

If you are logged in remotely to a system using SSH, you are using that system as a text-console. You need to look at X-Forwarding through SSH, and make sure you have an X Server running on the system you used to connect to the remote Linux system.

Windows

This assumes you are running the Windows Subsystem for Linux (WSL2) and wish to run Linux applications that have a graphical display.

Install XMing in Windows for displaying graphical applications. (Download the “Public Domain” version for free.)

Inside of a bash prompt edit your .profile and add these lines at the bottom:

export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0
export LIBGL_ALWAYS_INDIRECT=1

This will make it so that any future bash prompts will have the DISPLAY environment set correctly to send display information to the XMing program in Windows. Test if it has been set correctly, by launching a new bash prompt and issuing the command printenv DISPLAY. If the correct value is show, you should be good to go. The correct value should look something like 172.25.1.1:0, but not literally that string. If not, make sure the .profile that was edited was in your home directory and that you are in a bash prompt that was launched after the correct edit.

XMing will need to be configured with the ‘no access control’ option. This can be set by using XLaunch to start configure and start XMing.

Test the setup by running a simple program like xeyes.

If you are still using WSL (not WSL2), either upgrade or test your internet search skills.

Mac OS X

This assumes you are building programs on the Mac OS that need an X Server, and want to run them on your Mac.

Install XQuartz.

You may need to launch XQuartz before trying to launch a program that connects to it.

No-Install Option

Use the Linux computers in the Smith building. You can do this physically in the lab. If you remote into them, you’ll need an X Server on the system you are connecting from.

Last Updated 11/19/2021