새로 설치된 CentOS 7 서버 버전 centos-release-7-4.1708.el7.centos.x86_64에 TigerVNC를 설치하고 싶습니다.
그래서 이미 시도한 다른 튜토리얼 외에도 다음을 따랐습니다. 레드햇 가이드. 그러나 튜토리얼의 다양한 오류 메시지에 따라 서비스를 시작하지 않았습니다. CentOS 7을 새로 설치할 때 수행한 작업은 다음과 같습니다.
yum install tigervnc-server
cp /usr/lib/systemd/system/[email protected] /etc/systemd/system/[email protected]
vi /etc/systemd/system/[email protected]
초기 파일 내용:
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
User=<USER>
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=-/usr/bin/vncserver -kill %i
ExecStart=/usr/bin/vncserver %i
PIDFile=/home/<USER>/.vnc/%H%i.pid
ExecStop=-/usr/bin/vncserver -kill %i
[Install]
WantedBy=multi-user.target
편집된 파일 내용:
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
User=root
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=-/usr/bin/vncserver -kill %i
ExecStart=/usr/bin/vncserver %i
PIDFile=/home/root/.vnc/%H%i.pid
ExecStop=-/usr/bin/vncserver -kill %i
[Install]
WantedBy=multi-user.target
파일 편집 후 설명:
systemctl daemon-reload
su - root
vncpasswd
systemctl start vncserver@:1.service
Job for vncserver@:1.service failed because a timeout was exceeded. See "systemctl status vncserver@:1.service" and "journalctl -xe" for details.
[root@localhost ~]# systemctl status vncserver@:1.service
● vncserver@:1.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/[email protected]; disabled; vendor preset: disabled)
Active: failed (Result: timeout) since Wed 2018-01-03 09:00:17 UTC; 22s ago
Process: 2045 ExecStart=/usr/bin/vncserver %i (code=exited, status=0/SUCCESS)
Process: 2040 ExecStartPre=/usr/bin/vncserver -kill %i (code=exited, status=2)
Jan 03 08:58:50 localhost vncserver[2045]: New 'localhost:1 (root)' desktop is localhost:1
Jan 03 08:58:50 localhost vncserver[2045]: Creating default startup script /root/.vnc/xstartup
Jan 03 08:58:50 localhost vncserver[2045]: Creating default config /root/.vnc/config
Jan 03 08:58:50 localhost vncserver[2045]: Starting applications specified in /root/.vnc/xstartup
Jan 03 08:58:50 localhost vncserver[2045]: Log file is /root/.vnc/localhost:1.log
Jan 03 08:58:50 localhost systemd[1]: PID file /home/root/.vnc/localhost:1.pid not readable (y...art.
Jan 03 09:00:17 localhost systemd[1]: vncserver@:1.service start operation timed out. Terminating.
Jan 03 09:00:17 localhost systemd[1]: Failed to start Remote desktop service (VNC).
Jan 03 09:00:17 localhost systemd[1]: Unit vncserver@:1.service entered failed state.
Jan 03 09:00:17 localhost systemd[1]: vncserver@:1.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
이 문제를 어떻게 해결할 수 있는지 아는 사람 있나요?
답변1
/home/root/.vnc/ 경로가 존재하지 않습니다.
답변2
문제는 PIDFile을 잘못된 위치에 구성했다는 것입니다. 노력하다:
PIDFile=/root/.vnc/%H%i.pid