Complete installation of VNC+XFCE visual desktop environment
I. Introduction
There are many desktop environments, KDE, GNOME, simple and fast ones, such as FVWM2, XFCE and so on. For servers, KDE and GNOME are too bulky and occupy high memory. VNC+XFCE visual desktop environment saves resources, so XFCE4 is chosen here.
Two, install the XFCE desktop environment
1 Upgrade all packages, software and system kernel
Execute "yum update"
.
2 Install X Window system
Execute "yum groupinstall "X Window system"
and install X. After the installation is complete, execute to "systemctl isolate graphical.target
verify that the installation is successful.
3 Install XFCE
Execute "yum grouplist"
and check the XFCE version of the system.
See the picture above, we detected that the package name is Xfce, execute "yum groupinstall Xfce"
and install Xfce. Execute "sudo systemctl isolate graphical.target“
and enter Xfce.
4 Install VNC-SERVER
-
Perform
"yum install vnc-server -y "
installation vnv-server -
Perform
"vim /etc/sysconfig/vncservers"
configuration VNC system and resolution, add contentVNCSERVERS=“1:root”
VNCSERVERARGS[1]="-geometry 1028x960" -
Execution
"vncpasswd"
set VNC password -
Perform
"vim /root/.vnc/xstartup"
all the contents replaced with the following:#!/bin/sh
#Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb KaTeX parse error: Expected 'EOF', got '&' at position 59: …config -iconic &̲ #xterm -geome…VNCDESKTOP Desktop"&
#twm &
startxfce4 &
5 Start VNC-SERVER
-
Perform a
"cp /lib/systemd/system/[email protected] /etc/systemd/system/vncserver@:1.service"
copy of the service configuration file of window 1The colon number after vncserver@ under /etc/systemd/system indicates the service instance number. You can configure multiple service instances and specify different numbers. The service port of VNC starts from 5900 and increases according to the service instance number. For example, in the example of vncserver@:1.service, the corresponding port number is 5901. If it is vncserver@:10.service, the corresponding port number is 5910.
-
"vi /etc/systemd/system/vncserver@:1.service"
Modify the configuration file that needs to open the service window, and<USER>
replace the 42 and 43 lines in the configuration file with the user name that needs to log in remotely through vnc.43 ExecStart=/usr/sbin/runuser -l root -c “/usr/bin/vncserver %i”
44 PIDFile=/root/.vnc/%H%i.pidThe /home in the second line is the user's home directory; if it is root, it is /root, that is, PIDFile=/root/.vnc/%H%i.pid. "`
-
Refresh service, set self-start, start service
systemctl daemon-reload systemctl enable vncserver@:1.service #设置该1号窗口为开机自启,可选输入步骤 systemctl start vncserver@:1.service
-
Stop process command:
systemctl stop vncserver@:n (n代表窗口号)
Three, reference
https://blog.csdn.net/qq_38329988/article/details/80574237 https://www.laozuo.org/1026.html
https://blog.csdn.net/smstong/article/details/44802989
Four, More Info
Follow my WeChat public account: "LAMPer Technology Stack" for more information