centos8 安装VNC配置远程连接
系统信息
[root@centos8 ~]# cat /etc/redhat-release CentOS Linux release 8.1.1911 (Core) [root@centos8 ~]#
注意要安装桌面环境,如果没有安装桌面环境,登进去是黑屏。
处理:
安装桌面环境
yum groupinstall "Server with GUI"
安装VNCServer
[root@centos8 ~]# dnf install -y tigervnc-server tigervnc-server-module
复制配置文件
[root@centos8 ~]# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
编辑 vim /etc/tigervnc/vncserver.users 添加用户
[root@centos8 ~]# vim /etc/tigervnc/vncserver.users # TigerVNC User assignment # # This file assigns users to specific VNC display numbers. # The syntax is <display>=<username>. E.g.: # # :2=andrew # :3=lisa :1=root
如果是给非root创建的话需要切换到该用户下产生vncpasswd
[root@centos8 ~]# su user [user@centos8 ~]$ vncpasswd Password: Verify: Would you like to enter a view-only password (y/n)? n A view-only password is not used [user@centos8 ~]$ exit exit
开启服务
[root@centos8 ~]# systemctl daemon-reload
[root@centos8 ~]# systemctl start vncserver@:1.service
测试是否VNCServer是否开起来
[root@centos8 ~]# nc -zv localhost 5901 Ncat: Version 7.70 ( https://nmap.org/ncat ) Ncat: Connected to ::1:5901. Ncat: 0 bytes sent, 0 bytes received in 0.01 seconds.
关闭防火墙或开启端口权限
关闭防火墙(不推荐)
[root@centos8 ~]# systemctl status firewalld ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2020-06-21 22:40:18 CST; 14min ago Docs: man:firewalld(1) Main PID: 890 (firewalld) Tasks: 2 (limit: 11460) Memory: 29.7M CGroup: /system.slice/firewalld.service └─890 /usr/libexec/platform-python -s /usr/sbin/firewalld --nofork --nopid Jun 21 22:40:16 centos8 systemd[1]: Starting firewalld - dynamic firewall daemon... Jun 21 22:40:18 centos8 systemd[1]: Started firewalld - dynamic firewall daemon. [root@centos8 ~]# systemctl stop firewalld
开启端口权限
–permanent永久生效,没有此参数重启后失效
[root@centos8 ~]# firewall-cmd --zone=public --add-port=5901/tcp --permanent success [root@centos8 ~]# firewall-cmd --reload success
安装Chrome
首先在CentOS/RHEL系统上安装wget才能用于下载,运行以下命令: sudo dnf -y install wget 现在使用wget命令下载最新版本的Google Chrome: wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm 导航到包含下载包的目录并执行以下命令: $ sudo dnf localinstall google-chrome-stable_current_x86_64.rpm -y 执行结果如下图: 打开Chrome浏览器的快捷方式文件 $ vi /usr/share/applications/google-chrome.desktop 修改 Exec=/usr/bin/google-chrome-stable %U 在其后面加上 --no-sandbox
转:https://www.cnblogs.com/afei654138148/p/14934207.html
分类:
linux
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
2017-09-07 Could not create ServerSocket on address 0.0.0.0/0.0.0.0:9083