(1).虚拟化产品对比介绍

  虚拟化技术有以下三种:仿真虚拟化,这是一种对系统硬件没有要求,但性能最低的虚拟化技术;半虚拟化,这是一种直接使用物理硬件,性能高,但需要修改内核的虚拟化技术;全虚拟化,这是一种直接使用物理硬件,性能高的虚拟化技术。

  VMware支持仿真虚拟化,xen支持半虚拟化,KVM支持全虚拟化。其中VMware安装在Windows上,支持虚拟机系统与物理机系统不同;xen在REHL5中自带,安装时需要安装内核kernel-xen,只支持与物理机一样的操作系统;KVM在REHL6中自带,支持虚拟机系统与物理机系统不同。

  KVM全称Kernel-based Virtual Machine,中文名基于内核的虚拟机,是一个开源的系统虚拟化模块,自Linux 2.6.20之后集成在 之后集成在Linux的各个主要发行版本中,是第一个整合到Linux内核的虚拟化技术。它使用 Linux自身的调度器进行管理,所以相对于Xen,其核心源码很少。KVM目前已成为学术界的主流 VMM(虚拟机监控器 )之一。KVM的虚拟化需要硬件支持(如Intel  VT技术或者AMD V技术 )。是基于硬件的完全虚拟化。而Xen早期则是基于软件模拟的Para-Virtualization。在KVM模型中,每一个虚拟机都是一个由Linux调度程序管理的标准进程,你可以在用户空间启动客户机操作系统。另外,一个普通的 Linux 进程有两种运行模式:内核和用户。KVM增加了第三种模式:客户模式(有自己的内核和用户模式)。

  扩展:QEMU

    QEMU和vmware一样都是支持仿真虚拟化,但效率比较低。它是一套由Fabrice Bellard所编写的以GPL许可证分发源码的模拟处理器,在GNU/Linux平台上使用广泛。QEMU具有高速度和跨平台的特性,QEMU能模拟至接近真实电脑的速度。

(2).安装KVM前的准备

  由于我是在VMware里的CentOS7中安装KVM,首先需要确保系统是64位的。

  其次虚拟机设置,内存需要调大一点(我这里给的是4G),处理器核心数也多一点(我这里给到了物理核心数),处理器中还要开启虚拟化Intel VT-x/EPT或AMD-V/RVI,以及虚拟化CPU性能计数器(官方说明:如果您打算使用性能监控应用程序(如 VTune 或 OProfile)优化或调试虚拟机中运行的软件,可以打开此功能),最后加一块硬盘(我给的是50G)

  VMware官方文档:https://docs.vmware.com/cn/VMware-Workstation-Pro/index.html

  以上做完后登录系统,如果是Intel的CPU可以使用cat /proc/cpuinfo | grep --color vmx命令查看CPU是否支持全虚拟化,如果是AMD的CPU可以使用cat /proc/cpuinfo | grep --color svm命令查看CPU是否支持全虚拟化。如果是物理机也可以通过上网查找CPU型号来查看是否支持全虚拟化。

  1. [root@youxi1 ~]# cat /proc/cpuinfo | grep --color vmx
  2. flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm epb tpr_shadow vnmi ept vpid fsgsbase tsc_adjust smep dtherm ida arat pln pts
  3. flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm epb tpr_shadow vnmi ept vpid fsgsbase tsc_adjust smep dtherm ida arat pln pts
  4. flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm epb tpr_shadow vnmi ept vpid fsgsbase tsc_adjust smep dtherm ida arat pln pts
  5. flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm epb tpr_shadow vnmi ept vpid fsgsbase tsc_adjust smep dtherm ida arat pln pts
  6. [root@youxi1 ~]# cat /proc/cpuinfo | grep --color svm

  在确认CPU支持虚拟化之后,进入BIOS界面开启虚拟化支持,一般在设置或高级设置里面,找找有没有虚拟技术(Virtual Technology)。

(3).安装KVM

  配置本地系统镜像yum源(详见:配置本地yum源)和阿里云yum源,本地系统镜像yum源只需要临时挂载即可

  1. wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo  //基础源
  2. wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo  //epel源
  3. yum clean all  //清空yum缓存
  4. yum list  //根据新的yum源重新缓存

  安装KVM模块、管理工具和虚拟化服务,并启动

  1. [root@youxi1 ~]# yum -y install qemu-kvm virt-install virt-manager libvirt libguestfs-tools libvirt-python
  2. [root@youxi1 ~]# systemctl start libvirtd
  3. [root@youxi1 ~]# systemctl is-enabled libvirtd  //安装完成后,默认开机自启,如果显示disable请手动设置
  4. enabled
  5. [root@youxi1 ~]# ip a sh
  6. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
  7. link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  8. inet 127.0.0.1/8 scope host lo
  9. valid_lft forever preferred_lft forever
  10. inet6 ::1/128 scope host
  11. valid_lft forever preferred_lft forever
  12. 2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
  13. link/ether 00:0c:29:e6:d6:27 brd ff:ff:ff:ff:ff:ff
  14. inet 192.168.5.101/24 brd 192.168.5.255 scope global noprefixroute ens33
  15. valid_lft forever preferred_lft forever
  16. inet6 fe80::201:7257:85b:7dc8/64 scope link noprefixroute
  17. valid_lft forever preferred_lft forever
  18. 3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
  19. link/ether 52:54:00:4b:93:10 brd ff:ff:ff:ff:ff:ff
  20. inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
  21. valid_lft forever preferred_lft forever
  22. 4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
  23. link/ether 52:54:00:4b:93:10 brd ff:ff:ff:ff:ff:ff

  说明:qemu-kvm,KVM主程序,KVM虚拟化模块;virt-install,安装虚拟机的工具;virt-manager,KVM图形化管理工具;libvirt,虚拟化服务;libguestfs-tools,虚拟机的系统管理工具;libvirt-python,python调用libvirt虚拟化服务的api接口库文件。

  启动libvirtd后,会出现一块virbr0网卡,IP地址默认192.168.122.1/24。

(4).配置KVM网络桥接功能

  我们经常所说的Bridge设备其实就是网桥设备,也就相当于现在的二层交换机,用于连接同一网段内的所有机器,所以我们的目的就是将网络设备ens33添加到br0,此时br0就成为了所谓的交换机设备,我们物理机的ens33也是连接在上面的。

  安装网桥设备工具,并进行配置

  1. [root@youxi1 ~]# yum -y install bridge-utils
  2. [root@youxi1 ~]# cp /etc/sysconfig/network-scripts/ifcfg-ens33 .  //备份
  3. [root@youxi1 ~]# ls
  4. anaconda-ks.cfg ifcfg-ens33
  5. [root@youxi1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33
  6. #IPADDR="192.168.5.101"
  7. #PREFIX="24"
  8. #GATEWAY="192.168.5.2"
  9. #DNS1="192.168.5.2"
  10. BRIDGE="br0"  //添加
  11. [root@youxi1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-br0  //新建网桥配置文件
  12. DEVICE="br0"
  13. NM_CONTROLLED="yes"
  14. ONBOOT="yes"
  15. TYPE="Bridge"  //Bridge开头的B必须大写
  16. BOOTPROTO=none
  17. IPADDR=192.168.5.101  //需要与ens33注释的信息一致
  18. NETMASK=255.255.255.0
  19. GATEWAY=192.168.5.2
  20. DNS1=192.168.5.2

  重启网络,并进行查看

  1. [root@youxi1 ~]# systemctl restart network
  2. [root@youxi1 ~]# ip a sh
  3. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
  4. link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  5. inet 127.0.0.1/8 scope host lo
  6. valid_lft forever preferred_lft forever
  7. inet6 ::1/128 scope host
  8. valid_lft forever preferred_lft forever
  9. 2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000
  10. link/ether 00:0c:29:e6:d6:27 brd ff:ff:ff:ff:ff:ff
  11. 3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
  12. link/ether 52:54:00:4b:93:10 brd ff:ff:ff:ff:ff:ff
  13. inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
  14. valid_lft forever preferred_lft forever
  15. 4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
  16. link/ether 52:54:00:4b:93:10 brd ff:ff:ff:ff:ff:ff
  17. 5: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
  18. link/ether 00:0c:29:e6:d6:27 brd ff:ff:ff:ff:ff:ff
  19. inet 192.168.5.101/24 brd 192.168.5.255 scope global noprefixroute br0
  20. valid_lft forever preferred_lft forever
  21. inet6 fe80::20c:29ff:fee6:d627/64 scope link
  22. valid_lft forever preferred_lft forever
  23. [root@youxi1 ~]# ping www.baidu.com  //测试网络是否正常
  24. PING www.a.shifen.com (180.101.49.12) 56(84) bytes of data.
  25. 64 bytes from 180.101.49.12 (180.101.49.12): icmp_seq=1 ttl=128 time=7.59 ms
  26. 64 bytes from 180.101.49.12 (180.101.49.12): icmp_seq=2 ttl=128 time=6.06 ms
  27. 64 bytes from 180.101.49.12 (180.101.49.12): icmp_seq=3 ttl=128 time=6.30 ms
  28. ^C
  29. --- www.a.shifen.com ping statistics ---
  30. 3 packets transmitted, 3 received, 0% packet loss, time 2005ms
  31. rtt min/avg/max/mdev = 6.062/6.652/7.594/0.679 ms

(5).创建一台虚拟机

  KVM可以直接使用命令创建虚拟机,也可以在图形用户界面创建虚拟机,不过一般会直接使用命令安装,因为比较节省资源。

  不过在那之前,首先需要将sdb进行分区,格式化并挂载。

  1. [root@youxi1 ~]# fdisk /dev/sdb  //新建分区
  2. 欢迎使用 fdisk (util-linux 2.23.2)。
  3.  
  4. 更改将停留在内存中,直到您决定将更改写入磁盘。
  5. 使用写入命令前请三思。
  6.  
  7. Device does not contain a recognized partition table
  8. 使用磁盘标识符 0x5ddf8670 创建新的 DOS 磁盘标签。
  9.  
  10. 命令(输入 m 获取帮助):n
  11. Partition type:
  12. p primary (0 primary, 0 extended, 4 free)
  13. e extended
  14. Select (default p): p
  15. 分区号 (1-4,默认 1):
  16. 起始 扇区 (2048-104857599,默认为 2048):
  17. 将使用默认值 2048
  18. Last 扇区, +扇区 or +size{K,M,G} (2048-104857599,默认为 104857599):
  19. 将使用默认值 104857599
  20. 分区 1 已设置为 Linux 类型,大小设为 50 GiB
  21.  
  22. 命令(输入 m 获取帮助):w
  23. The partition table has been altered!
  24.  
  25. Calling ioctl() to re-read partition table.
  26. 正在同步磁盘。
  27. [root@youxi1 ~]# mkfs.xfs /dev/sdb1  //格式化
  28. meta-data=/dev/sdb1 isize=512 agcount=4, agsize=3276736 blks
  29. = sectsz=512 attr=2, projid32bit=1
  30. = crc=1 finobt=0, sparse=0
  31. data = bsize=4096 blocks=13106944, imaxpct=25
  32. = sunit=0 swidth=0 blks
  33. naming =version 2 bsize=4096 ascii-ci=0 ftype=1
  34. log =internal log bsize=4096 blocks=6399, version=2
  35. = sectsz=512 sunit=0 blks, lazy-count=1
  36. realtime =none extsz=4096 blocks=0, rtextents=0
  37. [root@youxi1 ~]# mount /dev/sdb1 /var/lib/libvirt/images/  //挂载
  38. [root@youxi1 ~]# blkid  //查看sdb1的UUID
  39. /dev/sda1: UUID="037d87f8-b6dd-426c-9d71-7ce5ec0d4103" TYPE="xfs"
  40. /dev/sda2: UUID="qryeOm-pb2K-SeE0-10tR-0jSL-x15s-4yI6cl" TYPE="LVM2_member"
  41. /dev/sdb1: UUID="771ee3b3-ba49-49bc-b3be-3736a329f532" TYPE="xfs"
  42. /dev/sr0: UUID="2018-05-03-20-55-23-00" LABEL="CentOS 7 x86_64" TYPE="iso9660" PTTYPE="dos"
  43. /dev/mapper/vg1-root: UUID="dffa058f-4c86-480b-8ff9-bfe973f7ca95" TYPE="xfs"
  44. /dev/mapper/vg1-swap: UUID="289bf00b-3804-4b11-8c8d-1dc964fc3a8b" TYPE="swap"
  45. [root@youxi1 ~]# echo "UUID=771ee3b3-ba49-49bc-b3be-3736a329f532 /var/lib/libvirt/images/ xfs defaults 0 0" >> /etc/fstab

 1)图形界面新建虚拟机

  首先确保有图形界面,没有的使用如下命令进行安装。在安装过程的同时,可以上传一个系统镜像

  1. [root@youxi1 ~]# yum -y groupinstall "GNOME Desktop"
  2. //如果遇到如下错误,请使用下面的升级包命令
  3. Transaction check error:
  4. file /boot/efi/EFI/centos from install of fwupdate-efi-12-5.el7.centos.x86_64 conflicts with file from package grub2-common-1:2.02-0.65.el7.centos.2.noarch
  5. [root@youxi1 ~]# yum -y upgrade  //该命令升级所有包,但不改变软件和系统设置,内核不变
  6. //接着重新安装图形界面
  7. [root@youxi1 ~]# yum -y groupinstall "GNOME Desktop"
  8. [root@youxi1 ~]# init 5  //转到图形化界面

  然后经过一系列的设置,注销新建的用户,回到root用户下总算可以开始新建虚拟机了。使用命令virt-manager调出虚拟系统管理器,当然也可以在应用程序-->系统工具-->虚拟系统管理器来调出。

  选中QEMU/KVM,右键新建

  接着出现如下界面,选择本地安装介质,前进(Next)

  使用ISO映像,点击浏览

  会出现一个新的界面,点击本地浏览

  找到上传的ISO位置,最后点击打开即可

  此时又会回到之前的“使用ISO映像”的页面,点击前进。如果是在/root/目录下会提示可能没有权限

  设置内存和CPU,然后点击前进

  设置硬盘大小,前进

  设置虚拟机名称,选择网络,完成

  最后会跳出一个CentOS7的安装界面,正常安装即可。

  在这个界面的菜单栏下方,小灯泡标志就是设置界面。

2)字符界面新建虚拟机

  在安装前,请先看(6).扩展。我看了很多都是伪字符界面安装,都是用的VNC安装,找了一段时间看到了这位大佬的文章:https://blog.csdn.net/qeeezz11224/article/details/84575910

  可以在新建KVM虚拟机之前使用命令指定虚拟机存储格式,最常见的是qemu-img命令。

  使用virt-install新建一个KVM虚拟机。注意:由于我是复制下来的,所以看到的设置菜单的格式会有问题,大概看看,很简单的。感叹号!表示有问题,需要修改或等待刷新根据下方提示进行操作。

  1. [root@youxi1 ~]# virt-install --virt-type kvm \
  2. --name centos75 \
  3. --vcpus 1 \
  4. --memory 1024 \
  5. --location /root/CentOS-7-x86_64-DVD-1804.iso \
  6. --disk /var/lib/libvirt/images/centos75.img,size=10 \
  7. --network bridge=br0 \
  8. --graphics none \
  9. --extra-args='console=ttyS0' \
  10. --force
  11. ......
  12. //中间跑一段时间,出现第一个界面
  13. Installation
  14.  
  15. 1) [x] Language settings 2) [!] Time settings
  16. (English (United States)) (Timezone is not set.)
  17. 3) [!] Installation source 4) [!] Software selection
  18. (Processing...) (Processing...)
  19. 5) [!] Installation Destination 6) [x] Kdump
  20. (No disks selected) (Kdump is enabled)
  21. 7) [ ] Network configuration 8) [!] Root password
  22. (Not connected) (Password is not set.)
  23. 9) [!] User creation
  24. (No user will be created)
  25. Please make your choice from above ['q' to quit | 'b' to begin installation |
  26. 'r' to refresh]:1  //光标是在这个位置,输入1设置语言,<Enter>回车
  27.  
  28. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  29. //出现如下页面
  30. ================================================================================
  31. ================================================================================
  32. Language settings
  33.  
  34. Available languages
  35. 1) Afrikaans 25) Hindi 48) Oriya
  36. 2) Amharic 26) Croatian 49) Punjabi
  37. 3) Arabic 27) Hungarian 50) Polish
  38. 4) Assamese 28) Interlingua 51) Portuguese
  39. 5) Asturian 29) Indonesian 52) Romanian
  40. 6) Belarusian 30) Icelandic 53) Russian
  41. 7) Bulgarian 31) Italian 54) Sinhala
  42. 8) Bengali 32) Japanese 55) Slovak
  43. 9) Bosnian 33) Georgian 56) Slovenian
  44. 10) Catalan 34) Kazakh 57) Albanian
  45. 11) Czech 35) Kannada 58) Serbian
  46. 12) Welsh 36) Korean 59) Swedish
  47. 13) Danish 37) Lithuanian 60) Tamil
  48. 14) German 38) Latvian 61) Telugu
  49. 15) Greek 39) Maithili 62) Tajik
  50. 16) English 40) Macedonian 63) Thai
  51. 17) Spanish 41) Malayalam 64) Turkish
  52. 18) Estonian 42) Marathi 65) Ukrainian
  53. 19) Basque 43) Malay 66) Urdu
  54. 20) Persian 44) Norwegian Bokmål 67) Vietnamese
  55. 21) Finnish 45) Nepali 68) Chinese
  56. 22) French 46) Dutch 69) Zulu
  57. Press ENTER to continue  //没显示完,<Enter>回车一下
  58. 23) Galician 47) Northern Sotho
  59. 24) Gujarati
  60. [b to return to language list, c to continue, q to quit]:68  //输入68中文,<Enter>回车
  61. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  62. //出现如下页面
  63. ================================================================================
  64. ================================================================================
  65. Language settings
  66.  
  67. Available locales
  68. 1) Simplified Chinese 3) Traditional Chinese 4) Simplified Chinese
  69. (China) (Hong Kong) (Singapore)
  70. 2) Traditional Chinese
  71. (Republic of China)
  72. Please select language support to install.
  73. [b to return to language list, c to continue, q to quit]:  //输入1简体中文,<Enter>回车
  74. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  75. //之后会回到设置菜单界面,可以看到语言设置下方变成了简体中文
  76. ================================================================================
  77. ================================================================================
  78. Installation
  79.  
  80. 1) [x] Language settings 2) [!] Time settings
  81. (Simplified Chinese (China)) (Timezone is not set.)
  82. 3) [x] Installation source 4) [x] Software selection
  83. (Local media) (Minimal Install)
  84. 5) [!] Installation Destination 6) [x] Kdump
  85. (No disks selected) (Kdump is enabled)
  86. 7) [ ] Network configuration 8) [!] Root password
  87. (Not connected) (Password is not set.)
  88. 9) [!] User creation
  89. (No user will be created)
  90. Please make your choice from above ['q' to quit | 'b' to begin installation |
  91. 'r' to refresh]:2   //光标在此处,输入2设置时间,<Enter>回车
  92. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  93. //出现如下页面
  94. ================================================================================
  95. ================================================================================
  96. Time settings
  97.  
  98. Timezone: not set
  99.  
  100. NTP servers:not configured
  101.  
  102. 1) Set timezone
  103. 2) Configure NTP servers
  104. Please make your choice from above ['q' to quit | 'c' to continue |
  105. 'r' to refresh]: 1  //输入1设置时区,<Enter>回车
  106. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  107. //出现如下页面
  108. ================================================================================
  109. ================================================================================
  110. Timezone settings
  111.  
  112. Available regions
  113. 1) Europe 6) Pacific 10) Arctic
  114. 2) Asia 7) Australia 11) US
  115. 3) America 8) Atlantic 12) Etc
  116. 4) Africa 9) Indian
  117. 5) Antarctica
  118. Please select the timezone.
  119. Use numbers or type names directly [b to region list, q to quit]: 2  //选择大区,输入2亚洲,<Enter>回车
  120. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  121. //出现如下页面
  122. ================================================================================
  123. ================================================================================
  124. Timezone settings
  125.  
  126. Available timezones in region Asia
  127. 1) Aden 29) Hong_Kong 56) Pontianak
  128. 2) Almaty 30) Hovd 57) Pyongyang
  129. 3) Amman 31) Irkutsk 58) Qatar
  130. 4) Anadyr 32) Jakarta 59) Qyzylorda
  131. 5) Aqtau 33) Jayapura 60) Riyadh
  132. 6) Aqtobe 34) Jerusalem 61) Sakhalin
  133. 7) Ashgabat 35) Kabul 62) Samarkand
  134. 8) Atyrau 36) Kamchatka 63) Seoul
  135. 9) Baghdad 37) Karachi 64) Shanghai
  136. 10) Bahrain 38) Kathmandu 65) Singapore
  137. 11) Baku 39) Khandyga 66) Srednekolymsk
  138. 12) Bangkok 40) Kolkata 67) Taipei
  139. 13) Barnaul 41) Krasnoyarsk 68) Tashkent
  140. 14) Beirut 42) Kuala_Lumpur 69) Tbilisi
  141. 15) Bishkek 43) Kuching 70) Tehran
  142. 16) Brunei 44) Kuwait 71) Thimphu
  143. 17) Chita 45) Macau 72) Tokyo
  144. 18) Choibalsan 46) Magadan 73) Tomsk
  145. 19) Colombo 47) Makassar 74) Ulaanbaatar
  146. 20) Damascus 48) Manila 75) Urumqi
  147. 21) Dhaka 49) Muscat 76) Ust-Nera
  148. 22) Dili 50) Nicosia 77) Vientiane
  149. Press ENTER to continue  //<Enter>回车一下,还有区域没显示
  150. 23) Dubai 51) Novokuznetsk 78) Vladivostok
  151. 24) Dushanbe 52) Novosibirsk 79) Yakutsk
  152. 25) Famagusta 53) Omsk 80) Yangon
  153. 26) Gaza 54) Oral 81) Yekaterinburg
  154. 27) Hebron 55) Phnom_Penh 82) Yerevan
  155. 28) Ho_Chi_Minh
  156. Please select the timezone.
  157. Use numbers or type names directly [b to region list, q to quit]:64  //选择具体地点,输入64上海,<Enter>回车
  158. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  159. //之后会回到设置菜单界面,可以看到时间设置下方变成了亚洲/上海时区
  160. ================================================================================
  161. ================================================================================
  162. Installation
  163.  
  164. 1) [x] Language settings 2) [x] Time settings
  165. (Simplified Chinese (China)) (Asia/Shanghai timezone)
  166. 3) [x] Installation source 4) [x] Software selection
  167. (Local media) (Minimal Install)
  168. 5) [!] Installation Destination 6) [x] Kdump
  169. (No disks selected) (Kdump is enabled)
  170. 7) [ ] Network configuration 8) [!] Root password
  171. (Not connected) (Password is not set.)
  172. 9) [!] User creation
  173. (No user will be created)
  174. Please make your choice from above ['q' to quit | 'b' to begin installation |
  175. 'r' to refresh]:5   //这里输入5安装地址,<Enter>回车。3是安装源,4软件选择,有需要的可以设置
  176. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  177. //出现如下页面
  178. ================================================================================
  179. ================================================================================
  180. Probing storage...
  181. Installation Destination
  182.  
  183. [x] 1) : 10 GiB (vda)
  184.  
  185. 1 disk selected; 10 GiB capacity; 10 GiB free ...
  186.  
  187. Please make your choice from above ['q' to quit | 'c' to continue |
  188. 'r' to refresh]: c  //输入c继续,<Enter>回车
  189. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  190. //出现如下页面
  191. ================================================================================
  192. ================================================================================
  193. Autopartitioning Options
  194.  
  195. [ ] 1) Replace Existing Linux system(s)
  196. [x] 2) Use All Space
  197. [ ] 3) Use Free Space
  198.  
  199. Installation requires partitioning of your hard drive. Select what space to use
  200. for the install target.
  201.  
  202. Please make your choice from above ['q' to quit | 'c' to continue |
  203. 'r' to refresh]: c  //这个需要根据自己选择,我这里就使用所有空间,输入c继续,<Enter>回车
  204. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  205. //出现如下页面
  206. ================================================================================
  207. ================================================================================
  208. Partition Scheme Options
  209.  
  210. [ ] 1) Standard Partition
  211. [ ] 2) Btrfs
  212. [x] 3) LVM
  213. [ ] 4) LVM Thin Provisioning
  214.  
  215. Select a partition scheme configuration.
  216.  
  217. Please make your choice from above ['q' to quit | 'c' to continue |
  218. 'r' to refresh]: c  //这里也是根据需要选择,我使用LVM,输入c继续,<Enter>回车
  219. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  220. //需要等待一段时间,回到菜单设置页面
  221. ================================================================================
  222. ================================================================================
  223. Installation
  224.  
  225. 1) [x] Language settings 2) [x] Time settings
  226. (Simplified Chinese (China)) (Asia/Shanghai timezone)
  227. 3) [x] Installation source 4) [x] Software selection
  228. (Local media) (Minimal Install)
  229. 5) [x] Installation Destination 6) [x] Kdump
  230. (Automatic partitioning (Kdump is enabled)
  231. selected) 8) [!] Root password
  232. 7) [ ] Network configuration (Password is not set.)
  233. (Not connected)
  234. 9) [!] User creation
  235. (No user will be created)
  236. Please make your choice from above ['q' to quit | 'b' to begin installation |
  237. 'r' to refresh]: 8  //输入8设置root密码,<Enter>回车。6是内核崩溃转储机制,可以开启也可以关闭
  238. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  239. //出现如下页面
  240. ================================================================================
  241. ================================================================================
  242. Please select new root password. You will have to type it twice.
  243.  
  244. Password:  //输入root密码,我这里是123456,<Enter>回车
  245.  
  246. Password (confirm):   //回车后才会出现,重复密码
  247. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  248. //出现如下页面,提示的是密码太简单了,是否继续使用,我是实验没关系所以yes
  249. ================================================================================
  250. ================================================================================
  251. Question
  252.  
  253. The password you have provided is weak: The password fails the dictionary check
  254. - it is too simplistic/systematic.
  255. Would you like to use it anyway?
  256.  
  257. Please respond 'yes' or 'no': yes  //输入yes,<Enter>回车
  258. //之后回到设置菜单页面
  259. ================================================================================
  260. ================================================================================
  261. Installation
  262.  
  263. 1) [x] Language settings 2) [x] Time settings
  264. (Simplified Chinese (China)) (Asia/Shanghai timezone)
  265. 3) [x] Installation source 4) [x] Software selection
  266. (Local media) (Minimal Install)
  267. 5) [x] Installation Destination 6) [x] Kdump
  268. (Automatic partitioning (Kdump is enabled)
  269. selected) 8) [x] Root password
  270. 7) [ ] Network configuration (Password is set.)
  271. (Not connected)
  272. 9) [ ] User creation
  273. (No user will be created)
  274. Please make your choice from above ['q' to quit | 'b' to begin installation |
  275. 'r' to refresh]: 7  //输入7设置网络,<Enter>回车
  276. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  277. //出现如下页面
  278. ================================================================================
  279. ================================================================================
  280. Network configuration
  281.  
  282. Wired (eth0) disconnected
  283.  
  284. Host name: localhost.localdomain  //这是默认的主机名
  285. Current host name: localhost
  286.  
  287. 1) Set host name
  288. 2) Configure device eth0
  289. Please make your choice from above ['q' to quit | 'c' to continue |
  290. 'r' to refresh]: 1  //输入1设置主机名,<Enter>回车
  291. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  292. //出现如下页面
  293. ================================================================================
  294. ================================================================================
  295. Enter new value for 'Host name' and press enter
  296. kvm-CentOS7.5  //注意只能使用大小写字母、数值、减号、小数点,并且不能以减号开头或结尾
  297. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  298. //设置完成后,回到之前的界面
  299. ================================================================================
  300. ================================================================================
  301. Network configuration
  302.  
  303. Wired (eth0) disconnected
  304.  
  305. Host name: kvm-CentOS7.5  //可以看到主机名改了
  306. Current host name: localhost
  307.  
  308. 1) Set host name
  309. 2) Configure device eth0
  310. Please make your choice from above ['q' to quit | 'c' to continue |
  311. 'r' to refresh]: 2  //输入2设置eth0网卡设备,<Enter>回车
  312. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  313. //出现如下页面
  314. ================================================================================
  315. ================================================================================
  316. Device configuration
  317.  
  318. 1) IPv4 address or "dhcp" for DHCP
  319. dhcp
  320. 2) IPv4 netmask
  321. 3) IPv4 gateway
  322. 4) IPv6 address[/prefix] or "auto" for automatic, "dhcp" for DHCP, "ignore" to
  323. turn off
  324. auto
  325. 5) IPv6 default gateway
  326. 6) Nameservers (comma separated)
  327. 7) [ ] Connect automatically after reboot
  328. 8) [ ] Apply configuration in installer
  329. Configuring device eth0.
  330.  
  331. Please make your choice from above ['q' to quit | 'c' to continue |
  332. 'r' to refresh]:   //太多了,我这里整合一下
  333. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  334. //输入1设置IPv4地址,出现如下页面
  335. ================================================================================
  336. ================================================================================
  337. Enter new value for 'IPv4 address or "dhcp" for DHCP' and press enter
  338. 192.168.5.151  //输入一个IPv4地址
  339. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  340. //输入2设置子网掩码,出现如下页面
  341. ================================================================================
  342. ================================================================================
  343. Enter new value for 'IPv4 netmask' and press enter
  344. 255.255.255.0  //输入子网掩码
  345. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  346. //输入3设置IPv4网关,出现如下页面
  347. ================================================================================
  348. ================================================================================
  349. Enter new value for 'IPv4 gateway' and press enter
  350. 192.168.5.2
  351. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  352. //输入6设置DNS服务器,出现如下页面
  353. ================================================================================
  354. ================================================================================
  355. Enter new value for 'Nameservers (comma separated)' and press enter
  356. 192.168.5.2
  357. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  358. //输入7设置重新启动后自动连接
  359. //输入8设置在安装程序中应用配置
  360. //最后设置完成的界面如下
  361. ================================================================================
  362. ================================================================================
  363. Device configuration
  364.  
  365. 1) IPv4 address or "dhcp" for DHCP
  366. 192.168.5.151
  367. 2) IPv4 netmask
  368. 255.255.255.0
  369. 3) IPv4 gateway
  370. 192.168.5.2
  371. 4) IPv6 address[/prefix] or "auto" for automatic, "dhcp" for DHCP, "ignore" to
  372. turn off
  373. auto
  374. 5) IPv6 default gateway
  375. 6) Nameservers (comma separated)
  376. 192.168.5.2
  377. 7) [x] Connect automatically after reboot
  378. 8) [x] Apply configuration in installer
  379. Configuring device eth0.
  380.  
  381. Please make your choice from above ['q' to quit | 'c' to continue |
  382. 'r' to refresh]: c  //输入c继续,<Enter>回车
  383. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  384. //回到上一个界面
  385. ================================================================================
  386. ================================================================================
  387. Network configuration
  388.  
  389. Wired (eth0) connected
  390. IPv4 Address: 192.168.5.151 Netmask: 255.255.255.0 Gateway: 192.168.5.2
  391. DNS: 192.168.5.2  //网络信息
  392.  
  393. Host name: kvm-CentOS7.5  //主机名
  394. Current host name: localhost
  395.  
  396. 1) Set host name
  397. 2) Configure device eth0
  398. Please make your choice from above ['q' to quit | 'c' to continue |
  399. 'r' to refresh]: c  //输入c继续,<Enter>回车
  400. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  401. //回到菜单设置页面
  402. ================================================================================
  403. ================================================================================
  404. Installation
  405.  
  406. 1) [x] Language settings 2) [x] Time settings
  407. (Simplified Chinese (China)) (Asia/Shanghai timezone)
  408. 3) [x] Installation source 4) [!] Software selection
  409. (Local media) (Source changed - please
  410. 5) [x] Installation Destination verify)
  411. (Automatic partitioning 6) [x] Kdump
  412. selected) (Kdump is enabled)
  413. 7) [x] Network configuration 8) [x] Root password
  414. (Wired (eth0) connected) (Password is set.)
  415. 9) [ ] User creation
  416. (No user will be created)
  417. Please make your choice from above ['q' to quit | 'b' to begin installation |
  418. 'r' to refresh]: 4  //输入4软件选择,<Enter>回车。见鬼4怎么变了,跑一下吧
  419. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  420. //出现如下页面
  421. ================================================================================
  422. ================================================================================
  423. Base environment
  424. Software selection
  425.  
  426. Base environment
  427.  
  428. 1) [x] Minimal Install 7) [ ] Server with GUI
  429. 2) [ ] Compute Node 8) [ ] GNOME Desktop
  430. 3) [ ] Infrastructure Server 9) [ ] KDE Plasma Workspaces
  431. 4) [ ] File and Print Server 10) [ ] Development and Creative
  432. 5) [ ] Basic Web Server Workstation
  433. 6) [ ] Virtualization Host
  434. Please make your choice from above ['q' to quit | 'c' to continue |
  435. 'r' to refresh]: c  //就用最小化安装。输入c继续,<Enter>回车
  436. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  437. //回到设置菜单页面
  438. ================================================================================
  439. ================================================================================
  440. Installation
  441.  
  442. 1) [x] Language settings 2) [x] Time settings
  443. (Simplified Chinese (China)) (Asia/Shanghai timezone)
  444. 3) [!] Installation source 4) [!] Software selection
  445. (Processing...) (Processing...)
  446. 5) [x] Installation Destination 6) [x] Kdump
  447. (Automatic partitioning (Kdump is enabled)
  448. selected) 8) [x] Root password
  449. 7) [x] Network configuration (Password is set.)
  450. (Wired (eth0) connected)
  451. 9) [ ] User creation
  452. (No user will be created)
  453.  
  454. Please make your choice from above ['q' to quit | 'b' to begin installation |
  455. 'r' to refresh]: r  //正在加载等一会儿,输入r刷新一下,<Enter>回车
  456. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  457. //再看设置菜单页面
  458. ================================================================================
  459. ================================================================================
  460. Installation
  461.  
  462. 1) [x] Language settings 2) [x] Time settings
  463. (Simplified Chinese (China)) (Asia/Shanghai timezone)
  464. 3) [x] Installation source 4) [x] Software selection
  465. (Local media) (Minimal Install)
  466. 5) [x] Installation Destination 6) [x] Kdump
  467. (Automatic partitioning (Kdump is enabled)
  468. selected) 8) [x] Root password
  469. 7) [x] Network configuration (Password is set.)
  470. (Wired (eth0) connected)
  471. 9) [ ] User creation
  472. (No user will be created)
  473. Please make your choice from above ['q' to quit | 'b' to begin installation |
  474. 'r' to refresh]: b  //正常了,输入b开始安装,<Enter>回车
  475. [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
  476. //下面就等待安装,时间会比较长,请耐心等待。最后会出现
  477. Use of this product is subject to the license agreement found at /usr/share/centos-release/EULA
  478. Installation complete. Press return to quit  //这里按回车
  479. //然后会出现一堆停止或关闭参数,不用管他,这是虚拟机在关闭。最后还会出现一个报错,如下
  480. 误:操作失败: 这个域有活跃控制台会话  //这个报错是没有关系的,表明这个虚拟关机了

  查看一下新建的centos75虚拟机,以及默认镜像格式

  1. [root@youxi1 ~]# virsh list --all
  2. Id 名称 状态
  3. ----------------------------------------------------
  4. 2 centos75 running
  5. - centos7.0 关闭
  6. [root@youxi1 ~]# qemu-img info /var/lib/libvirt/images/centos75.img
  7. image: /var/lib/libvirt/images/centos75.img
  8. file format: qcow2  //默认格式就是qcow2的,所以我没有先创建系统镜像
  9. virtual size: 10G (10737418240 bytes)
  10. disk size: 1.3G
  11. cluster_size: 65536
  12. Format specific information:
  13. compat: 1.1
  14. lazy refcounts: true

  启动了,那么我们使用远程工具连接一下试试

----->---->----->

  可以看到是成功连接了,随便输入个命令试试

  1. [root@kvm-CentOS7 ~]# ip a sh
  2. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
  3. link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  4. inet 127.0.0.1/8 scope host lo
  5. valid_lft forever preferred_lft forever
  6. inet6 ::1/128 scope host
  7. valid_lft forever preferred_lft forever
  8. 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
  9. link/ether 52:54:00:71:3c:50 brd ff:ff:ff:ff:ff:ff
  10. inet 192.168.5.151/24 brd 192.168.5.255 scope global noprefixroute eth0
  11. valid_lft forever preferred_lft forever
  12. inet6 fe80::4bf9:e184:aff2:ec5f/64 scope link noprefixroute
  13. valid_lft forever preferred_lft forever

  上面是直连KVM虚拟机,但有时候会需要从物理机上进入KVM虚拟机,如下。但这有一个问题,我不知道怎么从KVM虚拟机上回到物理,除了关机。所以我建议使用远程软件连入物理机,再进入KVM虚拟机,使用完成后关闭窗口即可。

  1. [root@youxi1 ~]# virsh console centos75  //此时是物理机
  2. 连接到域 centos75
  3. 换码符为 ^]
  4.  
  5. quit
  6. 密码:
  7. Login incorrect
  8.  
  9. kvm-CentOS7 login: root
  10. 密码:
  11. Last login: Mon Sep 9 09:25:33 on ttyS0
  12. [root@kvm-CentOS7 ~]#   //进入到KVM虚拟机

(6).扩展:

 1)KVM虚拟机管理常用命令

  virsh list查看正在运行的虚拟机,virsh list --all

  1. [root@youxi1 ~]# virsh list --all
  2. Id 名称 状态
  3. ----------------------------------------------------
  4. - centos7.0 关闭
  5.  
  6. [root@youxi1 ~]# virsh list
  7. Id 名称 状态
  8. ----------------------------------------------------

  virsh start [虚拟机名称]启动虚拟机,virsh shutdown [虚拟机名称]关闭虚拟机,virsh autostart [虚拟机名称]设置虚拟机随物理机启动,virsh autostart --disable [虚拟机名称]取消虚拟机随物理机启动。注意:使用virsh autostart [虚拟机名称]时,请确保KVM虚拟机服务(服务名为libvirtd)开机启动。

  1. [root@youxi1 ~]# virsh start centos7.0
  2. centos7.0 已开始
  3. [root@youxi1 ~]# virsh list
  4. Id 名称 状态
  5. ----------------------------------------------------
  6. 1 centos7.0 running
  7.  
  8. [root@youxi1 ~]# virsh shutdown centos7.0
  9. centos7.0 被关闭
  10. [root@youxi1 ~]# virsh list --all
  11. Id 名称 状态
  12. ----------------------------------------------------
  13. - centos7.0 关闭
  14.  
  15. [root@youxi1 ~]# systemctl is-enabled libvirtd
  16. enabled
  17. [root@youxi1 ~]# virsh autostart centos7.0
  18. centos7.0标记为自动开始
  19. [root@youxi1 ~]# virsh autostart --disable centos7.0
  20. centos7.0取消标记为自动开始

 2)KVM虚拟机创建命令

  virt-install --name [虚拟机名称] --memory [内存分配] [options]

  常用选项:

  1. --virt-type [管理程序名称]  使用的管理程序名称,取代了以前的--accelerate选项,包含kvmqemuxen
  2. -n [虚拟机名称],--name [虚拟机名称]  指定虚拟机名称
  3. --memory [内存分配]  指定内存大小分配
  4. 例如:--memory 1024 (in MiB)
  5.    --memory 512,maxmemory=1024
  6.    --memory 512,maxmemory=1024,hotplugmemorymax=2048,hotplugmemoryslots=2
  7. --vcpus [CPU分配]  指定虚拟CPU数量
  8. 例如:--vcpus 5
  9.    --vcpus 5,maxcpus=10,cpuset=1-4,6,8
  10.    --vcpus sockets=2,cores=4,threads=2
  11. --disk [存储分配]  指定虚拟机磁盘存储文件路径
  12. 例如:--disk size=10 (在默认位置创建 10GiB 镜像)
  13.    --disk /my/existing/disk,cache=none
  14.    --disk device=cdrom,bus=scsi
  15.    --disk=?
  16. --cdrom [光盘镜像]  指定安装系统的光盘镜像
  17. -l [系统镜像],--location [系统镜像]  这个镜像可以是网络,也可以是本地
  18. 例如:nfs:host:/path, http://host/path,ftp://host/path
  19. -w [网络接口],--network [网络接口]  指定虚拟机的网络接口
  20. 例如:
  21. --network bridge=mybr0
  22. --network network=my_libvirt_virtual_net
  23. --network network=mynet,model=virtio,mac=00:11...
  24. --network none
  25. --network help
  26. -x [额外参数],--extra-args [额外参数]  将附加参数添加到--location引导的内核中,提供额外的内核命令行参数,比如用于无人值守安装

 3)VMware迁移到KVM

  需要安装virt-v2v,命令yum -y install virt-v2v

Linux的桌面虚拟化技术KVM(一)——新建KVM虚拟机的更多相关文章

  1. Linux的桌面虚拟化技术KVM(五)——virsh常用命令

    Linux的桌面虚拟化技术KVM(一)——新建KVM虚拟机 Linux的桌面虚拟化技术KVM(二)——远程桌面管理 Linux的桌面虚拟化技术KVM(三)——KVM虚拟机克隆和快照 Linux的桌面虚 ...

  2. Linux的桌面虚拟化技术KVM(四)——虚拟机镜像格式对比与转换

    Linux的桌面虚拟化技术KVM(一)——新建KVM虚拟机 Linux的桌面虚拟化技术KVM(二)——远程桌面管理 Linux的桌面虚拟化技术KVM(三)——KVM虚拟机克隆和快照 (1).常用镜像格 ...

  3. Linux的桌面虚拟化技术KVM(三)——KVM虚拟机克隆和快照

    Linux的桌面虚拟化技术KVM(一)——新建KVM虚拟机 Linux的桌面虚拟化技术KVM(二)——远程桌面管理 (1).KVM虚拟机克隆 KVM虚拟克隆命令virt-clone [选项] 常用选项 ...

  4. Linux的桌面虚拟化技术KVM(二)——远程桌面管理

    Linux的桌面虚拟化技术KVM(一)——新建KVM虚拟机 远程桌面管理,指的是远程图形界面管理,所以要保证物理机要有图形化界面. (1).VNC管理 安装VNC-server服务,并进行配置 [ro ...

  5. KVM虚拟化技术(二)KVM介绍

    KVM:Kernel Virtual Machine KVM是基于虚拟化扩展的x86硬件,是Linux完全原生的全虚拟化解决方案.部分半虚拟化支持,主要是通过半虚拟网络驱动程序的形式用于Linux和W ...

  6. 虚拟化技术:Xen与KVM的对比

    作为开源的虚拟化技术,对比Xen和KVM可以看到,Xen以6个无与伦比的优势领先:更好的可用资源.平台支持.可管理性.实施.动态迁移和性能基准. 可用资源:Xen的问世要比KVM早4年之久(两者分别是 ...

  7. kvm 虚拟化技术 1.3之kvm克隆以及快照

    1.kvm虚拟机克隆   克隆kvm虚拟机 ,克隆前需要提前关机     语法: virt-clone -o 原虚拟机  -n 新虚拟机 -f 新虚拟机镜像存放路径    选项中-o 表示 old  ...

  8. KVM虚拟化技术(四)安装虚拟机

    一.首先用比较简单的virt-manager来安装 # virt-manager 后面就是一般的安装系统流程了,这里不再复述 二.用virt-install命令行来安装 还是通过本地IOS文件来进行安 ...

  9. KVM虚拟化技术(三)KVM环境预配

    一.平台操作系统安装 选择合适的操作系统,此处选用CentOS 7 系统可最小化安装,也可标准安装: 如果要远程连接,建议安装VNC-Server 将防火墙配置可通信,SELINUX设为permiss ...

随机推荐

  1. machine learning (4)---feature scaling

    feature scaling:缩小或扩大feature的值,使所有的feature处于类似的范围,这样进行gradient descnet时更快趋向最小值.因为不同的feature的范围相差很大时, ...

  2. sizeof的注意点

    sizeof('a')的值为4.因为此处‘a’是独立存在的一个字符(没有赋值给其它变量),实际上就是一个整型数,占4个字节,即此处‘a’对应的ascii码的十进制为整数97.(貌似解释得有些牵强,但事 ...

  3. SIGAI机器学习第二十集 AdaBoost算法1

    讲授Boosting算法的原理,AdaBoost算法的基本概念,训练算法,与随机森林的比较,训练误差分析,广义加法模型,指数损失函数,训练算法的推导,弱分类器的选择,样本权重削减,实际应用 AdaBo ...

  4. 布局 Bootstrap Table的 文本内容 垂直居中

    原文:https://blog.csdn.net/peng_hong_fu/article/details/70662979 样式(注意样式优先级): #div-component-info .tab ...

  5. Hdu 2157 How many ways??(DP||矩阵乘法)

    How many ways?? Time Limit:1000 MS Memory Limit: 32768 K Problem Description 春天到了, HDU校园里开满了花, 姹紫嫣红, ...

  6. redis系列(四):切换RDB备份到AOF备份

    1.准备环境 redis.conf服务端配置如下: daemonize yes port logfile /data//redis.log dir /data/ dbfilename dbmp.rdb ...

  7. 如何快速把ps序列图层建立帧动画?

    工具ps 1.将序列帧图片载入ps 新建->脚本->将文件载入堆栈 2.制作序列帧动画 窗口->时间轴->时间轴面板右上角菜单->从图层建立帧 3.去除多余的透明画布 全 ...

  8. php md5算法

    <!DOCTYPE html> <html> <body> <?php $str = "Shanghai"; echo md5($str) ...

  9. SpringData :下划线的那些破事

    今天写一个查询语句的时候,报错如下 org.springframework.beans.factory.BeanCreationException: Error creating bean with ...

  10. nodejs 日志框架winston笔记

    winston是一款nodejs的日志库,本文以2.1.1版本为例,介绍一下使用方法. 1.基础用法 引用日志库,返回的是一个对象.包含一些构造器,实例方法. 其中transports是日志输出方式. ...