一、vnc介绍
vnc (virtual network console)是虚拟网络控制台的缩写。它 是一款优秀的远程控制工具软件,由著名的 at&t 的欧洲研究实验室开发的。
vnc 是在基于 unix和 linux操作系统的免费的开源软件,远程控制能力强大,高效实用,其性能可以和 windows和 mac中的任何远程控制软件媲美。
平行软件:向日葵 teamview 远程桌面
c/s: client/server模式
二、vnc部署
部署步骤:
- 软件安装
- 连接验证配置
- vnc连接管理
2.1、安装vnc
[root@zutuanxue ~]# yum -y install tigervnc-server tigervnc-server-module
2.2、配置连接密码
[root@zutuanxue ~]# vncpasswd $username password: verify: would you like to enter a view-only password (y/n)? n a view-only password is not used
2.3、关闭wayland
wayland 是 gnome 中的默认显示管理器 (gdm),并且未配置用于处理 xorg 等远程渲染的 api。
取消注释 /etc/gdm/custom.conf 中的 waylandenable=false,以使通过 vnc 进行的远程桌面会话请求由 gnome 桌面的 xorg 处理,来代替 wayland 显示管理器。
[root@zutuanxue ~]# sed -i '/^#waylandenable=/cwaylandenable=false' /etc/gdm/custom.conf
2.4、vnc管理
- a、启动vnc
[root@zutuanxue ~]# vncserver -autokill :1 new 'zutuanxue:1 (root)' desktop is zutuanxue:1 starting applications specified in /root/.vnc/xstartup log file is /root/.vnc/zutuanxue:1.log 查看启动 [root@zutuanxue ~]# netstat -ntpl active internet connections (only servers) proto recv-q send-q local address foreign address state pid/program name tcp 0 0 192.168.122.1:53 0.0.0.0:* listen 1310/dnsmasq tcp 0 0 0.0.0.0:22 0.0.0.0:* listen 918/sshd tcp 0 0 127.0.0.1:631 0.0.0.0:* listen 917/cupsd tcp 0 0 0.0.0.0:5601 0.0.0.0:* listen 839/node tcp 0 0 0.0.0.0:5901 0.0.0.0:* listen 4848/xvnc tcp 0 0 0.0.0.0:111 0.0.0.0:* listen 1/systemd tcp6 0 0 :::22 :::* listen 918/sshd tcp6 0 0 ::1:631 :::* listen 917/cupsd tcp6 0 0 :::5901 :::* listen 4848/xvnc tcp6 0 0 :::111 -autokill 退出图形桌面终止vnc 用户从图形环境注销 终止vnc 每当xstartup脚本退出时自动终止xvnc。在大多数情况下,这具有终止当用户从窗口管理器注销时使用xvnc。
- b、vnc管理-查看vnc
[root@zutuanxue ~]# vncserver -list tigervnc server sessions: x display # process id :1 2621
- c、vnc管理-关闭vnc
[root@zutuanxue ~]# vncserver -kill :1
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持代码网。
发表评论