Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I don't think it is related to VNC. I would try to set DISPLAY=:0 (which is usually the default). I don't really understand why do you have :1 set.
He gets that if he has more than one session of X running.
If a single X session is running locally, and one is running under VNC, then the local would normally be display :0 and the first VNC session might be :1 or :10 depending upon the settings. A second VNC session might be :2 or :11.
If the display value being in the command does not match the display number of the session is ONE of the ways you might get that message. There are others, but I would check that early.
Another is if you are running the session as one user, and you sudo to another user to run the command. The logon user ONLY for the session has ownership and control of that display: any other user must be granted access or jump through an extra hoop to run things on the display. Do it wrong, and that is the warning that you see.
Let us know where thinking about thost things gets you. I am very interested in what you find.
Like i said, i did NOT change the value of the DISPLAY env var. I am running every single command as myself (user "bwayne") in that VNC session ( :1 )
I don't understand why i'm getting this error, so i went ahead and ran "vncserver -kill :1" to kill that VNC session and restart the vncserver.
After killing my vncserver and restarting, i connected to that session ( :1 ) using vncviewer and am able to open various windows inside that session ( :1 ).
However, i'd like to understand why i'm encountering this error in the first place. Restarting the vncserver is not an ideal solution as i lose all of my terminals/windows.
--Andrew
Last edited by needanswers; 02-12-2018 at 01:03 PM.
that VNC server is started by another user, or it has already died or it is a firewall issue or .....
Unable to open :1 means that display does not exist at all (or at least not available from the client side). -nolisten restricts where is is reachable from.
that VNC server is started by another user, or it has already died or it is a firewall issue or .....
Sorry if i wasn't clear. Everything is run as the same user ("bwayne") :
1. vncserver is started as "bwayne"
2. from Windows, i connect to that vnc session ( :1 ) and from the existing xterm windows, i try to launch "firefox", other xterms, and other GUI apps as user "bwayne"
I'm not sure how the problem could be firewall-related. Both the vncviewer (running on Windows laptop) and the vncserver (Linux machine) are at my company.
Quote:
Unable to open :1 means that display does not exist at all (or at least not available from the client side). -nolisten restricts where is is reachable from.
The display STILL exists because i can still connect to that vnc session ( :1 ) via vncviewer. After i am connected, i still see the MATE desktop, the menus ("Applications", "Places", "System") and various panels.
However, from an existing xterm window running inside that vnc session ( :1 ), i get "cannot open display: :1" when i try to launch "mate-calc" (the MATE calculator), "firefox", "xterm", etc... as user "bwayne".
After not finding any solutions, I went ahead and restarted the vncserver and everything is fine for now. However, this problem happened before and it's just a matter of time before it happens again.
Any other insights would be greatly appreciated.
Thanks
--Andrew
Last edited by needanswers; 02-13-2018 at 03:35 PM.
There is no "The display". There is a display which still exists and you can connect to it and there is :1 which is unavailable. And I still don't know what's happening. Probably that is another display (:0, :2 or ...), probably blocked by firewall/whatever, probably created by someone else I have no idea. Or just the vnc server itself died. did you check the log files already?
There is no "The display". There is a display which still exists and you can connect to it and there is :1 which is unavailable.
Apologies, i guess i'm still not being clear. By "The display", i meant the :1 display.
In the "VNC Server:" text field of the vncviewer application, i type in "<the_linux_machine_name>:1" (without the quotes) to connect to the VNC server.
Quote:
Or just the vnc server itself died.
If the vncserver was dead, then i wouldn't be connected to <the_linux_machine_name>:1 via vncviewer where i see the MATE desktop, etc.... and everything is still working (other than not being able to open additional GUI apps/windows)
The DISPLAY env var has always had the value of ":1" (without the quotes and i assume this value is set by the VNC server)
Quote:
Probably that is another display (:0, :2 or ...), probably blocked by firewall/whatever,
yes... there is a :2 display. When i connect to "<the_linux_machine_name>:2" (without quotes) via vncviewer, i can open xterms, etc... inside that session ( :2 ) and the DISPLAY env var is set to ":2" (without quotes) and the :2 VNC session was started by userid "bwayne" ("bwayne" is also the userid that started the :1 VNC session)
There is no firewall issue as far as i can tell.
As far as i can tell, nothing stood out in the log files.
Anyway, i guess this is one of those mysteries that cannot be solved.
Thanks
--Andrew
Last edited by needanswers; 02-14-2018 at 01:54 AM.
Not every mystery gets solved, and not every mystery SHOULD be solved, but every mystery CAN be solved. This one should leave a trail in a log file indicating WHY the desktop cannot be addressed. Have you tried bouncing the acceptance using xauth during the session?
there are several things you check:
:1 is local and does not require real network connection.
<host>:1 will go thru the net, so probably vncserver still listens on hostort, but not on localhostort. It looks like - at least for me - xnvc related (internal) error and probably you can find some related logs - if configured at all. But this can be a locked thread too, which is not logged.
xnvc itself is relatively complex because it contains the x server itself and the vnc server too.
But if you have two (or more sessions) using the same user id probably the servers conflict with each other and one of them will die (just because the second one will remove something which is unnecessary for this "second" server - for example a socket - and that will kill the connection to the first one.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.