linux:vnc
差别
这里会显示出您选择的修订版和当前版本之间的差别。
| 两侧同时换到之前的修订记录前一修订版后一修订版 | 前一修订版 | ||
| linux:vnc [2021/10/11 12:46] – [5. 其它远程软件] zhangguo | linux:vnc [2026/10/15 21:29] (当前版本) – 外部编辑 127.0.0.1 | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | ===== - VNC ===== | + | ## - VNC |
| 这里主要讨论vncserver服务,它是支持多种的vncviewer软件接入的。 | 这里主要讨论vncserver服务,它是支持多种的vncviewer软件接入的。 | ||
| 行 19: | 行 19: | ||
| - | ==== - VNC建立vncserver服务 | + | ### - VNC建立vncserver服务 |
| - | 一般情况下,是采用如下命令来建立vncserver服务:\\ | + | 一般情况下,是采用如下命令来建立vncserver服务:\ |
| - | < | + | |
| + | ``` | ||
| + | vncserver -geometry 1900x980 :1 | ||
| + | ``` | ||
| : | : | ||
| 行 28: | 行 32: | ||
| 如果需要建立多个vncserver服务的话,那么就需要执行多次上述的命令。 | 如果需要建立多个vncserver服务的话,那么就需要执行多次上述的命令。 | ||
| - | ==== - 设置防火墙 | + | ### - 设置防火墙 |
| - | === - CentOS 6 === | + | #### - CentOS 6 |
| vncserver默认从端口开始5900,需要设置防火墙开放相应端口或者是关闭防火墙 | vncserver默认从端口开始5900,需要设置防火墙开放相应端口或者是关闭防火墙 | ||
| - | < | + | |
| + | ```bash | ||
| [root@ayls-s3 init.d]# vi / | [root@ayls-s3 init.d]# vi / | ||
| # Firewall configuration written by system-config-firewall | # Firewall configuration written by system-config-firewall | ||
| 行 48: | 行 52: | ||
| COMMIT | COMMIT | ||
| [root@ayls-s3 init.d]# | [root@ayls-s3 init.d]# | ||
| - | </ | + | ``` |
| - | ===== - REALVNC ===== | ||
| + | ## - REALVNC | ||
| 注意: realvnc在CentOS6上可以正常使用,在CentOS7上桌面没有任务栏,导致基本无法使用。 | 注意: realvnc在CentOS6上可以正常使用,在CentOS7上桌面没有任务栏,导致基本无法使用。 | ||
| - | ==== - REALVNC server开机启动 | + | ### - REALVNC server开机启动 |
| realvnc方式跟tigervnc不一样,realvnc支持 server mode, user mode, vitual mode。 | realvnc方式跟tigervnc不一样,realvnc支持 server mode, user mode, vitual mode。 | ||
| - | ^ | + | |
| - | | server mode | + | | mode | 描述 |
| - | | user mode | + | | --- | --- | |
| - | | virtual mode | 类似于建立vncserver服务,是虚拟出来的画面,就像vncserver : | + | | server mode | 远端机与受控主机看到的是同一个桌面,类比如向日葵, |
| + | | user mode | 跟上面类似,商业版才有 | | ||
| + | | virtual mode | 类似于建立vncserver服务,是虚拟出来的画面,就像vncserver : | ||
| 行 70: | 行 76: | ||
| CentOS6配置: | CentOS6配置: | ||
| - | < | + | |
| + | ```bash | ||
| # 开启服务 | # 开启服务 | ||
| / | / | ||
| 行 78: | 行 85: | ||
| chkconfig | chkconfig | ||
| chkconfig | chkconfig | ||
| - | </ | + | ``` |
| CentOS7配置: | CentOS7配置: | ||
| - | < | + | |
| + | ```bash | ||
| # 开机启动 | # 开机启动 | ||
| systemctl enable vncserver-virtuald.service | systemctl enable vncserver-virtuald.service | ||
| 行 89: | 行 98: | ||
| # 查看状态 | # 查看状态 | ||
| systemctl status vncserver-virtuald.service | systemctl status vncserver-virtuald.service | ||
| - | </ | + | ``` |
| - | ==== - REALVNC CONFIG ==== | ||
| + | ### - REALVNC CONFIG | ||
| VNC configuration files | VNC configuration files | ||
| 行 110: | 行 118: | ||
| -Policy VNC configuration files | -Policy VNC configuration files | ||
| - | 注释:\\ | + | 注释:\ |
| - | -<color # | + | -<span style=" |
| - | -<color # | + | -<span style=" |
| - | -<color # | + | -<span style=" |
| - | -<color # | + | -<span style=" |
| This means that a particular parameter specified at the command line overrides the same parameter specified in a per-user or in a system-wide VNC configuration file, but is itself overridden by the same parameter specified in a policy VNC configuration file. Policy cannot be changed by users. | This means that a particular parameter specified at the command line overrides the same parameter specified in a per-user or in a system-wide VNC configuration file, but is itself overridden by the same parameter specified in a policy VNC configuration file. Policy cannot be changed by users. | ||
| 行 126: | 行 134: | ||
| - | ^ Process | ||
| - | | core | Xvnc | Connectivity, | ||
| - | | User interface | ||
| - | | Daemon | ||
| + | | Process | Policy template file | Contains parameters for... | Notes | | ||
| + | | --- | --- | --- | --- | | ||
| + | | core | Xvnc | Connectivity, | ||
| + | | User interface | vncserverui-virtual | Locale, file transfer, and chat. | | | ||
| + | | Daemon | vncserver-virtuald | Connectivity, | ||
| - | ==== - realvnc默认分辨率修改 | + | |
| + | ### - realvnc默认分辨率修改 | ||
| 参考网页:https:// | 参考网页:https:// | ||
| vnc virtual mode的默认分辨率是1024x768, | vnc virtual mode的默认分辨率是1024x768, | ||
| - | 创建文件'' | + | 创建文件`/ |
| - | < | + | |
| + | ``` | ||
| -geometry 1366x768 | -geometry 1366x768 | ||
| # 联想小新pad Pro 2021更适合 1280x768分辨率。 | # 联想小新pad Pro 2021更适合 1280x768分辨率。 | ||
| - | </ | + | ``` |
| - | That requires passing a geometry parameter on the commandline, | ||
| - | '' | + | That requires passing a geometry |
| + | `-geometry 1280x1024` | ||
| - | ==== - centos7安装信息 ==== | ||
| + | ### - centos7安装信息 | ||
| - | < | + | ```bash |
| NOTICE: common configuration in /etc/pam.d contains the following modules: | NOTICE: common configuration in /etc/pam.d contains the following modules: | ||
| | | ||
| 行 179: | 行 190: | ||
| For VNC Server in Virtual Mode daemon: | For VNC Server in Virtual Mode daemon: | ||
| firewall-cmd --zone=public --permanent --add-service=vncserver-virtuald | firewall-cmd --zone=public --permanent --add-service=vncserver-virtuald | ||
| + | ``` | ||
| - | </ | + | ### - REALVNC 下载 |
| - | ==== - REALVNC 下载 | + | |
| 一、软件下载(VNC-Server-6.2.0-Linux-x64.rpm) | 一、软件下载(VNC-Server-6.2.0-Linux-x64.rpm) | ||
| 行 189: | 行 199: | ||
| 四、安装序列号 | 四、安装序列号 | ||
| - | < | + | |
| + | ``` | ||
| / | / | ||
| 69NCN-JRLBC-QD28Y-5KLY2-UEE6A | 69NCN-JRLBC-QD28Y-5KLY2-UEE6A | ||
| 行 196: | 行 207: | ||
| 6XQQQ-WXL4Q-NN4KX-NUTC6-8ZK6A | 6XQQQ-WXL4Q-NN4KX-NUTC6-8ZK6A | ||
| PGUFQ-HTZBB-WNHU7-YHDQC-A7R6A | PGUFQ-HTZBB-WNHU7-YHDQC-A7R6A | ||
| - | </ | + | ``` |
| - | ===== - tigervnc On CentOS 6 ===== | ||
| - | ==== - tigervnc server开机批量启动 | + | ## - tigervnc On CentOS 6 |
| - | 需要软件tigervnc,直接yum安装即可, | + | ### - tigervnc server开机批量启动 |
| + | 需要软件tigervnc,直接yum安装即可, | ||
| - | === - 设置开机启动 | + | #### - 设置开机启动 |
| - | < | + | |
| - | === - 重启服务 === | + | ``` |
| - | < | + | chkconfig |
| + | ``` | ||
| - | === - 多用户 | + | |
| - | 编辑文件,vi / | + | #### - 重启服务 |
| + | |||
| + | ``` | ||
| + | service vncserver restart | ||
| + | ``` | ||
| + | |||
| + | |||
| + | #### - 多用户 | ||
| + | 编辑文件,vi / | ||
| 如果是单用户: | 如果是单用户: | ||
| - | < | + | |
| + | ``` | ||
| VNCSERVERS=" | VNCSERVERS=" | ||
| VNCSERVERARGS[1]=" | VNCSERVERARGS[1]=" | ||
| - | </ | + | ``` |
| 如果是多用户: | 如果是多用户: | ||
| - | < | + | |
| + | ``` | ||
| VNCSERVERS=" | VNCSERVERS=" | ||
| VNCSERVERARGS[1]=" | VNCSERVERARGS[1]=" | ||
| VNCSERVERARGS[2]=" | VNCSERVERARGS[2]=" | ||
| VNCSERVERARGS[3]=" | VNCSERVERARGS[3]=" | ||
| - | </ | + | ``` |
| 以此类推 | 以此类推 | ||
| 默认情况下,1: | 默认情况下,1: | ||
| - | < | + | |
| + | ``` | ||
| + | VNCSERVERS=" | ||
| + | ``` | ||
| # | # | ||
| - | < | + | |
| + | ``` | ||
| + | VNCSERVERARGS[1]=" | ||
| + | ``` | ||
| 如果想阻止http包,可以使用如下配置 | 如果想阻止http包,可以使用如下配置 | ||
| - | < | ||
| - | 按照上述操作,在每次机器开机时,都会自动开启多个vncserver服务,直接使用vncviewer连接即可。 | + | ``` |
| + | VNCSERVERARGS[1]=" | ||
| + | ``` | ||
| - | ===== - tigervnc on CentOS7 ===== | ||
| + | 按照上述操作,在每次机器开机时,都会自动开启多个vncserver服务,直接使用vncviewer连接即可。 | ||
| + | |||
| + | ## - tigervnc on CentOS7 | ||
| https:// | https:// | ||
| 亲测tigervnc在centos7上使用没有问题。 | 亲测tigervnc在centos7上使用没有问题。 | ||
| - | ==== - tigervnc在centos7的安装 | + | ### - tigervnc在centos7的安装 |
| - 卸载其它类弄的vnc,说白了,就是如果有装realvnc,就需要先把它给卸载掉。 | - 卸载其它类弄的vnc,说白了,就是如果有装realvnc,就需要先把它给卸载掉。 | ||
| - | - 安装tigervnc, | + | - 安装tigervnc, |
| + | |||
| + | ### - 配置 | ||
| - | ==== - 配置 ==== | + | ```bash |
| - | < | + | |
| cp / | cp / | ||
| # 修改vncserver@: | # 修改vncserver@: | ||
| 行 296: | 行 330: | ||
| # | # | ||
| - | </ | + | ``` |
| - | ==== - 问题debug | + | |
| + | ### - 问题debug | ||
| systemctl start vncserver@: | systemctl start vncserver@: | ||
| If you kill your vncserver or unexpected dead, Please read / | If you kill your vncserver or unexpected dead, Please read / | ||
| At first, please verify Xvnc process not running. | At first, please verify Xvnc process not running. | ||
| - | < | + | |
| + | ``` | ||
| Dec 15 14:11:11 www runuser: Warning: www.example.com: | Dec 15 14:11:11 www runuser: Warning: www.example.com: | ||
| ... | ... | ||
| Dec 15 14:12:52 www runuser: Warning: www.example.com: | Dec 15 14:12:52 www runuser: Warning: www.example.com: | ||
| - | </ | + | ``` |
| then you remove | then you remove | ||
| - | < | + | |
| + | ``` | ||
| # rm -f / | # rm -f / | ||
| # rm -f / | # rm -f / | ||
| - | </ | + | ``` |
| and restart your vncserver. | and restart your vncserver. | ||
| - | < | + | |
| + | ``` | ||
| # systemctl restart vncserver@: | # systemctl restart vncserver@: | ||
| - | </ | + | ``` |
| 行 333: | 行 374: | ||
| - | ===== - vnc viewer软件下载 | + | ## - vnc viewer软件下载 |
| - | + | https:// | |
| - | https:// | + | |
| - | ===== - 其它远程软件 | + | ## - 其它远程软件 |
| * https:// | * https:// | ||
| * https:// | * https:// | ||
| 行 370: | 行 410: | ||
| - | {{: | + | 