yum groupinstall "Gnome Desktop"You need to install the epel repo. ****(The Next two lines may change if the version is not 7.8)****
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm rpm -ivh epel-release-7-8.noarch.rpm yum clean all yum repolistNext install VNC and XRDP
yum install tigervnc-server xrdp cp /etc/pam.d/sshd /etc/pam.d/xrdp-sesman systemctl restart xrdp systemctl enable xrdp cp /lib/systemd/system/vncserver\@.service /etc/systemd/system/vncserver@.serviceOrginal:
[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=/usr/sbin/runuser -lI used the root account for testing. Use any account you would like.-c "/usr/bin/vncserver %i" PIDFile=/home/ /.vnc/%H%i.pid ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
Working:
[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=/usr/sbin/runuser -l root -c "/usr/bin/vncserver %i -geometry 1280x1024" PIDFile=/root/.vnc/%H%i.pid ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'I did the above with sed:
sed -i 's/Reload the services-c/root -c/g' /etc/systemd/system/vncserver@.service sed -i 's/vncserver %i/vncserver %i -geometry 1280x1024/g' /etc/systemd/system/vncserver@.service sed -i 's/\/home\/ /\/root/g' /etc/systemd/system/vncserver@.service
systemctl daemon-reloadSet the VNC Password
vncpasswdStart the service and enable it on boot
systemctl start vncserver@:1.service systemctl enable vncserver@:1.service
No comments:
Post a Comment