1. yum install tigervnc-server
2. cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
3.vi /etc/systemd/system/vncserver@:1.service
[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
#ExecStart=/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
#PIDFile=/home/<USER>/.vnc/%H%i.pid
ExecStart=/sbin/runuser -l 유저아이이디 -c "/usr/bin/vncserver %i"
PIDFile=/home/유저아이이디/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
4.firewall-cmd --permanent --zone=public --add-service vnc-server
firewall-cmd --reload
firewall-cmd --reload
5.su - 유저아이이디
vncserver
vncserver
-- You will require a password to access your desktops
Now make the service enabled on after every reboot with root credentials
6. su -
systemctl daemon-reload
systemctl daemon-reload
7. systemctl enable vncserver@:1.service
8. reboot
systemctl start vncserver@:1.service
systemctl start vncserver@:1.service
댓글 없음:
댓글 쓰기