KVM虚拟化

浅浅的花香味﹌ 2023-03-04 13:28 137阅读 0赞

KVM虚拟化

  • 虚拟化介绍
  • kvm介绍
  • 1.KVM安装
  • 2.kvm web管理界面安装
  • 3.添加虚拟机
    • 3.1登录
      • A.案例1
    • 3.2.添加虚拟机
  • 4.配置虚拟机
    • 4.1创建存储池
    • 4.2添加镜像
    • 4.3添加网络池
    • 4.4.配置虚拟机
  • 5.启动
      • B.案例2
  • 6.完成

#

#

#

虚拟化介绍

虚拟化是云计算的基础。简单的说,虚拟化使得在一台物理的服务器上可以跑多台虚拟机,虚拟机共享物理机的 CPU、内存、IO 硬件资源,但逻辑上虚拟机之间是相互隔离的。


物理机我们一般称为宿主机(Host),宿主机上面的虚拟机称为客户机(Guest)。


宿主机(Host)是通过一个叫做 Hypervisor 的程序实现硬件资源虚拟化,并提供给客户机(Guest) 使用的


根据 Hypervisor 的实现方式和所处的位置,虚拟化又分为两种:

全虚拟化
半虚拟化

全虚拟化:
Hypervisor 直接安装在物理机上,多个虚拟机在 Hypervisor 上运行。Hypervisor 实现方式一般是一个特殊定制的 Linux 系统。Xen 和 VMWare 的 ESXi 都属于这个类型
在这里插入图片描述


半虚拟化:
物理机上首先安装常规的操作系统,比如 Redhat、Ubuntu 和 Windows。Hypervisor 作为 OS 上的一个程序模块运行,并对管理虚拟机进行管理。KVM、VirtualBox 和 VMWare Workstation 都属于这个类型
在这里插入图片描述

kvm介绍

kVM 全称是 Kernel-Based Virtual Machine。也就是说 KVM 是基于 Linux 内核实现的。
KVM有一个内核模块叫 kvm.ko,只用于管理虚拟 CPU 和内存。

那 IO 的虚拟化,比如存储和网络设备则是由 Linux 内核与Qemu来实现。

作为一个 Hypervisor,KVM 本身只关注虚拟机调度和内存管理这两个方面。IO 外设的任务交给 Linux 内核和 Qemu。

大家在网上看 KVM 相关文章的时候肯定经常会看到 Libvirt 这个东西,Libvirt 就是 KVM 的管理工具

其实,Libvirt 除了能管理 KVM 这种 Hypervisor,还能管理 Xen,VirtualBox 等。



Libvirt 包含 3 个东西:后台 daemon 程序 libvirtd、API 库和命令行工具 virsh

libvirtd是服务程序,接收和处理 API 请求;
API 库使得其他人可以开发基于Libvirt的高级工具,比如 virt-manager,这是个图形化的KVM管理工具
virsh 是我们经常要用的 KVM 命令行工具    

1.KVM安装

  1. 关闭防火墙和selinux
  2. [root@zyy180 ~]# systemctl stop firewalld
  3. [root@zyy180 ~]# systemctl disable firewalld
  4. Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
  5. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
  6. [root@zyy180 ~]# setenforce 0
  7. [root@zyy180 ~]# sed -ri 's/^(SELINUX=).*/\1disabled/g' /etc/selinux/config
  8. [root@zyy180 ~]# reboot
  9. 下载网络源
  10. [root@zyy180 ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
  11. [root@zyy180 ~]# sed -i 's/\$releasever/7/g' /etc/yum.repos.d/Centos-7.repo
  12. [root@zyy180 ~]# sed -i 's/^enabled=.*/enabled=1/g' /etc/yum.repos.d/Centos-7.repo
  13. 建立缓存
  14. [root@zyy180 ~]# yum makecache fast
  15. 下载所需软件
  16. [root@zyy180 ~]# yum -y install epel-release vim wget net-tools unzip zip gcc gcc-c++
  17. 验证CPU是否支持KVM;如果结果中有vmxIntel)或svm(AMD)字样,就说明CPU的支持的
  18. [root@zyy180 ~]# egrep -o 'vmx|svm' /proc/cpuinfo
  19. vmx
  20. vmx
  21. vmx
  22. vmx
  23. 1.kvm安装
  24. [root@zyy180 ~]# yum -y install qemu-kvm qemu-kvm-tools qemu-img virt-manager libvirt libvirt-python libvirt-client virt-install virt-viewer bridge-utils libguestfs-tools
  25. 2.这里一般是要用桥接网卡,保证虚拟机和公司网络在同一网段
  26. root@zyy180 ~]# cd /etc/sysconfig/network-scripts/
  27. [root@zyy180 network-scripts]# cp ifcfg-ens33 ifcfg-br0
  28. TYPE="Bridge"
  29. NM_CONTROLLED=no
  30. BOOTPROTO="static"
  31. DEFROUTE="yes"
  32. NAME="br0"
  33. DEVICE="br0"
  34. ONBOOT="yes"
  35. IPADDR=192.168.30.150
  36. NETMASK=255.255.255.0
  37. GATEWAY=192.168.30.2
  38. DNS1=114.114.114.114
  39. [root@zyy180 network-scripts]# vim ifcfg-ens33
  40. TYPE="Ethernet"
  41. BOOTPROTO="static"
  42. NAME="ens33"
  43. DEVICE="ens33"
  44. ONBOOT="yes"
  45. BRIDGE=br0
  46. NM_CONTROLLED=no
  47. 查看网卡信息
  48. [root@zyy180 ~]# ip a
  49. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
  50. link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  51. inet 127.0.0.1/8 scope host lo
  52. valid_lft forever preferred_lft forever
  53. inet6 ::1/128 scope host
  54. valid_lft forever preferred_lft forever
  55. 2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP qlen 1000
  56. link/ether 00:0c:29:50:dc:de brd ff:ff:ff:ff:ff:ff
  57. inet6 fe80::20c:29ff:fe50:dcde/64 scope link
  58. valid_lft forever preferred_lft forever
  59. 3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
  60. link/ether 00:0c:29:50:dc:de brd ff:ff:ff:ff:ff:ff
  61. inet 192.168.30.150/24 brd 192.168.30.255 scope global br0
  62. valid_lft forever preferred_lft forever
  63. inet6 fe80::20c:29ff:fe50:dcde/64 scope link
  64. valid_lft forever preferred_lft forever
  65. [root@zyy180 ~]# systemctl restart network
  66. 重启libvirtd服务
  67. [root@zyy180 ~]# systemctl start libvirtd
  68. [root@zyy180 ~]# systemctl enable libvirtd
  69. 验证安装结果
  70. [root@zyy180 ~]# lsmod|grep kvm
  71. kvm_intel 170086 0
  72. kvm 566340 1 kvm_intel
  73. irqbypass 13503 1 kvm
  74. /测试并验证安装结果
  75. [root@zyy180 ~]# virsh -c qemu:///system list
  76. Id 名称 状态
  77. ----------------------------------------------------
  78. [root@zyy180 ~]# virsh --version
  79. 4.5.0
  80. [root@zyy180 ~]# virt-install --version
  81. 1.5.0
  82. 3.做个软连接,保证系统能找到qemu-kvm
  83. [root@zyy180 ~]# ln -s /usr/libexec/qemu-kvm /usr/bin/qemu-kvm
  84. 查看网桥信息
  85. [root@zyy180 ~]# brctl show
  86. bridge name bridge id STP enabled interfaces
  87. br0 8000.000c2950dcde no ens33
  88. virbr0 8000.525400597859 yes virbr0-nic

   

2.kvm web管理界面安装

  1. 1.安装依赖包
  2. [root@zyy180 ~]# yum -y install git python-pip libvirt-python libxml2-python python-websockify supervisor nginx python-devel
  3. 2.升级pip
  4. [root@zyy180 ~]# pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple/
  5. Collecting pip
  6. Downloading https://pypi.tuna.tsinghua.edu.cn/packages/36/74/38c2410d688ac7b48afa07d413674afc1f903c1c1f854de51dc8eb2367a5/pip-20.2-py2.py3-none-any.whl (1.5MB)
  7. 100% |████████████████████████████████| 1.5MB 593kB/s
  8. Installing collected packages: pip
  9. Found existing installation: pip 8.1.2
  10. Uninstalling pip-8.1.2:
  11. Successfully uninstalled pip-8.1.2
  12. Successfully installed pip-20.2
  13. 2.github上下载webvirtmgr代码
  14. [root@zyy180 ~]# cd /usr/local/src/
  15. [root@zyy180 src]# git clone git://github.com/retspen/webvirtmgr.git
  16. 正克隆到 'webvirtmgr'...
  17. remote: Enumerating objects: 5614, done.
  18. remote: Total 5614 (delta 0), reused 0 (delta 0), pack-reused 5614
  19. 接收对象中: 100% (5614/5614), 2.98 MiB | 10.00 KiB/s, done.
  20. 处理 delta 中: 100% (3602/3602), done.
  21. 3.安装webvirtmgr
  22. [root@zyy180 webvirtmgr]# pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
  23. 检查sqlite3是否安装
  24. [root@zyy180 ~]# python
  25. Python 2.7.5 (default, Apr 2 2020, 13:16:51)
  26. [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2
  27. Type "help", "copyright", "credits" or "license" for more information.
  28. >>> import sqlite3
  29. >>> exit()
  30. 4.初始化帐号信息
  31. [root@zyy180 webvirtmgr]# python manage.py syncdb
  32. WARNING:root:No local_settings file found.
  33. Creating tables ...
  34. Creating table auth_permission
  35. Creating table auth_group_permissions
  36. Creating table auth_group
  37. Creating table auth_user_groups
  38. Creating table auth_user_user_permissions
  39. Creating table auth_user
  40. Creating table django_content_type
  41. Creating table django_session
  42. Creating table django_site
  43. Creating table servers_compute
  44. Creating table instance_instance
  45. Creating table create_flavor
  46. You just installed Django's auth system, which means you don't have any superusers defined.
  47. Would you like to create one now? (yes/no): yes
  48. Username (leave blank to use 'root'):
  49. Email address: 1412@qq.com
  50. Password:
  51. Password (again):
  52. Superuser created successfully.
  53. Installing custom SQL ...
  54. Installing indexes ...
  55. Installed 6 object(s) from 1 fixture(s)
  56. 5.拷贝web网页至指定目录
  57. [root@zyy180 webvirtmgr]# mkdir /var/www
  58. [root@zyy180 webvirtmgr]# cp -r /usr/local/src/webvirtmgr/ /var/www/
  59. [root@zyy180 webvirtmgr]# chown -R nginx.nginx /var/www/webvirtmgr/
  60. 6.生成密钥
  61. [root@zyy180 ~]# ssh-keygen -t rsa
  62. Generating public/private rsa key pair.
  63. Enter file in which to save the key (/root/.ssh/id_rsa):
  64. Created directory '/root/.ssh'.
  65. Enter passphrase (empty for no passphrase):
  66. Enter same passphrase again:
  67. Your identification has been saved in /root/.ssh/id_rsa.
  68. Your public key has been saved in /root/.ssh/id_rsa.pub.
  69. The key fingerprint is:
  70. SHA256:jhkhq3fzTKROVjeyfATLMeBuxA6V+3QQYwkEtlj6l6k root@zyy180
  71. The key's randomart image is:
  72. +---[RSA 2048]----+
  73. | +o=o+o |
  74. | = =.oo. |
  75. | o + =.+. |
  76. | . B.=.=. |
  77. | o OoS.+ |
  78. | . + X.= . |
  79. | . E O = . |
  80. | . = = . |
  81. | . o |
  82. +----[SHA256]-----+
  83. 7.做互信,
  84. 这里webvirtmgr和kvm服务部署在同一台主机上,所以地址为本地地址
  85. 如果kvm部署在其他主机 地址改为kvm主机
  86. [root@zyy180 ~]# ssh-copy-id 192.168.30.150
  87. /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
  88. The authenticity of host '192.168.30.150 (192.168.30.150)' can't be established.
  89. ECDSA key fingerprint is SHA256:bGJka92FBGDxlsCxrm6FWR/nryT8gK/uWC/jwUe37Uw.
  90. ECDSA key fingerprint is MD5:46:4e:e1:0e:e5:0e:b4:8f:b3:a8:cd:5d:7d:5b:22:2f.
  91. Are you sure you want to continue connecting (yes/no)? yes
  92. /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
  93. /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
  94. root@192.168.30.150's password:
  95. Number of key(s) added: 1
  96. Now try logging into the machine, with: "ssh '192.168.30.150'"
  97. and check to make sure that only the key(s) you wanted were added.
  98. 8.配置端口转发
  99. [root@zyy180 ~]# ssh 192.168.30.150 -L localhost:8000:localhost:8000 -L localhost:6080:localhost:60
  100. Last login: Mon Aug 3 19:57:21 2020 from 192.168.30.1
  101. [root@zyy180 ~]# ss -anlt
  102. State Recv-Q Send-Q Local Address:Port Peer Address:Port
  103. LISTEN 0 128 *:111 *:*
  104. LISTEN 0 5 192.168.122.1:53 *:*
  105. LISTEN 0 128 *:22 *:*
  106. LISTEN 0 100 127.0.0.1:25 *:*
  107. LISTEN 0 128 *:8000 *:*
  108. LISTEN 0 100 *:6080 *:*
  109. LISTEN 0 128 :::111 :::*
  110. LISTEN 0 128 :::22 :::*
  111. LISTEN 0 100 ::1:25 :::*
  112. 9.配置nginx
  113. [root@zyy180 ~]# vim /etc/nginx/nginx.conf
  114. user nginx;
  115. worker_processes auto;
  116. error_log /var/log/nginx/error.log;
  117. pid /run/nginx.pid;
  118. include /usr/share/nginx/modules/*.conf;
  119. events {
  120. worker_connections 1024;
  121. }
  122. http {
  123. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  124. '$status $body_bytes_sent "$http_referer" '
  125. '"$http_user_agent" "$http_x_forwarded_for"';
  126. access_log /var/log/nginx/access.log main;
  127. sendfile on;
  128. tcp_nopush on;
  129. tcp_nodelay on;
  130. keepalive_timeout 65;
  131. types_hash_max_size 2048;
  132. include /etc/nginx/mime.types;
  133. default_type application/octet-stream;
  134. include /etc/nginx/conf.d/*.conf;
  135. server {
  136. listen 80;
  137. server_name localhost;
  138. include /etc/nginx/default.d/*.conf;
  139. location / {
  140. root html;
  141. index index.html index.htm;
  142. }
  143. error_page 404 /404.html;
  144. location = /40x.html {
  145. }
  146. error_page 500 502 503 504 /50x.html;
  147. location = /50x.html {
  148. }
  149. }
  150. }
  151. [root@zyy180 ~]# vim /etc/nginx/conf.d/webvirtmgr.conf
  152. server {
  153. listen 80 default_server;
  154. server_name $hostname;
  155. #access_log /var/log/nginx/webvirtmgr_access_log;
  156. location /static/ {
  157. root /var/www/webvirtmgr/webvirtmgr;
  158. expires max;
  159. }
  160. location / {
  161. proxy_pass http://127.0.0.1:8000;
  162. proxy_set_header X-Real-IP $remote_addr;
  163. proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
  164. proxy_set_header Host $host:$server_port;
  165. proxy_set_header X-Forwarded-Proto $remote_addr;
  166. proxy_connect_timeout 600;
  167. proxy_read_timeout 600;
  168. proxy_send_timeout 600;
  169. client_max_body_size 1024M;
  170. }
  171. }
  172. 确保bind绑定的是本机的8000端口
  173. [root@zyy180 ~]# vim /var/www/webvirtmgr/conf/gunicorn.conf.py
  174. bind = '0.0.0.0:8000'
  175. 10.重启nginx
  176. [root@zyy180 ~]# systemctl restart nginx
  177. [root@zyy180 ~]# ss -anlt
  178. State Recv-Q Send-Q Local Address:Port Peer Address:Port
  179. LISTEN 0 128 *:80 *:*
  180. LISTEN 0 5 192.168.122.1:53 *:*
  181. LISTEN 0 128 *:22 *:*
  182. LISTEN 0 100 127.0.0.1:25 *:*
  183. LISTEN 0 128 127.0.0.1:6080 *:*
  184. LISTEN 0 128 127.0.0.1:8000 *:*
  185. LISTEN 0 128 :::22 :::*
  186. LISTEN 0 100 ::1:25 :::*
  187. LISTEN 0 128 ::1:6080 :::*
  188. LISTEN 0 128 ::1:8000 :::*
  189. 11.设置supervisor
  190. [root@zyy180 ~]# vim /etc/supervisord.conf
  191. [program:webvirtmgr]
  192. command=/usr/bin/python2 /var/www/webvirtmgr/manage.py run_gunicorn -c /var/www/webvirtmgr/conf/gunicorn.conf.py
  193. directory=/var/www/webvirtmgr
  194. autostart=true
  195. autorestart=true
  196. logfile=/var/log/supervisor/webvirtmgr.log
  197. log_stderr=true
  198. user=nginx
  199. [program:webvirtmgr-console]
  200. command=/usr/bin/python2 /var/www/webvirtmgr/console/webvirtmgr-console
  201. directory=/var/www/webvirtmgr
  202. autostart=true
  203. autorestart=true
  204. stdout_logfile=/var/log/supervisor/webvirtmgr-console.log
  205. redirect_stderr=true
  206. user=nginx
  207. 12.启动supervisor并设置开机自启
  208. [root@zyy180 ~]# systemctl enable supervisord
  209. [root@zyy180 ~]# systemctl start supervisord
  210. [root@zyy180 ~]# ss -anlt
  211. State Recv-Q Send-Q Local Address:Port Peer Address:Port
  212. LISTEN 0 128 *:111 *:*
  213. LISTEN 0 128 *:80 *:*
  214. LISTEN 0 5 192.168.122.1:53 *:*
  215. LISTEN 0 128 *:22 *:*
  216. LISTEN 0 100 127.0.0.1:25 *:*
  217. LISTEN 0 128 *:8000 *:*
  218. LISTEN 0 100 *:6080 *:*
  219. LISTEN 0 128 :::111 :::*
  220. LISTEN 0 128 :::22 :::*
  221. LISTEN 0 100 ::1:25 :::*
  222. 13.配置nginx用户
  223. [root@zyy180 ~]# su - nginx -s /bin/bash
  224. -bash-4.2$ ssh-keygen -t rsa
  225. Generating public/private rsa key pair.
  226. Enter file in which to save the key (/var/lib/nginx/.ssh/id_rsa):
  227. Created directory '/var/lib/nginx/.ssh'.
  228. Enter passphrase (empty for no passphrase):
  229. Enter same passphrase again:
  230. Your identification has been saved in /var/lib/nginx/.ssh/id_rsa.
  231. Your public key has been saved in /var/lib/nginx/.ssh/id_rsa.pub.
  232. The key fingerprint is:
  233. SHA256:ohczhDrvonTF5b6Q2+8Zqij2eIu4C7yQRT9QnNynF/k nginx@zyy180
  234. The key's randomart image is:
  235. +---[RSA 2048]----+
  236. | o.o . |
  237. | .+.. + |
  238. | o . .+ o |
  239. | . +..+ . E |
  240. | + oo=oS |
  241. |.o o.oo= |
  242. |+o .oo.. . |
  243. |=o*o..+ o o |
  244. |*B+=oo.+o+ |
  245. +----[SHA256]-----+
  246. -bash-4.2$ touch ~/.ssh/config
  247. -bash-4.2$ echo -e "StrictHostKeyChecking=no\nUserKnownHostsFile=/dev/null" >> ~/.ssh/config
  248. -bash-4.2$ chmod 0600 ~/.ssh/config
  249. -bash-4.2$ ssh-copy-id root@192.168.30.150
  250. /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/var/lib/nginx/.ssh/id_rsa.pub"
  251. /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
  252. /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
  253. Warning: Permanently added '192.168.30.150' (ECDSA) to the list of known hosts.
  254. root@192.168.30.150's password:
  255. Number of key(s) added: 1
  256. Now try logging into the machine, with: "ssh 'root@192.168.30.150'"
  257. and check to make sure that only the key(s) you wanted were added.
  258. -bash-4.2$ exit
  259. 登出
  260. [root@zyy180 ~]# vim /etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access.pkla
  261. [Remote libvirt SSH access]
  262. Identity=unix-user:root
  263. Action=org.libvirt.unix.manage
  264. ResultAny=yes
  265. ResultInactive=yes
  266. ResultActive=yes
  267. [root@zyy180 ~]# chown -R root.root /etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access.pkla
  268. [root@zyy180 ~]# systemctl restart nginx libvirtd
  269. [root@zyy180 ~]# ss -anlt
  270. State Recv-Q Send-Q Local Address:Port Peer Address:Port
  271. LISTEN 0 1 *:5900 *:*
  272. LISTEN 0 128 *:111 *:*
  273. LISTEN 0 128 *:80 *:*
  274. LISTEN 0 5 192.168.122.1:53 *:*
  275. LISTEN 0 128 *:22 *:*
  276. LISTEN 0 100 127.0.0.1:25 *:*
  277. LISTEN 0 128 *:8000 *:*
  278. LISTEN 0 100 *:6080 *:*
  279. LISTEN 0 128 :::111 :::*
  280. LISTEN 0 128 :::22 :::*
  281. LISTEN 0 100 ::1:25 :::*

     

3.添加虚拟机

3.1登录

http://192.168.30.150

A.案例1

第一次可能会出现这种情况
在这里插入图片描述    

  1. [root@zyy180 ~]# vim /etc/nginx/nginx.conf
  2. user nginx;
  3. worker_processes auto;
  4. error_log /var/log/nginx/error.log;
  5. pid /run/nginx.pid;
  6. worker_rlimit_nofile 655350; 添加这行
  7. [root@zyy180 ~]# vim /etc/security/limits.conf
  8. * soft nofile 655350
  9. * hard nofile 655350
  10. 重启服务
  11. [root@zyy180 ~]# systemctl restart nginx

   

再次登录
在这里插入图片描述

   

3.2.添加虚拟机

在这里插入图片描述    

连接宿主机

在这里插入图片描述


点击网址

在这里插入图片描述    

4.配置虚拟机

   

4.1创建存储池

在这里插入图片描述    

路径是镜像所在目录
在这里插入图片描述    

在这里插入图片描述



将镜像传送到该目录下

  1. [root@zyy180 zyy]# ls
  2. rhel-server-7.4-x86_64-dvd.iso

4.2添加镜像

在这里插入图片描述


在这里插入图片描述


在这里插入图片描述    

4.3添加网络池

在这里插入图片描述


网络类型选BRIDGE

在这里插入图片描述


网络池配置完成

在这里插入图片描述    

4.4.配置虚拟机

在这里插入图片描述


在这里插入图片描述



磁盘镜像选择刚创建的vm1
网络池选择刚创建的br0

!注意 虚拟cpu的数量要与宿主机的cpu数量一致,否则在安装时会报错

在这里插入图片描述


将镜像开启

在这里插入图片描述


(已断开)是开启状态

在这里插入图片描述


网页登录密码(可做可不做)

在这里插入图片描述    

5.启动

在这里插入图片描述    

在这里插入图片描述    

B.案例2

在这里插入图片描述

  1. [root@zyy180 zyy]# yum -y install novnc
  2. [root@zyy180 zyy]# chmod +x /etc/rc.d/rc.local
  3. [root@zyy180 zyy]# vim /etc/rc.d/rc.local
  4. touch /var/lock/subsys/local
  5. nohup novnc_server 192.168.30.150:5920 & ##添加此行
  6. [root@zyy180 zyy]# source /etc/rc.d/rc.local

   

6.完成

在这里插入图片描述

在这里插入图片描述

发表评论

表情:
评论列表 (有 0 条评论,137人围观)

还没有评论,来说两句吧...

相关阅读

    相关 kvm虚拟

    第1章 虚拟化的分类 1.1  全虚拟化与半虚拟化 全虚拟化  又叫硬件辅助虚拟化技术,最初所使用的虚拟化技术就是全虚拟化(Full Virtualizatio

    相关 kvm网络虚拟管理

    1. Linux Bridge网桥管理   一个网桥上添加多个虚拟机,虚拟机之间是可以相互通信的的,同时虚拟机也都可以通外网。 ![1639072-2019062319