CentOS 7.9 安装 TigerVNC

1.安装图形桌面

bash 复制代码
yum groupinstall -y "GNOME Desktop"

2.关闭SElinux

bash 复制代码
setenforce 0
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config

3.关闭防火墙

bash 复制代码
systemctl stop firewalld
systemctl disable firewalld

4.安装 TigerVNC Server

bash 复制代码
yum install -y tigervnc-server tigervnc

5.修改配置文件

bash 复制代码
cat > /etc/systemd/system/vncserver@:1.service << EOF
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking
User=root
ExecStartPre=-/usr/bin/vncserver -kill %i
ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver %i"
PIDFile=/root/.vnc/%H%i.pid
ExecStop=-/usr/bin/vncserver -kill %i

[Install]
WantedBy=multi-user.target
EOF

6.设置 VNC 密码

bash 复制代码
vncpasswd

输入两次密码(不显示 ,直接敲),完成后会生成 ~/.vnc/

7.启动 VNC 并设开机自启

重载配置

bash 复制代码
systemctl daemon-reload

启动

bash 复制代码
systemctl start vncserver@:1.service

开机自启

bash 复制代码
systemctl enable vncserver@:1.service

查看状态

bash 复制代码
systemctl status vncserver@:1.service

8.测试连接

用TigerVNC Viewer客户端测试。

相关推荐
2601_957190901 小时前
实战落地为王,全尺寸定制飞行影院适配全场景文旅升级
大数据·运维·人工智能
光电笑映1 小时前
进程间通信(上):深入理解管道与进程池
linux·运维·服务器
2301_809049421 小时前
phase3_note_vivado_2020_ip_packager_revision
linux·fpga开发
老杨聊技术1 小时前
CentOS 7 安装 Docker 完整版教程
linux·docker·centos
l齐天1 小时前
Ubuntu 22.04 环境下 PBC 与 Golang 的安装、配置与测试
linux·ubuntu·golang
提伯斯6461 小时前
Linux minicom 串口工具超详细使用教程
linux·运维·服务器
艾莉丝努力练剑1 小时前
【Linux网络】网络层IP协议(一)
linux·运维·服务器·网络·tcp/ip·计算机网络·udp
Benszen1 小时前
Linux容器简介
linux·运维·服务器
剑神一笑1 小时前
Linux iptables 深度解析:从规则匹配到 NAT 转发实战
linux·运维·服务器