1. Install package yum Install vnc*-y2. Create a password Vncserver3. Create a parameter file [[email protected] ~]# cp/lib/systemd/system/[email Protected]/lib/systemd/system/[email protected]:1.service4. Modifying a parameter file [[email protected] ~]# vi/lib/systemd /system/[email protected]\:1.service[unit]description=remote Desktop Service (VNC) after=syslog.target network.target[service]type=forking# Clean any existing files in/tmp/. X11-unix environmentexecstartpre=/bin/sh-c '/usr/bin/vncserver-kill%i >/dev/null 2>&1 | | : ' Execstart=/sbin/runuser-l root-c '/usr/bin/vncserver%i '--------modification 1: Take root as an example, after-l Modify the user name Pidfile=/root/.vnc/%h%i.pid------- -Modify the 2:.vnc before setting the user's home directory, root for/rootexecstop=/bin/sh-c '/usr/bin/vncserver-kill%i >/dev/null 2>&1 | | : ' [Install]wantedby=multi-user.target if you log in with another user, you need to vncpasswd user_name5. Start Systemctl start [email protected] : 1.service6. If you want to boot from, then SYSTEMCTl Enable [Email protected]:1.service Note: If you are the first contact with RHEL7, then you must not connect to VNC at this time, because: service iptables stop will not shut off the firewall! Required: Systemctl Stop FIREWALLD prohibit firewall from booting: [[email protected] ~]# systemctl disable FIREWALLDRM '/etc/systemd/system/ Dbus-org.fedoraproject.firewalld1.service ' rm '/etc/systemd/system/basic.target.wants/firewalld.service '
RHEL7.1 Configuring VNC