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客户端测试。

相关推荐
weixin_4357761118 分钟前
2026年长沙托育vi设计从风格定位到元素运用的设计方法
linux·运维·服务器·python
xcLeigh26 分钟前
KingbaseES 的卢智能运维体架构深度拆解
运维·数据库·人工智能·ai·架构·ffmpeg·智能体
泰和英杰32 分钟前
工商业储能柜采购选型与并网运维要点
运维
龙仔72537 分钟前
RustDesk 完整笔记
运维·笔记·rust·远程工具·rustdesk
benjiangliu1 小时前
LINUX系统-19-库制作与原理(一)
linux·运维·服务器
瓦学妹2 小时前
2026亚马逊本土店怎么注册?入驻流程、资料准备与常见问题
大数据·运维·人工智能
FriendshipT2 小时前
Ubuntu 20.04 下使用 Ollama 本地部署 AI 大模型
linux·人工智能·python·深度学习·ubuntu
bellus-3 小时前
win11使用ubuntu 26.04
linux·运维·ubuntu
略略略咯咯3 小时前
centos更换镜像源
linux·运维·centos
j7~4 小时前
【Linux】二十七.线程篇四《Linux多线程编程:线程互斥(互斥量的底层到封装)、线程安全和冲入、死锁》---详解
linux·开发语言·c++·线程安全·死锁·线程互斥·重入