Great, you'll start the server but you'll still receive the dark screen. And then you'll get the desktop at No more dark screen. As of the latest centos RHEL 7. Rather, it monotonically grows while it is expected that the pid file match that specified in the service name designated by the admin. This does not occur. Manually removing these after shutting down all vncserver services with the exception of X0 for the X server , resolves this problem.
The original issue is still present where even with the correct display number, systemd cannot stop the vncserver process and still emits an error on the PID which it no longer creates as it is owned by root:. Oct 03 berne systemd: Unit vncserver Oct 03 berne systemd: vncserver I built a new 7.
I did try to remove the -l option in the config. Now I get a timeout issue insteasd of message about PID not not belonging to service and owned by root. This does seem to partially prove systemd is the culprit. Check your systemd version - rpm -qa grep systemd My next test is a 7. More to follow I just built a new 7. I followed the RedHat official instructions with no success. After multiple iterations of testing, I finally found out how to make it work.
Note that this is for a single user. First, remove the runuser command since we can't use the -l option. You can't just remove the -l flag. Second, start the service once as the user. The official instructions leave this part out. Once you do both of those things, then everything works correctly.
So here's my full procedure. Install vnc 2. Mine is listed below. No other action here, no need to kill vnc or anything. I'm a bit of a noob at this, so I don't have full insight as to why this works, but it does for me. After I had made my initial posts above I did find a related Bugzilla. Problem solved. Following Martin's instructions verbatim did not work for me.
I still needed to manually start the vnc server once as the user as per my steps. There is also another issue: this works fine if you vnc into the server, then just close the vnc window. You can then reconnect. But if you vnc into the server, and then Log Out of the user account, the vnc service is killed and has to be manually restarted from an SSH session.
It seems like the vnc service should not do this. I am ok with this issue because I am aware of it, but it is not really good behavior. Leigh, I have also encountered the same issue you describe when logging out. I recall having to add an additional line or two in the service config section. Using that type of technique worked for me prior to the systemd changes. I was experimenting with this issue last night using the new version of systemd after a fresh rebuild of a server using tigervnc.
I'll see if I can confirm a working config for automatically restarting the service upon logout and post back here. I did play around with trying to get the service to restart automatically. I haven't had any luck. I tried restart always or on-failure both ways but one at a time. Any ideas? A caution in regard to the vncserver issue with RHEL 7. Based on my setup none of the suggestions, I have tried, resolve issue without creating a bigger problem. On the surface the suggestion to change the ExecStart entry and add the User and Group entries looks good.
This does appear to allow the server to start cleanly and for it to be properly shutdown and restart provided you start with things clean. However, this configuration when using Gnome with screen locking active is unusable. I cannot unlock the session once the screen lock triggers. I start to type the password and it automatically jumps back to the beginning clearing out what I have entered.
With screen saver disabled it looks like the vnc session is fine but we need to maintain screen locking. At moment for me the best approach is to run with the traditional RHEL 7 recommend configuration and just keep in mind that it will not stop or restart properly and to watch for extraneous lock files.
As long as I start it and let it run until reboot I have no functional issues although I do get the "resource limit was exceeded message". I can't get this to work. I'm using the exact same service file as posted by Vincent Cojot. The service is actually starting and I'm able to connect to the machine from a vnc viewer client, but at the login screen I can't type in the password because the screen gets cleared every second. Hi Jhonathan, sorry to hear that you're still experiencing issues.
The service file's only purpose is to get the service started. You may want to check what's in that file. Also, I don't think you should see a login screen -after- connecting with the viewer password. It should bring you directly to the Xvnc desktop running under the user specified by the service file.
Update: situation with starting up the server improved after a yum update and the instructions given in the VNC chapter of the sysadmin guide will work- to a point. The point being the number of VNC server service under which you'd be connecting from remote computer. In practice, this will not work. Once you started VNC server on, say, display no. If you decided to start the service with, say: systemctl start vncserver If the service was started with 2. That seems to be the only part missing in the VNC chapter, everything else works as described.
I have had some luck with this. What worked from me is ensuring that the PIDfile line was not present in the unit file and then I was able to get an Active status when I start the service. This is what my unit file looks like I'm new here so, apologies if I have violated any formatting rules for bash scripts :.
And this is what my xstartup file looks like for gnome, I've commented out the default lines that come with the file:. Hello to anyone landing here. Please keep in mind this discussion was started in , and now it is 7 years later as I type this, Please keep in mind that some of the posts address this from various earlier versions of Red Hat Linux.
As a basic observation and from much frustration with Tiger VNC server installation -- it is a mess. I have faced one recent issue about TigerVNC to many authentication failure error in rhel 7. Note : After made the entry in below configuration file reload the deamon systemctl deamon-reload " checked the status of configured vnc profile.
Jan 26 inhyd-s-pans Jan 24 inhyd-s-pans01 systemd: vncserver Comments Command line log: sudo systemctl start vncserver Jul 30 localhost. Hint: Some lines were ellipsized, use -l to show in full. Newbie 15 points. Log in to join the conversation. Red Hat Community Member 72 points. Jaromir Hradilek. Hi Itay, First of all, thank you very much for taking the time to report this issue.
SW Red Hat Guru points. Stephen Wadeley. Hello Bug was resolved and a new version published: Revision 0. Thank you. IE Newbie 15 points. There's no way to set vino to only listen for the next connection. To set a password, tick Require the user to enter this password: , and enter a hard-to-guess password.
To put vino in view-only mode, untick Allow other users to control your desktop. To only allow local connections, open a terminal and run the command: gsettings set org. Vino network-interface lo To allow connections from anywhere, open a terminal and run the command: gsettings reset org.
Vino network-interface x11vnc x11vnc is a VNC server that is not dependent on any one particular graphical environment. It can be started while your computer is still showing a login screen. It is helpful to ensure you have uninstalled any other VNC programs first so that they don't interfere with x11vnc.
To set x11vnc to only listen for the next connection, include the -once option. To set x11vnc to continually listen for connections, include the -forever option. To put x11vnc in view-only mode, include the -viewonly option. To set x11vnc to only allow local connections, include the -localhost option. Xauth -display :0 options to be specified on the command-line.
The argument value for the -auth option may be found previously with x11vnc -findauth. Xauth -display :0 If you find a blank screen, check the x11vnc FAQ entry on headless servers. Because it's highly integrated with KDE, running it in other environments is difficult. To set krfb to request access each time, tick Confirm uninvited connections before accepting To set a password, type a hard-to-guess password into the Password input box.
To put krfb in view-only mode, untick Allow uninvited connections to control the desktop. There's no built-in way to only allow local connections, although see below for a solution. Once mode Krfb doesn't have a built-in way to accept the next connection then stop listening for connection attempts. However, the following Python script will listen for a single connection then exit krfb:!
Make sure that the initial ' ' character is the very first character in the file, save the file as krfb. Although this simple program won't open a window of any kind, it will quietly wait for the next VNC client to connect to your computer, then pass the connection through to krfb.
This script will only listen for local connections. To allow connections from anywhere, change Invitations Krfb lets you create "invitations", or individual passwords that are deactivated after an hour or after one use. These are a handy way of giving people one-time access to a computer, but only provide limited security.
For example, if you send someone an invitation by e-mail or instant messaging, an attacker could read your invitation message as it went over the Internet and use it to log in. Invitations can be useful when you want to let other people view your desktop, but you still need to follow the normal precautions when letting other people view your desktop. This makes it much less useful for some things like remote help , but much more useful for others like creating a public area for collaboration.
Like x11vnc, tightvnc is designed to be run from the command-line. To start it, type: tightvncserver -nolisten :1 This will tell tightvnc to listen for VNC connections on port from anywhere on the Internet.