设为首页 收藏本站
查看: 735|回复: 0

[经验分享] RedHat/CentOS: Install KVM Virtualization Kernel-based Virtual Machine

[复制链接]

尚未签到

发表于 2018-5-13 11:38:51 | 显示全部楼层 |阅读模式
  KVM (Kernel-based Virtual Machine) is a  full virtualization solution for Linux on x86 hardware containing  virtualization extensions Intel VT or AMD-V. How do I install KVM under  CentOS or Red Hat Enterprise Linux version 5.5?
  The Linux kernel 2.6.20 and above included KVM. RHEL 5.5 (and upcoming  RHEL 6) supports KVM out of box and it has also been ported to FreeBSD  as a loadable kernel module. However, this tutorial is tested on both  CentOS and RHEL 5.5 only running 64 bit Intel Xeon CPU (with Intel VT)  and 64 bit kernels with SELinux running in enforcing mode.
  Why KVM?
  XEN allows several guest operating systems to execute on the same  computer hardware and it is also included with RHEL 5.5. But, why use  KVM over XEN? KVM is part of the official Linux kernel and fully  supported by both Novell and Redhat. Xen boots from GRUB and loads a  modified host operating system such as RHEL into the dom0 (host domain).  KVM do not have concept of dom0 and domU. It uses /dev/kvm interface to  setup the guest operating systems and provides required drivers. See  the official wiki for more information.
  Required Packages
  You must install the following packages:
  1. kmod-kvm : kvm kernel module(s)
  2. kvm : Kernel-based Virtual Machine
  3. kvm-qemu-img : Qemu disk image utility
  4. kvm-tools : KVM debugging and diagnostics tools
  5. python-virtinst : Python modules and utilities for installing virtual machines
  6. virt-manager : Virtual Machine Manager (GUI app, to install and configure VMs)
  7. virt-viewer: Virtual Machine Viewer (another lightweight app to view VM console and/or install VMs)
  8. bridge-utils : Utilities for configuring the Linux Ethernet bridge (this is recommended for KVM networking)
  KVM Package Group
  RHEL comes with KVM software group which includes full virtualization  support with KVM. You can list all packages in the group as follows:
  # yum groupinfo KVM
  Sample outputs:
  Loaded plugins: rhnplugin, security
  Setting up Group Process
  Group: KVM
  Description: Virtualization Support with KVM
  Mandatory Packages:
  celt051
  etherboot-zroms
  etherboot-zroms-kvm
  kmod-kvm
  kvm
  kvm-qemu-img
  qcairo
  qffmpeg-libs
  qpixman
  qspice-libs
  Default Packages:
  Virtualization-en-US
  libvirt
  virt-manager
  virt-viewer
  Optional Packages:
  celt051-devel
  etherboot-pxes
  etherboot-roms
  etherboot-roms-kvm
  gpxe-roms-qemu
  iasl
  kvm-tools
  libcmpiutil
  libvirt-cim
  qcairo-devel
  qffmpeg-devel
  qpixman-devel
  qspice
  qspice-libs-devel
  A Note About libvirt
  libvirt is an open source API and management tool for managing platform  virtualization. It is used to manage Linux KVM and Xen virtual machines  through graphical interfaces such as Virtual Machine Manager and higher  level tools such as oVirt. See the official website for more  information.
  A Note About QEMU

  QEMU is a processor emulator that>  A Note About Virtio Drivers
  Virtio is paravirtualized drivers for kvm/Linux. With this you can can  run multiple virtual machines running unmodified Linux or Windows VMs.  Each virtual machine has private virtualized hardware a network card,  disk, graphics adapter, etc. According to Redhat:
  Para-virtualized drivers enhance the performance of fully  virtualized guests. With the para-virtualized drivers guest I/O latency  decreases and throughput increases to near bare-metal levels. It is  recommended to use the para-virtualized drivers for fully virtualized  guests running I/O heavy tasks and applications.
  Host Operating System
  Your main operating system such as CentOS or RHEL is known as host  operating system. KVM is a Linux kernel module that enables a modified  QEMU program to use hardware virtualization. You only need to install  KVM under host operating systems.
  KVM Domains

  It is nothing but a guest operating system running under host operating  system. Each kvm domain must have a unique name and>  Guest Operating Systems
  KVM supports various guest operating systems such as
  1. MS-Windows 2008 / 2000 / 2003 Server
  2. MS-Windows 7 / Vista / XP
  3. FreeBSD
  4. OpenBSD
  5. Sun Solaris
  6. Various Linux distributions.
  7. NetBSD
  8. MINIX
  9. QNX
  10. MS DOS
  11. FreeDOS
  12. Haiku
  13. Amiga Research OS
  Install KVM
  Type the following command to install KVM under RHEL or CentOS:
  # yum install kvm virt-viewer virt-manager libvirt libvirt-python python-virtinst
  OR
  # yum groupinstall KVM
  Important Configuration And Log Files (Directories) Location
  The following files are required to manage and debug KVM problems:
  1. /etc/libvirt/ - Main configuration directory.
  2. /etc/libvirt/qemu/ - Virtual machine configuration directory. All  xml files regarding VMs are stored here. You can edit them manually or  via virt-manager.
  3. /etc/libvirt/qemu/networks/ - Networking for your KVM including  default NAT. NAT is only recommended for small setup or desktops. I  strongly suggest you use bridged based networking for performance.
  4. /etc/libvirt/qemu/networks/default.xml - The default NAT configuration used by NAT device virbr0.
  5. /var/log/libvirt/ - The default log file directory. All VM specific logs files are stored here.
  6. /etc/libvirt/libvirtd.conf - Master libvirtd configuration file.
  7. /etc/libvirt/qemu.conf - Master configuration file for the QEMU driver.
  TCP/UDP Ports
  By default libvirt does not opens any TCP or UDP ports. However, you can  configure the same by editing the /etc/libvirt/libvirtd.conf file.  Also, VNC is configured to listen on 127.0.0.1 by default. To make it  listen on all public interfaces, edit /etc/libvirt/qemu.conf file.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-459472-1-1.html 上篇帖子: redhat-linux面试题 下篇帖子: Redhat linux 9.0下的软路由
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表