vncserver failed

Issues related to applications and software problems and general support
Post Reply
ShinShin
Posts: 3
Joined: 2020/11/16 23:38:10

vncserver failed

Post by ShinShin » 2020/11/17 00:48:11

Excuse me for writing by my poor English.

I followed https://www.linuxtechi.com/install-conf ... os8-rhel8/.
But I can't start vncserver just below.

Code: Select all

$ sudo systemctl start vncserver@:1.service
Job for vncserver@:1.service failed because the service did not take the steps required by its unit configuration.
See "systemctl status vncserver@:1.service" and "journalctl -xe" for details.

Code: Select all

[shin@server ~]$ sudo systemctl status vncserver@:1.service
● vncserver@:1.service - Remote desktop service (VNC)
   Loaded: loaded (/etc/systemd/system/vncserver@.service; disabled; vendor preset: disabled)
   Active: failed (Result: protocol) since Tue 2020-11-17 08:56:15 JST; 5s ago
  Process: 4228 ExecStart=/sbin/runuser -l shin -c /usr/bin/vncserver :1 -geometry 1280x1024 (code=exited, status=0/SUCCESS)
  Process: 4225 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill :1 > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)

11月 17 08:56:15 server systemd[1]: Starting Remote desktop service (VNC)...
11月 17 08:56:15 server systemd[1]: vncserver@:1.service: Can't open PID file /home/shin/.vnc/server:1.pid (yet?) after start: No such file or d>
11月 17 08:56:15 server systemd[1]: vncserver@:1.service: Failed with result 'protocol'.
11月 17 08:56:15 server systemd[1]: Failed to start Remote desktop service (VNC).

Code: Select all

[shin@server ~]$ journalctl -xe
-- Support: https://access.redhat.com/support
-- 
-- The unit vncserver@:1.service has entered the 'failed' state with result 'protocol'.
11月 17 08:56:15 server systemd[1]: Failed to start Remote desktop service (VNC).
-- Subject: Unit vncserver@:1.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
-- 
-- Unit vncserver@:1.service has failed.
-- 
-- The result is failed.
11月 17 08:56:15 server systemd[1]: session-c5.scope: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
-- 
-- The unit session-c5.scope has successfully entered the 'dead' state.
11月 17 08:56:15 server sudo[4222]: pam_unix(sudo:session): session closed for user root
11月 17 08:56:20 server sudo[4279]:      shin : TTY=pts/0 ; PWD=/home/shin ; USER=root ; COMMAND=/bin/systemctl status vncserver@:1.service
11月 17 08:56:20 server auditd[801]: Audit daemon rotating log files
11月 17 08:56:20 server sudo[4279]: pam_systemd(sudo:session): Cannot create session: Already running in a session or user slice
11月 17 08:56:20 server sudo[4279]: pam_unix(sudo:session): session opened for user root by shin(uid=0)
11月 17 08:56:21 server sudo[4279]: pam_unix(sudo:session): session closed for user root
[shin@server ~]$
According to this result vncserver is already running in a session or user slice.
But I can't stop and disable it because I've made and deleted and run a lot of files by a struggle to start vncserver to see other various web sites.

How should I do to start vncserver. Please help me.
Shin

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: vncserver failed

Post by TrevorH » 2020/11/17 09:23:15

Does /home/shin/.vnc/ exist? Is it owned and permssions set correctly? Did you set a vnc password and have it store it in that directory?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

ShinShin
Posts: 3
Joined: 2020/11/16 23:38:10

Re: vncserver failed

Post by ShinShin » 2020/11/17 23:48:17

Thank you, TrevorH.
Does /home/shin/.vnc/ exist? Is it owned and permssions set correctly? Did you set a vnc password and have it store it in that directory?
Of course.

Code: Select all

[shin@server ~]$ LANG=en ls -la /home/shin/.vnc
total 8
drwxrwxr-x   2 shin shin   20 Nov 17 06:51 .
drwxr-xr-x. 21 shin shin 4096 Nov 17 08:57 ..
-rw-------   1 shin shin    8 Nov 17 07:41 passwd
[shin@server ~]$ 
Please help me.

gerry666uk
Posts: 98
Joined: 2020/02/10 19:06:06

Re: vncserver failed

Post by gerry666uk » 2020/11/23 16:07:42

When using RHEL / CentOS, it's important to follow the official guides

https://access.redhat.com/documentation ... h-tigervnc

NOTE that this guide is for RHEL7, I can't find the RHEL8 version, and there may be some changes, but see also the man pages they make reference to at the end of the article.

This guide covers a number of scenarios - per user, per machine, clients, servers, gdm, remote desktops etc, so it's important to clarify the goal, and then follow the relevant paragraphs. The guide you cited above says you need to disable SELinux, and that's not good.

ShinShin
Posts: 3
Joined: 2020/11/16 23:38:10

[Solved]vncserver failed

Post by ShinShin » 2020/11/26 09:47:19

Thank you, gerry666uk.

Your link of the official guides is very very useful!
I removed all packages and settings of vncserver. Then I followed it and succeeded.

NOTE that the part of
13.1.2. Configuring VNC Server
Configuring a VNC Display for a Single User
2. Edit

is not needed for my CentOS Stream 8 environment. The part happens a error later. The remaining parts are right.

But "13.2. Sharing an Existing Desktop" couldn't succeed.

Code: Select all

[shin@server ~]$ x0vncserver -PasswordFile=.vnc/passwd -AlwaysShared=1
x0vncserver: unable to open display ""
[shin@server ~]$
This is a next problem.

Finally I solved my first issue about vncserver.
Thank you very much!

gerry666uk
Posts: 98
Joined: 2020/02/10 19:06:06

Re: vncserver failed

Post by gerry666uk » 2020/11/26 14:35:54

Good news that you were able to get it working, at least in one of the scenarios.
In addition to the RHEL7 guide above, I have now found a similar guide for RHEL8

https://access.redhat.com/documentation ... -in-rhel-8

It's worth using both guides. The RHEL8 guide (again) shows different scenarios and is good as an introduction. My own attempt at this most closely aligns with the "multi-user" scenario using Linux TigerVNC Client, but having never seen either of these guides at the time, I ended up with a slightly different config, basically by reading all the man pages locally, and then looking at all the vnc related systemd configuration files.

Post Reply