centos安装realvnc

下载vncserver
下载vncviewer

用root登录系统

执行安装:

$yum install xterm

$rpm -ivh https://www.realvnc.com/download/file/vnc.files/VNC-Server-6.2.1-Linux-x64.rpm
# 或
$rpm -ivh https://www.realvnc.com/download/file/vnc.files/VNC-Server-6.2.1-Linux-x86.rpm

一个是64位系统的安装包,一个是32位系统的安装包,可用uname -a命令查看有x86_64就是64位系统。

安装成功的提示:

Installed systemd unit for VNC Server in Service Mode daemon
Start or stop the service with:
  systemctl (start|stop) vncserver-x11-serviced.service
Mark or unmark the service to be started at boot time with:
  systemctl (enable|disable) vncserver-x11-serviced.service
 
Installed systemd unit for VNC Server in Virtual Mode daemon
Start or stop the service with:
  systemctl (start|stop) vncserver-virtuald.service
Mark or unmark the service to be started at boot time with:
  systemctl (enable|disable) vncserver-virtuald.service

安装VNC的许可:

$vnclicense -add VKUPN-MTHHC-UDHGS-UWD76-6N36A
Enterprise license key has been successfully applied

如果你的系统没安装图形界面,就请给系统安装图形界面:

$yum -y groups install "GNOME Desktop" "X Window System"

查看当前系统的启动模式

$systemctl get-default
multi-user.target # 命令模式
graphical.target # 图形模式
# 修改启动模式为图形界面:
$systemctl set-default graphical.target

重启reboot后生效
注意:如果默认GNOME进入图形界面需要创建一个新用户

启动VNC服务端:

$vncserver &

开启VNC服务器的命令:

$systemctl start  vncserver-x11-serviced.service

设置开机启动:

$systemctl enable vncserver-x11-serviced.service

检查是否开机启动:

$systemctl list-unit-files vncserver-x11-serviced.service

显示为enabled就是开机启动了

$service vncserver-x11-serviced restart
$service vncserver-x11-serviced.service restart

重启VNC,使其开启重启生效
这样就可以在windows上用VNC viewer连接Centos的远程桌面了

查看firewall中已经开放的端口:

$firewall-cmd --list-ports

添加端口号5900-5905

$firewall-cmd --permanent --zone=public --add-port=5900-5905/tcp

重新加载防火墙

$firewall-cmd --reload

查看5900端口是否是被VNC服务端使用

$ss -lnp|grep 5900

你可能感兴趣的:(工具类)