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

相关推荐
Championship.23.244 小时前
Linux 3.0 锁机制与故障排查详解
linux·运维·服务器
天疆说5 小时前
Zotero Connector 在 Edge 里找不到桌面 Zotero(Linux / Zotero 9.0.6 / Edge 150)
linux·前端·edge
风123456789~6 小时前
【Linux专栏】ls 排除某个文件
linux·运维·服务器
IT曙光7 小时前
ubuntu apt-get离线源制作
linux·ubuntu
其实防守也摸鱼7 小时前
运维--学习阶段问题解答(1)(自测)
linux·运维·服务器·数据库·学习·自动化·命令模式
懒鸟一枚7 小时前
深入理解 Linux 内存、Swap 交换分区与分页机制的关系
java·linux·数据库
Darkwanderor9 小时前
对Linux的进程控制的研究
linux·运维·c++
bksczm11 小时前
linux之线程概念和控制
linux·开发语言·c++
爱网络爱Linux12 小时前
Linux proc 目录安全加固
linux·运维·rhce·rhca·红帽认证·proc 目录安全加固
hehelm12 小时前
Linux网络编程—TCP字典翻译系统
linux·开发语言·网络·c++·tcp/ip