linux:vnc
差别
这里会显示出您选择的修订版和当前版本之间的差别。
| 两侧同时换到之前的修订记录前一修订版后一修订版 | 前一修订版 | ||
| linux:vnc [2026/10/13 22:06] – 外部编辑 127.0.0.1 | linux:vnc [2026/10/15 21:29] (当前版本) – 外部编辑 127.0.0.1 | ||
|---|---|---|---|
| 行 20: | 行 20: | ||
| ### - VNC建立vncserver服务 | ### - VNC建立vncserver服务 | ||
| - | 一般情况下,是采用如下命令来建立vncserver服务:\\ | + | 一般情况下,是采用如下命令来建立vncserver服务:\ |
| - | < | + | |
| + | ``` | ||
| + | vncserver -geometry 1900x980 :1 | ||
| + | ``` | ||
| : | : | ||
| 行 31: | 行 35: | ||
| #### - 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 | ||
| 行 47: | 行 52: | ||
| COMMIT | COMMIT | ||
| [root@ayls-s3 init.d]# | [root@ayls-s3 init.d]# | ||
| - | </ | + | ``` |
| 行 57: | 行 63: | ||
| ### - 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 : | ||
| 行 68: | 行 76: | ||
| CentOS6配置: | CentOS6配置: | ||
| - | < | + | |
| + | ```bash | ||
| # 开启服务 | # 开启服务 | ||
| / | / | ||
| 行 76: | 行 85: | ||
| chkconfig | chkconfig | ||
| chkconfig | chkconfig | ||
| - | </ | + | ``` |
| CentOS7配置: | CentOS7配置: | ||
| - | < | + | |
| + | ```bash | ||
| # 开机启动 | # 开机启动 | ||
| systemctl enable vncserver-virtuald.service | systemctl enable vncserver-virtuald.service | ||
| 行 87: | 行 98: | ||
| # 查看状态 | # 查看状态 | ||
| systemctl status vncserver-virtuald.service | systemctl status vncserver-virtuald.service | ||
| - | </ | + | ``` |
| 行 106: | 行 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. | ||
| 行 122: | 行 134: | ||
| - | ^ Process | + | |
| - | | core | Xvnc | Connectivity, | + | | Process |
| - | | User interface | + | | --- | --- | --- | --- | |
| - | | Daemon | + | | core | Xvnc | Connectivity, |
| + | | User interface | vncserverui-virtual | Locale, file transfer, and chat. | | | ||
| + | | Daemon | vncserver-virtuald | Connectivity, | ||
| 行 134: | 行 148: | ||
| 创建文件`/ | 创建文件`/ | ||
| - | < | + | |
| + | ``` | ||
| -geometry 1366x768 | -geometry 1366x768 | ||
| # 联想小新pad Pro 2021更适合 1280x768分辨率。 | # 联想小新pad Pro 2021更适合 1280x768分辨率。 | ||
| - | </ | + | ``` |
| 行 147: | 行 163: | ||
| ### - 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: | ||
| | | ||
| 行 173: | 行 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) | ||
| 行 182: | 行 199: | ||
| 四、安装序列号 | 四、安装序列号 | ||
| - | < | + | |
| + | ``` | ||
| / | / | ||
| 69NCN-JRLBC-QD28Y-5KLY2-UEE6A | 69NCN-JRLBC-QD28Y-5KLY2-UEE6A | ||
| 行 189: | 行 207: | ||
| 6XQQQ-WXL4Q-NN4KX-NUTC6-8ZK6A | 6XQQQ-WXL4Q-NN4KX-NUTC6-8ZK6A | ||
| PGUFQ-HTZBB-WNHU7-YHDQC-A7R6A | PGUFQ-HTZBB-WNHU7-YHDQC-A7R6A | ||
| - | </ | + | ``` |
| 行 198: | 行 217: | ||
| #### - 设置开机启动 | #### - 设置开机启动 | ||
| - | < | + | |
| + | ``` | ||
| + | chkconfig vncserver on | ||
| + | ``` | ||
| #### - 重启服务 | #### - 重启服务 | ||
| - | < | + | |
| + | ``` | ||
| + | service vncserver restart | ||
| + | ``` | ||
| #### - 多用户 | #### - 多用户 | ||
| - | 编辑文件,vi / | + | 编辑文件,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包,可以使用如下配置 | ||
| - | < | + | |
| + | ``` | ||
| + | VNCSERVERARGS[1]=" | ||
| + | ``` | ||
| 按照上述操作,在每次机器开机时,都会自动开启多个vncserver服务,直接使用vncviewer连接即可。 | 按照上述操作,在每次机器开机时,都会自动开启多个vncserver服务,直接使用vncviewer连接即可。 | ||
| 行 238: | 行 281: | ||
| ### - 配置 | ### - 配置 | ||
| - | < | + | |
| + | ```bash | ||
| cp / | cp / | ||
| # 修改vncserver@: | # 修改vncserver@: | ||
| 行 286: | 行 330: | ||
| # | # | ||
| - | </ | + | ``` |
| 行 294: | 行 339: | ||
| 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@: | ||
| - | </ | + | ``` |
| 行 359: | 行 410: | ||
| - | 