centos 安装noVNC web交付方式远程连接vnc
适配于 CentOS 6 的安装脚本
#!/bin/bash
# stop selinux and iptables
setenforce 0
service iptables stop
# install vncserver and git
yum install tigervnc-server git -y
vncserver :1
# 此时会提示输入密码
# download noVNC
git clone git://github.com/kanaka/noVNC
# create secure connection
cd ./noVNC/utils/
openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem
# run noVNC
cd ../
./utils/launch.sh --vnc localhost:5901
# running
适配于 CentOS 7 的安装脚本
#!/bin/bash
# stop selinux and iptables
setenforce 0
systemctl stop firewalld
systemctl disable firewalld
# install vncserver and git
yum install -y epel*
yum install tigervnc-server git -y
vncserver :1
# 此时会提示输入密码
# download noVNC
git clone git://github.com/kanaka/noVNC
# create secure connection
cd ./noVNC/utils/
openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem
# run noVNC
cd ../
./utils/launch.sh --vnc localhost:5901
# running
什么是noVNC
noVNC 是一个 HTML5 VNC 客户端,采用 HTML 5 WebSockets, Canvas 和 JavaScript 实现,noVNC 被普遍用在各大云计算、虚拟机控制面板中,比如 OpenStack Dashboard 和 OpenNebula Sunstone 都用的是 noVNC。
noVNC 采用 WebSockets 实现,但是目前大多数 VNC 服务器都不支持 WebSockets,所以 noVNC 是不能直接连接 VNC 服务器的,需要一个代理来做 WebSockets 和 TCP sockets 之间的转换。这个代理在 noVNC 的目录里,叫做 websockify 。
实验环境
VMware Workstations
带桌面的CentOS7虚拟机
Windows 10 宿主机 + Google Chrome浏览器
关闭防火墙
setenforce 0
systemctl stop firewalld
systemctl disable firewalld
安装noVNC
安装依赖软件包
yum install -y epel*
yum install -y git
yum install -y tigervnc-server
执行以下命令并输入密码启动服务
vncserver :1
安装noVNC
git clone git://github.com/kanaka/noVNC
创建安全连接(一路回车下去...)
cd ./noVNC/utils/
openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem
注: VNC的默认会话不是安全的,需要创建一个安全的VNC连接。创建完毕的证书 self.pem 需要放置到 noVNC/utils 目录下,当启动 noVNC 时,websockify将自动装载证书。
运行noVNC
# 在noVNC目录下,执行
./utils/launch.sh --vnc localhost:5901
测试连接
在浏览器访问(注意替换成自己的IP地址) http://192.168.204.10:6080/vnc.html
输入密码,连接成功!
相关文章
- python3.7安装pip_centos怎么安装
- centos 如何退出vim
- CentOS 7.5 PhpMyAdmin安装教程
- centos安装python环境
- CentOS 在VMware下配置网络
- centos安装mysql客户端安装_CENTOS安装MYSQL
- centos7.4安装docker_docker运行centos
- CentOS下安装Jmeter
- dracut 查看linux分区,Centos进入dracut模式,报 /dev/centos/swap does not exist,如何恢复[通俗易懂]
- git私有服务器架设_centos搭建git服务器
- CentOS安装SQL Server
- Centos中安装lrzsz 实现windows与Linux间文件互传
- centos升级gcc至4.8
- centos安装神通数据库
- Centos 7 如何安装Redis(推荐)
- Centos配置SSH无密钥登录详解程序员
- Centos nginx安装详解程序员
- Centos步骤简明教程:安装Oracle 11g(centos安装oracle11g)
- 在CentOS 8上安装和使用Docker Compose
- 在CentOS 8上使用Nginx安装LibModsecurity Web应用程序防火墙
- 如何在 Centos 8 / RHEL 8 上安装和配置 VNC 服务器
- 利用yum在CentOS上安装MySQL 57(mysql yum 57)
- 解析centos中Apache、php、mysql默认安装路径