CentOS7.6安装VNCServer

准备环境

  • 操作系统:CentOS 7.6 64位

1、安装图形界面

[root@localhost ~]# yum groupinstall "X Window System"
[root@localhost ~]# yum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts
[root@localhost ~]# unlink /etc/systemd/system/default.target
[root@localhost ~]# ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
[root@localhost ~]# yum install ghostscript-chinese-zh_CN.noarch
[root@localhost ~]# reboot

2、安装VNCServer

安装vnc-server:

[root@localhost ~]# yum install tigervnc-server

修改登录账户配置,以下以root为例:

[root@localhost ~]# cp /lib/systemd/system/[email protected] /lib/systemd/system/vncserver@:1.service
[root@localhost ~]# vi /lib/systemd/system/vncserver@:1.service
ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver %i"
PIDFile=/root/.vnc/%H%i.pid
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# vncpasswd

设置开机启动,并启动服务:

[root@localhost ~]# systemctl enable vncserver@:1.service
[root@localhost ~]# systemctl start vncserver@:1.service

3、安装VNC Viewer

下载VNC Viewer
CentOS7.6安装VNCServer_第1张图片
点击“OK”后,输入VNC Server账户的登录密码。

4、附录-常用命令:

#启动、停止、查看运行状态、设置开机启动、禁止开机启动  VNC Server:
systemctl [ start | stop | status | enable | disable ] vncserver@:1.service

#修改VNC Server账号密码:
su <账号>
vncpasswd

你可能感兴趣的:(CentOS)