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

相关推荐
ai小陈4 小时前
GPU服务器租用存储验收:检查点写入与磁盘吞吐实战
运维·服务器·人工智能·ai·ssh·gpu算力
Ivanqhz5 小时前
激活函数在 Transformer 中的作用及各种变体简述
java·linux·数据库·人工智能·深度学习
有毒的教程6 小时前
VMware仅主机模式:物理机 ↔ 虚拟机 文件共享
运维
殷色玫瑰8 小时前
C/C++ 内存管理详解:从内存分布到 new/delete 底层原理
java·linux·c语言·c++
quweiie8 小时前
Neo4j Community 安全访问配置总结
数据库·centos·neo4j
山岚的运维笔记8 小时前
ComfyUI NVIDIA安装教程:官方便携版下载+run_nvidia_gpu.bat启动,8G显存Windows实操
运维·服务器·windows·笔记·prompt·aigc·comfyui
海宇大数据9 小时前
零信任架构实战:基于海宇活体识别V步骤1构建自动化远程公证会话初始化网关
运维·人工智能·架构·自动化
꯭自꯭闭꯭9 小时前
DM7主备升级方案
linux·服务器·数据库
用户4107192013259 小时前
VMware 虚拟机Ubuntu 环境linux远程连接失败
linux
lisanmengmeng9 小时前
Nagios邮件报警的配置
linux·运维·服务器