Menu
When I run some programs over SSH, such as
firefox & , I get an error
Active1 year, 7 months ago
I would like to open many displays, still showing the
stdout of each program.
The X Window System (X11, or simply X) is a windowing system for bitmap displays, common on Unix-like operating systems. X provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting with a mouse and keyboard. X does not mandate the user interface – this is handled by individual programs.
Initial Question: How can I specify the display to get a many-displayed program?
Pablo Santa Cruz gives me the following code as a solution. I do not understand it.
What are Yuan Wen
yourmachine and yourdomain.com in the command?
68311 gold badge1111 silver badges3232 bronze badges
Léo Léopold Hertz 준영Léo Léopold Hertz 준영
50.4k140140 gold badges392392 silver badges615615 bronze badges
11 Answers
The way that X works is the same as the way any network program works. You have a server of some description (in this case, the X display server) which runs on a specific machine, and you have X clients (like firefox) that try to connect to that server to get their information displayed.
Often (on 'home' machines), the client and server run on the same box and there's only one server, but X is powerful enough that this doesn't need to happen. It was built with the server/client separation built in from the start.
This allows you to do such wondrous things such as log on to your box (in text mode) halfway around the planet, tell it that the display server is the box you're currently on and, voila, the windows suddenly start appearing locally.
In order for a client to interact with a user, it needs to know how to find the server. There are a number of ways to do this. Many clients allow the
-display or --display option to specify it:
Many will use the
DISPLAY environment variable if a display isn't specifically given. You can set this variable like any other:
The first part of the
DISPLAY variable is just the address of the display server machine. It follows the same rule as any other IP address; it can be a resolvable DNS name (including localhost ) or a specific IP address (such as 192.168.10.55).
The second part is X-specific. It gives the X 'display' (X server) number and screen number to use. The first (display number) generally refers to a group of devices containing one or more screens but with a single keyboard and mouse (i.e., one input stream). The screen number generally gives the specific screen within that group.
An example would be:
Here you have a single machine (
paxbox1.paxco.com ) with two display servers. Zoombinis game. The first has four screens and the second has two. The possibilities are then:
depending on where you want your actual windows to appear and which input devices you want to use.
Ilya Kogan
15.1k1313 gold badges6767 silver badges126126 bronze badges
paxdiablopaxdiablo
669k185185 gold badges13311331 silver badges17261726 bronze badges
Pablo Santa CruzPablo Santa Cruz
142k2929 gold badges208208 silver badges257257 bronze badges
When you are connecting to another machine over SSH, you can enable X-Forwarding in SSH, so that X windows are forwarded encrypted through the SSH tunnel back to your machine. You can enable X forwarding by appending
-X to the ssh command line or setting ForwardX11 yes in your SSH config file.
To check if the X-Forwarding was set up successfully (the server might not allow it), just try if
echo $DISPLAY outputs something like localhost:10.0 .
TobiXTobiX
Léo Léopold Hertz 준영
50.4k140140 gold badges392392 silver badges615615 bronze badges
sreenathsreenath
Narendra Pathai
25.8k1616 gold badges6868 silver badges111111 bronze badges
thegriglatthegriglat
I ran into a similar issue, so maybe this answer will help someone.
The reason for the AndrewAndrew
Error: no display specified error is that Firefox is being launched, but there is no X server (GUI) running on the remote host. You can use X11 forwarding to run Firefox on the remote host, but display it on your local host. On Mac OS X, you will need to download XQuartz in order to use X11 forwarding. Without it, you won't have a $DISPLAY variable set, so if you try and echo $DISPLAY , it will be blank.
106k165165 gold badges470470 silver badges648648 bronze badges
Please do NOT try to set $DISPLAY manually when connecting over SSH.
If you connect via SSH -X and $DISPLAY stays empty, this usually means that no encrypted channel could be established.
Most likely you are missing the package
xauth or xorg-x11-xauth . Try to install it on the remote machine using:
or
After that end and restart your SSH connection. Don't forget to use
SSH -X so that X Window output is forwarded to your local machine.
Now try JpsyJpsy
echo $DISPLAY again to see if $DISPLAY has been set automatically by the SSH demon. It should show you a line with an IP address and a port.
13.2k33 gold badges7878 silver badges8888 bronze badges
I faced similar problem today. So, here's a simple solution:While doing SSH to the machine, just add Ctrl - Y.
After login, type Léo Léopold Hertz 준영
firefox & . And you are good to go.
50.4k140140 gold badges392392 silver badges615615 bronze badges
Nandita ShuklaNandita Shukla
login to your server via
edit /etc/ssh/sshd_config file, and add this line to it.
Restart sshd. for CentOS (check your distribution)
check your DISPLAY
Linux X Windows Display Software
you should see this
Enjoy
Ammar BozorgvarAmmar Bozorgvar
Even i faced the same in CentOS 6.8.
End your current session and open another session in tool like mobiXterm. Make sure session has X11 forwarding enabled in the tool.
Srihari KaranthSrihari Karanth
I through vnc to understand the X11 more.To specify the display to get a many-displayed program, export DISPLAY=IP:DisplayNum.ScreenNum
For example,
YangYang
Not the answer you're looking for? Browse other questions tagged x11 or ask your own question.
Active7 years, 9 months ago
I want to ssh to remote servers, both running
CentOS with X11Forwarding enabled.
However the X application cannot run properly on one of them - on host B it works fine. But on host A I get the error 'couldn't connect to display', each time I launch X application.
After checking the
DISPLAY environment variable on host A which I think is related to X window, I found its value localhost:10.0 . Following the tips here, I change DISPLAY=0:10.0 and it works. However, DISPLAY on host B is still localhost:10.0 and works fine.
My question is, what does the value in
DISPLAY represent? What is the difference between localhost:10.0 and 0:10.0 ?
It is said that
localhost identifies a host name. Then which host does it identify, the server(host A/B) on which my X application is running or my local client where I want the X window to display?
Any hints or pointers to documentation would be appreciated.
Community♦
Summer_More_More_TeaSummer_More_More_Tea
52366 gold badges1010 silver badges2727 bronze badges
1 Answer![]()
Part of the answer can actually be found here: https://stackoverflow.com/questions/746119/how-do-you-use-display-specifications
DISPLAY variable is basically 3 components:
Export Display X11
As far as localhost aka 127.0.0.1 vs. 0.0.0.0 aka 0 is concerned you can take a look at this post:
Which explains the difference.
In your particular case 0.0.0.0:10.0 and localhost:10.0 would have the same effect but basically mean:
Practically there would be no difference since in the first case the scan of all interfaces would start with lo0, which normally is the first interface in the list.
Community♦
KarlsonKarlson
2,13322 gold badges1313 silver badges1515 bronze badges
Not the answer you're looking for? Browse other questions tagged linuxsshxorgsshd or ask your own question.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |