This detailed and easy-to-understand page will help you set up things correctly on your own, and help you understand what you are doing
Or you can ask somebody to quickly configure everything for you, and keep on believing that things work by magic…
DISPLAY
variable several times: the X server needs this in order to know where to display the graphics!This page will very often mention local computers, and remote computers:
You don't need to do anything special!
Linux computers come pre-configured with a running X server that will display the graphics generated locally and on remote Linux servers
There are several available X servers, and applications that will allow X forwarding from a remote server to your local X server
You have to type $env:DISPLAY = “localhost:0”
before connecting using ssh -Y remote server
(-X
will not work), in order to have the DISPLAY
variable correctly defined on the remote server
PS C:\> ssh -X obelix [...] >echo $DISPLAY DISPLAY: Undefined variable. >logout Connection to obelix closed. PS C:\> $env:DISPLAY PS C:\> $env:DISPLAY = "localhost:0" PS C:\> $env:DISPLAY localhost:0 PS C:\> ssh -X obelix [...] Warning: untrusted X11 forwarding setup failed: xauth key data not generated [...] >echo $DISPLAY DISPLAY: Undefined variable. PS C:\> ssh -Y obelix [...] Warning: No xauth data; using fake authentication data for X11 forwarding. [...] >echo $DISPLAY localhost:42.0 >xterm& [1] 30038
VcXsrv
is pre-installed on the LSCE Windows computers!
Type: free
Download the installer from VcXrsv and install VcXsrv
.
You need to configure VcXsrv
to work in multiple windows mode. The following steps will show you how to create a shortcut on your desktop to start VcXsrv
in this appropriate mode
Start
⇒ VcXsrv
⇒ Xlaunch
Multiple windows
, then Next
Start no client
, then Next
Clipboard
settings, uncheck Native opengl
, then Next
Save configuration
and save an X_Server.xlaunch
configuration file on your Desktop, then Terminate
.X_Server
icon/shortcut on your DesktopX_Server
iconX_Server
icon on your desktop if you know that you will need an X server laterX
icon and select Exit…
if you need to quit the X serverx410 is a low cost commercial X server that can be directly installed from the Microsoft store.
This is an X server, and you will get the same functionalities as what is already provided for free by VcXsrv, but:
x410
will be automatically updated by the Microsoft Store applicationx410
again by just Connecting the Microsoft Store to your MS account on the new computer. No need to buy x410
again !VcXsrv
x410
name is easier to remember! Type: commercial
Buy and install x410
from the Microsoft store
x410
: Start
⇒ X410
X
icon to open the X410 settingsx410
when you open your session! Otherwise, it will stop when you close your Windows session or restart the computer, and you will have to restart it by hand (Start
⇒ X410
) if you know that you will need an X server laterStart
and select Task Manager
)Startup
panel (if there are no panels, select More details
)X140
and select Enabled
X
icon, and then click on the Display number at the lower left (usually 0
) and select Shut down
Type: free
Download the installer from XQuartz and install it
Nothing to configure!
The XQuartz
X server will be automatically started, if a graphical application needs it!
Check the launchd documentation if you need more details
$ launchctl list | grep quartz - 0 org.xquartz.startx
Nothing special to do, if you are using "ssh -X" or "ssh -Y" or a correctly configured PuTTY to connect to a remote Linux server
In that special case, you will need the X server to display graphics from the local virtual machine and from remote computers
You have to make sure that the DISPLAY
variable is correctly defined in the terminals used in WSL
The idea is to:
DISPLAY
environment variable is defined on the local machineWSL
DISPLAY
variable is automatically defined on the remote machineTest application:
xterm &
: the recommended test application. It will open a new terminal on the remote machinexeyes &
, xclock &
, gvim &
, gedit &
, eog &
, evince &
, … : other standard applications, that may be installed (or not)The test may fail, due to the usually expected errors
Open a terminal (terminal on a Mac) and use some basic commands to check things
[Local] $ hostname name_of_your_local_machine [Local] $ echo $DISPLAY :0 [Local] $ ssh -X some_login@some_remote_server [some connection information skipped here] [Remote] $ hostname name_of_the_remote_server [Remote] $ echo $DISPLAY localhost:20.0 [Remote] $ xterm &
We just open a Powershell
window (Start
⇒ Windows Powershell
⇒ Windows Powershell
) and type some basic commands, including the creation of a DISPLAY
variable
PS C:\> $env:computername name_of_your_local_machine PS C:\> $env:DISPLAY PS C:\> $env:DISPLAY="localhost:0" PS C:\> $env:DISPLAY localhost:0 PS C:\> ssh -Y some_login@some_remote_server Warning: No xauth data; using fake authentication data for X11 forwarding. [some connection information skipped here] [Remote] $ hostname name_of_the_remote_server [Remote] $ echo $DISPLAY localhost:19.0 [Remote] $ xterm &
We assume here that PuTTY is already installed and configured and correctly configured (with Enable X11 forwarding
)
We just have to open a pre-configured PuTTY Session on a remote server
[Remote] $ hostname name_of_the_remote_server [Remote] $ echo $DISPLAY localhost:19.0 [Remote] $ xterm &
We assume that WSL+Ubuntu is installed and that the DISPLAY
variable is configured correctly
Open a WSL terminal (you should know how, if you have installed WSL) and type some basic commands
[Local WSL] $ hostname name_of_your_local_machine [Local WSL] $ echo $DISPLAY localhost:0.0 [Local WSL] $ xterm & [Local WSL] $ ssh -X some_login@some_remote_server [some connection information skipped here] [Remote] $ echo $DISPLAY localhost:22.0 [Remote] $ xterm &
That's unfortunate, but:
If the DISPLAY
variable is defined, but there is no X server, you will get a Can't open display: localhost:[SOME VALUE]
error
$ xterm & xterm: Xt error: Can't open display: localhost:23.0
Time to read this page again…
If there is no space left in your home directory (usually the home directory of the remote server), or if you have exceeded your home disk quota, you will get an error similar to Error when there is no X server running
$ xterm & xterm: Xt error: Can't open display: localhost:23.0
Solution: clean the content of your home!
If the DISPLAY
variable is not defined (correctly), you will get a Can't open display: [NO VALUE DISPLAYED HERE]
error
$ xterm & $ xterm: Xt error: Can't open display: xterm: DISPLAY is not set $ echo $DISPLAY $ setenv DISPLAY CRAP_DISPLAY $ xterm xterm: Xt error: Can't open display: CRAP_DISPLAY
ssh -X
or ssh -Y
, or that PuTTY is configured with Enable X11 forwarding
ssh
in a Windows Powershell, read Using X forwarding in a Windows PowershellCheck the shortcut and run the command directly in a terminal to check the error message
There is a good chance that you have forgotten to start the X server!
It's hard to know what the best OpenGL settings for your X server are: it depends on your local computer, the remote computer, the network speed, the application generating the graphics, the libraries' versions…
Native opengl
is activated in VcXsrv
, you may have to also use the following environment variable on the remote computer: export LIBGL_ALWAYS_INDIRECT=1
VcXsrv
and the content of some displayed X windows appear blurry, see if you can fix the compatibility settings, or try to use x410.
[ PMIP3 Wiki Home ] - [ Help! ] - [ Wiki syntax ]