VNC black screen with a X cursor on Red Hat Enterprise Linux Server release 5.3 (Tikanga) [closed]
Want to improve this question? Update the question so it’s on-topic for Stack Overflow.
Closed 4 years ago .
Starting VNC server using vncserver :1 , client can connect to the server but it shows only a black screen with a X curser.
Contents of .vnc/xstartup is:
Is it a problem with this?
6 Answers 6
That has happened to me 2x, and I have been able to repair it 2x. It’s very likely only step 2. then 3. are required, but once I’ve found a way that works I’m loath to change.
- The .vnc/xstartup file was owned by root, so I changed ownership to user:
chown user /home/user/.vnc/xstartup - The .vnc/xstartup file was 664 (-rw-rw-r—.) — I assume vnc uses the ‘other’ permissions to connect and allow interactions, so I changed the permissions to 755:
chmod 755 /home/user/.vnc/xstartup - Restart the vncserver daemon:
service vncserver stop; service vncserver start
VNC viewer issue — showing black screen
Vnc viewer is showing black screen. Following are the configuration : Please figure out the issue ?
5 Answers 5
I figured I should answer my own question. in case anyone else runs into a similar problem. I just added localhost to xhost, and voila! took me a lot of hunting around to find this solution, so maybe this’ll help a couple of you.
/.vnc/xstartup shrug – khaverim Apr 7 at 17:02
I saw the same symptom. For me, the issue was how I used bsub to invoke vncserver.
Using ‘bsub -Is’ caused a black screen. Using ‘bsub -I’ fixed the issue.
I was launching x0vncserver from a remote ssh terminal. The server would run, but then connecting to vncviewer would show the black screen as mentioned above.
The solution: Launching x0vncserver from a terminal window on the host gnome environment.
I use this configuration with win2vnc, so I get dual monitor Windows + 3rd monitor linux side-by-side with one keyboard and mouse. Works great!
Windows-терминалы WTware
Программа-клиент службы терминалов Windows Terminal Services, для бездисковых терминалов и загрузки по сети. Основной сайт http://www.wtware.ru
Черный экран при подключении по VNC
Черный экран при подключении по VNC
Сообщение James123 » Пт дек 05, 2014 11:08 am
Re: Черный экран при подключении по VNC
Сообщение aka » Пт дек 05, 2014 1:12 pm
Re: Черный экран при подключении по VNC
Сообщение James123 » Пт дек 05, 2014 2:02 pm
Re: Черный экран при подключении по VNC
Сообщение aka » Пт дек 05, 2014 4:03 pm
Re: Черный экран при подключении по VNC
Сообщение James123 » Пт дек 05, 2014 5:21 pm
Re: Черный экран при подключении по VNC
Сообщение aka » Пт дек 05, 2014 10:22 pm
В логе четыре VNC сессии с тремя разными машинами. И во время активной сессии пыталась ещё подключиться, втварь так не умеет. У кого из четырёх был чёрный экран?
Можно такой лог сделать, чтобы в нём с самого начала, с загрузки, только одно соединение по VNC было, и оно было чёрным экраном?
Re: Черный экран при подключении по VNC
Сообщение James123 » Пн дек 08, 2014 1:25 pm
Re: Черный экран при подключении по VNC
Сообщение James123 » Вт дек 09, 2014 3:41 pm
Re: Черный экран при подключении по VNC
Сообщение aka » Вт дек 09, 2014 4:12 pm
Re: Черный экран при подключении по VNC
Сообщение James123 » Ср дек 10, 2014 12:54 pm
В ходе эксперементов обнаружилось следующее: если попытаться подключиться через VNC-Viewer 5.2.0 то получаем черный экран и следующую запись в логах:
[gm] [VNC] Client VNC version 8 (RFB 003.008).
[gm] [VNC] Password ok.
[gm] [VNC] 12 encodings.
[gm] [VNC] bits-per-pixel 8, depth 8, big-endian false, true-colour false.
[gm] [VNC] red-max 0x0000, green-max 0x0000, blue-max 0x0000.
[gm] [VNC] red-shift 0, green-shift 0, blue-shift 0.
[gm] [VNC] 12 encodings.
А если подключаемся через VNC-Viewer 4.1.3 то получаем нормальный доступ и тогда запись в логах следующая:
gm] [VNC] Client VNC version 8 (RFB 003.008).
[gm] [VNC] Password ok.
[gm] [VNC] bits-per-pixel 8, depth 8, big-endian false, true-colour true.
[gm] [VNC] red-max 0x0003, green-max 0x0003, blue-max 0x0003.
[gm] [VNC] red-shift 4, green-shift 2, blue-shift 0.
[gm] [VNC] 7 encodings.
[gm] [VNC] bits-per-pixel 16, depth 16, big-endian false, true-colour true.
[gm] [VNC] red-max 0x001f, green-max 0x003f, blue-max 0x001f.
[gm] [VNC] red-shift 11, green-shift 5, blue-shift 0.
[gm] [VNC] 16-bit server, 16-bit client.
[gm] [VNC] 7 encodings.
Судя по всему где-то в настройках VNC-Viewera 5-ой версии что-то не так. Но что?
TigerVNC server only getting black screen on connect #684
Comments
Copy link Quote reply
dearZac commented Jul 20, 2018 •
I have a production machine (recently built and many hours of configuration have been put into it), so I tried things on a different machine I had sitting around first.
On my testing machine, I was able to connect correctly. I repeated the same exact TigerVNC install process on my production machine, and when I connect I just get a black screen.
The text machine is Xubuntu 18.04, and the projection machine is Ubuntu server 18.04 with the Xubuntu desktop added on top (sudo apt-get install xubuntu-desktop) because I wanted to use the server’s install wizard to configure RAID.
I did a bunch of searching and found a different xstartup suggested here instead of the default created the first time vncserver is run: https://wiki.archlinux.org/index.php/Vncserver
#!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS exec startxfce4
(I’m not sure why the line breaks aren’t showing ^)
I don’t get black (I am able to see the desktop), but the log file has tons of errors (attached).
I’m assuming the default xstartup is fine (since it was on the other machine), and that I have something else going on.
Copy link Quote reply
jmadams1 commented Jul 24, 2018
I’m working through VNC issues as well on Xubuntu, Ubuntu Mate, and Lubuntu 18.04. I think I have it mostly figured out so far for Mate. My only guess I have for you is on the machine were you were getting the blank screen on with the configuration that ships with TigerVNC, was that you were also logged into the local GUI when you started the remote session.
The configuration file that ships with TigerVNC works great with 16.04 but doesn’t work in 18.04 when you’re running multiple sessions for the same user (either local GUI with vnc session or multiple vnc sessions.) That may not be TigerVNC’s fault, but a change in 18.04 that needs to be worked out.
The change you made to the xstartup file seems to get around a dbus issue in 18.04 that the original xstartup file exposes. I’m using a very similar xstartup for Mate that also allows me to have multiple sessions for the same user.
Looking at the log, I wouldn’t be concerned with the errors (that’s just my opinion.)
Copy link Quote reply
dearZac commented Jul 25, 2018 •
jmadams1, would you mind sharing your xstartup for Mate, so I can compare?
My only guess I have for you is . that you were also logged into the local GUI when you started the remote session.
I ran across the logged-in-locally problem you’re describing on my test machine, so I made sure not to log in on my production machine (even tried right after reboot launching the server via ssh then trying to connect), but it’s still black.
A few differences between my test machine and production machine that could be triggering this black screen issue:
- I have more than one user account on the production machine. I haven’t yet tried adding more accounts to the test machine.
- I have the production machine set to allow users to log in to the local GUI without typing a password (maybe the gui is started secretly before login because of this?).
- I have manually set one program to launch on login for one of my users in Application Autostart (in Session and Startup).
These are total wild guesses.
When I get a chance, I can try adding users to my test machine and see if I can get it to fail the same way. I’ll also try setting it so all local users require typing a password first.
I am kind of hoping that when the .deb files are made for 18.04 or when 1.9.x (or higher) is added to Ubuntu’s repo, that this issue will just magically go away.
Copy link Quote reply
jmadams1 commented Jul 26, 2018
Here’s a working xstartup file for Ubuntu Mate 18.04:
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80×24+10+10 -ls -title «$VNCDESKTOP Desktop» &
mate-session &
Copy link Quote reply
dearZac commented Aug 1, 2018
Thank you for your xstartup file.
From earlier:
I wish I knew enough to understand why you said you wouldn’t worry about the errors. I’d rather there not be a black screen more, though.
And Update:
I rules out difference #2 by making all users type a password to login locally. I ruled out #3 by turning off the auto launch of the one program.
I still haven’t tied adding more users to my test machine yet.
Copy link Quote reply
dragonator4 commented Aug 11, 2018
Facing the same issue here, and I repeated all that you discussed in this thread and in #668. Additionally, I discovered that running vncserver with sudo fixes the black screen, without the need to exec startxfce4 . I checked the permissions on Xauthority , xinitrc , and they all seem fine. The following is a bit more info:
I am running Desktop Ubuntu 18.04.1 on a desktop computer, and have configured another user. Both users have to enter passwords to log in. The guake terminal emulator starts with login for both users. I installed Tiger VNC through the Ubuntu repositories, then purged that install to copy over the generic Tiger VNC build (using rsync if that matters, as suggested in #668). The command I use to spawn the vncserver is:
which works almost perfectly fine with sudo , but gives a black screen without. I am attaching the logs produced with sudo and without. I am logged into the GUI of my user on the machine, and am launching the vncserver from a terminal. I am connecting to the spawned vncserver from the same machine using Remmina ( localhost:5904 ).
It almost works perfectly with sudo because the Ubuntu 18.04 dock does not show up in the remote desktop. However, a small dock does appear when I click on activities. Gnome shell extensions and other settings are carried over.
Copy link Quote reply
dragonator4 commented Aug 11, 2018
And the other thing I noticed was that $HOME/.Xresources is not created, and does not exist. This is the case when run as user and as root.
I’m trying to enable remote login for both users on the machine, using the method in this SO question and answer I asked. I’m not sure starting vncserver as root is a workable solution.
Copy link Quote reply
dragonator4 commented Aug 13, 2018
I modified the xstartup file shared by @jmadams1 by changing mate-session to gnome-session . I can get this modified xstartup file to work correctly if and only if I am logged in to the GUI of the physical machine. If I am not logged in, I get org.gnome.Shell.desktop errors. Check the journalctl log file attached.
Changing the mate-session to startxfce4 gives the Xfce4 desktop, without the errors @dearZac reports (I was getting the same errors with exec startxfce4 in the xstartup ).
Copy link Quote reply
CendioOssman commented Aug 16, 2018
I am working on a new, more systemd compatible, startup of vncserver. It sounds like it might solve the issues you guys are seeing.
Copy link Quote reply
krent84 commented Feb 5, 2019
I also see a black screen on my Fedora
29 when launching the vnc through the systemd.
If you run from the command line, then everything works fine.
Copy link Quote reply
rolfvreijdenberger commented Feb 20, 2019 •
+1 on getting the black screen on fedora 29.
launching vncserver from the cmd line as a normal user works fine and I get a normal desktop.
using the provided systemd service files (template) does not work since I get a black screen and a window with «enter password to unlock your login keyring».
one difference I noted was that the xauthority file was different for both types of startup:
cmd line: /usr/bin/Xvnc :1 -auth /run/user/1000/gdm/Xauthority
systemd: /usr/bin/Xvnc :1 -auth /home//.Xauthority
Copy link Quote reply
perrstep commented Feb 28, 2019
+1 on the Fedora 29 black screen here too.
Copy link Quote reply
tlaronde commented Apr 16, 2019
FWIW, I have the same issue on a NetBSD node. I’m launching a VNC server at boot time, as a specific user. The applications and the window managers complain that they can’t open the DISPLAY so I get a black screen.
In the xstartup script, I circumvent the problem by testing the return status of the window manager (in my case, twm) and if there is an error, sleeping and restarting the Vnc server.
What I don’t get is why it fails the very first time and succeeds the next. I suspected that some system services were not fully launched but to no avail.
Best regards to the developers.
Copy link Quote reply
etienne678 commented May 16, 2019
I had this issue too on ubuntu, and on my side it was the power management settings.
after i set them to never turn off the screen this never happened again.
Copy link Quote reply
Copy link Quote reply
John-Whitehead commented May 19, 2019 •
Can confirm still happening (the black screen) on Fedora 30. Very easy to reproduce:
- Boot Fedora 30 Workstation Live from DVD-ROM or USB
- sudo dnf install tigervnc tigervnc-server
- vncserver :10
- vncviewer :10
Copy link Quote reply
CendioOssman commented May 21, 2019
Just a FYI, that method will probably never be supported. In general a modern Linux system doesn’t allow multiple sessions as the same user. So the VNC session will need to be started as a service, and the user cannot be logged in locally.
Copy link Quote reply
dwreski commented May 23, 2019
Is there another solution? Another vncviewer implementation? Perhaps x0vncviewer?
One problem I’ve had is that I’ve been able to connect and view the remote desktop, but any subsequent windows that were created are displayed on the actual desktop, not my viewer virtual desktop.
I can connect to the remote machine via ssh as a regular user, then run the following:
vncserver :1 -geometry 800×600 -depth 24
It then prints the following when I connect:
Thu May 23 18:38:10 2019
vncext: VNC extension running!
vncext: Listening for VNC connections on all interface(s), port 5901
vncext: created VNC server for screen 0
Thu May 23 18:38:14 2019
ComparingUpdateTracker: 0 pixels in / 0 pixels out
ComparingUpdateTracker: (1:-nan ratio)
Thu May 23 18:38:38 2019
Connections: accepted: 68.195.199.42::43322
SConnection: Client needs protocol version 3.8
SConnection: Client requests security type VeNCrypt(19)
SVeNCrypt: Client requests security type TLSVnc (258)
VNCSConnST: Server default pixel format depth 24 (32bpp) little-endian rgb888
VNCSConnST: Client pixel format depth 24 (32bpp) little-endian rgb888
It then prompts me for my password three times — the first to «create a color profile», the second to «refresh the system repositories» and the third to again «create a color profile.»
After authenticating, it displays the standard display manager screen, but running an application like a terminal or the file manager appears to start, but apparently displays on the console display, not my virtual display.
$ cat .vnc/xstartup
#!/bin/sh
PATH=/usr/bin:/usr/sbin
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec /etc/X11/xinit/xinitrc
Copy link Quote reply
CendioOssman commented May 24, 2019
I’m afraid the issues you describe sound like other things.
One problem I’ve had is that I’ve been able to connect and view the remote desktop, but any subsequent windows that were created are displayed on the actual desktop, not my viewer virtual desktop.
You cannot be logged in locally and have a VNC session running at the same time. This is a limitation of modern Linux systems, and not us, so it’s not something we can do much about.
It then prompts me for my password three times — the first to «create a color profile», the second to «refresh the system repositories» and the third to again «create a color profile.»
This is a (well known) bug in your desktop environment. Please nag them. It seems we need to be a lot of us before they consider this a priority to fix.