root用户Linux银河麒麟服务器安装vnc服务

安装必要桌面环境组件

bash 复制代码
yum install mate-session-manager -y
mate-session #确定是否安装成功

安装vnc服务器

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

切换到root为root得vnc设置密码

bash 复制代码
su root
vncpasswd

给root用户设置vnc服务器文件

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

[Service]
Type=forking
User=root
Group=root
WorkingDirectory=/root
Environment="HOME=/root"
ExecStart=/usr/bin/vncserver -autokill :1
ExecStop=/usr/bin/vncserver -kill :1

[Install]
WantedBy=multi-user.target

重新加载服务器文件

bash 复制代码
systemctl daemon-reload

编辑vnc启动脚本文件

bash 复制代码
[root@localhost system]# cat /root/.vnc/xstartup

#!/bin/bash
xrdb $HOME/.Xresources
export XKL_XMODMAP_DISABLE=1

unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec /usr/bin/mate-session

启动vnc服务

bash 复制代码
systemctl start vncserver@:1

查看启动是否成功

bash 复制代码
systemctl status vncserver@:1

查看vnc启动日志情况

bash 复制代码
cat /root/.vnc/localhost.localdomain:1.log
相关推荐
wj3055853785 小时前
课程 9:模型测试记录与 Prompt 策略
linux·人工智能·python·comfyui
abigriver5 小时前
打造 Linux 离线大模型级语音输入法:Whisper.cpp + 3090 显卡加速与 Rime 中英混输终极调优指南
linux·运维·whisper
wangqiaowq5 小时前
windows下nginx的安装
linux·服务器·前端
YYRAN_ZZU6 小时前
Petalinux新建自动脚本启动
linux
charlie1145141916 小时前
嵌入式Linux驱动开发pinctrl篇(1)——从寄存器到子系统:驱动演进之路
linux·运维·驱动开发
Agent手记6 小时前
异常考勤智能预警与处理与流程优化方案 | 基于企业级Agent的超自动化实战教程
运维·人工智能·ai·自动化
于小猿Sup7 小时前
VMware在Ubuntu22.04驱动Livox Mid360s
linux·c++·嵌入式硬件·自动驾驶
cen__y7 小时前
Linux12(Git01)
linux·运维·服务器·c语言·开发语言·git
不仙5208 小时前
VMware Workstation 26.0.0 在 Ubuntu 24.04 (内核 6.17.0) 上的安装与内核模块编译问题
linux·ubuntu·elasticsearch
189228048619 小时前
NY352固态MT29F32T08GWLBHD6-24QJ:B
大数据·服务器·人工智能·科技·缓存