VNC server set up (with graphic support)

Environment: centos7.6 minimize installation

Graphical Support

If you want to install a simple graphical support, contain only the most gnome most basic package, then you can use the following command

yum groups install "X Window System"

yum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts

If you want to install the gnome full amount of graphical tools to support it. Execute the following command

yum groupinstall "GNOME Desktop" "Graphical Administration Tools"

After using one of the above selected graphical support the implementation of the following commands to modify the startup command level of the system, modify the default startup graphical interface

systemctl set-default graphical.target

1, the first end mounted vncserver

yum install tigervnc-server

2, create a configuration file to run vncserver

cp /lib/systemd/system/[email protected] /etc/systemd/system/vncserver@:1.service

vncserver @: 1.service for the name of the configuration file, a file name within the meaning vnc session interface. It allows you to create multiple sessions interfaces.

3, edit vncserver @: 1.service profile

we /etc/systemd/system/vncserver\@\:1.service

[Unit]

Description=Remote desktop service (VNC)

After=syslog.target network.target

   

[Service]

Type=forking

= Root the User # Create a user called root vnc service

# Clean any existing files in /tmp/.X11-unix environment

ExecStartPre=-usr/bin/vncserver -kill %i

= ExecStart / usr / sbin / runuser the -l root -c "/ usr / bin / vncserver% i" # execute permissions for root task

= PIDFILE / root /.vnc/%H%i.pid # vnc the PID file path of the above-described user's root

ExecStop=-/usr/bin/vncserver -kill %i

[Install]

WantedBy=multi-user.target

   

4. Create a password for the user vnc

Operated by know the above configuration file, vnc user name is root, if the above configuration file specifies another user, you need to switch to the process of creating other user passwords

Create a user password vnc

vncpasswd

[bogon the root @ ~] # the vncpasswd # password set here is the manipulation of the server, the password input is connected, or below the password

Password:

Password must be at least 6 characters - try again

Password:

Password must be at least 6 characters - try again

Password:

Verify:

You like to the Enter A Would View-only password (the y-/ n)? The Y- # can only view a set, but does not operate, it is equivalent to the recording screen, you can choose if you do not n

Password:

Verify:

   

5, heavy process, restart the service

systemctl daemon-reload

systemctl start vncserver@:1.service

@ vncserver enable systemctl: 1.service # boot

   

6, configure the firewall

firewall-cmd --zone=public --add-port=5901/tcp --permanent

firewall-cmd --zone=public --add-port=5902/tcp --permanent

cmd---reload Firewall # reload firewall

   

7 using VNC viewer connection test

Connection address 192.168.197.30:1, pay attention to the colon where the number 1 is not a port, but rather refers to the first session window vncserver released. Is above vncserver @: 1.service profile name 1

   

Guess you like

Origin www.cnblogs.com/withfeel/p/11640833.html