Red Hat Enterprise Linux 6 Virtualization Host Configuration and Guest Installation Guide Installing and configuring your virtual environment Tahlia Richardson Scott Radvan Dayle Parker Laura Bailey
Red Hat Enterprise Linux 6 Virtualization Host Configuration and Guest Installation Guide Installing and configuring your virtual environment Tahlia Richardso n Red Hat Engineering Co ntent Services trichard@redhat.co m Dayle Parker Red Hat Engineering Co ntent Services dayleparker@redhat.co m Laura Bailey Red Hat Engineering Co ntent Services lbailey@redhat.co m Sco tt Radvan Red Hat Engineering Co ntent Services sradvan@redhat.
Legal Notice Co pyright © 20 13 Red Hat, Inc. This do cument is licensed by Red Hat under the Creative Co mmo ns Attributio n-ShareAlike 3.0 Unpo rted License. If yo u distribute this do cument, o r a mo dified versio n o f it, yo u must pro vide attributio n to Red Hat, Inc. and pro vide a link to the o riginal. If the do cument is mo dified, all Red Hat trademarks must be remo ved.
T able of Cont ent s T able of Contents .Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4. . . . . . . . . . 1. Do c ument Co nventio ns 4 1.1. Typ o g rap hic Co nventio ns 4 1.2. Pull-q uo te Co nventio ns 5 1.3. No tes and Warning s 6 2 . G etting Help and G iving Feed b ac k 6 2 .1. Do Yo u Need Help ? 6 2 .2. We Need Feed b ac k! 7 . .hapt C . . . .er . .1. .. Int .
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide . .hapt C . . . .er . .1. 1. .. Net . . . work . . . . .configurat . . . . . . . . . ion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9. 1. . . . . . . . . . 11.1. Netwo rk Ad d res s Trans latio n (NAT) with lib virt 91 11.2. Dis ab ling vho s t-net 92 11.3. Brid g ed netwo rking with lib virt 93 . .hapt C . . . .er . .1. 2. .. PCI .
T able of Cont ent s B .12. G ues t is unab le to s tart with erro r: warning : c o uld no t o p en /d ev/net/tun B .13. Mig ratio n fails with Erro r: unab le to res o lve ad d res s 143 145 B .14. Mig ratio n fails with Unab le to allo w ac c es s fo r d is k p ath: No s uc h file o r d irec to ry B .15. No g ues t virtual mac hines are p res ent when lib virtd is s tarted 146 147 B .16 . Unab le to c o nnec t to s erver at ' ho s t:16 50 9 ' : Co nnec tio n refus ed ...
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Preface 1. Document Convent ions This manual uses several conventions to highlight certain words and phrases and draw attention to specific pieces of information. 1.1. T ypographic Convent ions Four typographic conventions are used to call attention to specific words and phrases. These conventions, and the circumstances they apply to, are as follows.
Preface C haracter T abl e. D ouble-click this highlighted character to place it in the T ext to co py field and then click the C o py button. Now switch back to your document and choose Ed it → Past e from the g ed it menu bar. The above text includes application names; system-wide menu names and items; application-specific menu names; and buttons and text found within a GUI interface, all presented in proportional bold and all distinguishable by context.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide before, " "so cannot be deassigned\n", __func__); r = -EINVAL; goto out; } kvm_deassign_device(kvm, match); kvm_free_assigned_device(kvm, match); o ut: mutex_unlock(& kvm->lock); return r; } 1.3. Not es and Warnings Finally, we use three visual styles to draw attention to information that might otherwise be overlooked.
Preface Red Hat also hosts a large number of electronic mailing lists for discussion of Red Hat software and technology. You can find a list of publicly available mailing lists at https://www.redhat.com/mailman/listinfo. Click on the name of any mailing list to subscribe to that list or to access the list archives. 2.2.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Chapter 1. Introduction 1.1. What is in t his guide? This guide provides information on installing virtualization software and configuring guest machines on a Red Hat Enterprise Linux virtualization host. The initial chapters in this guide outline the prerequisites to enable a Red Hat Enterprise Linux host machine to deploy virtualization.
Chapt er 1 . Int roduct ion VMware ESX/ESX(i) hypervisors to Red Hat Enterprise Virtualization and KVM managed by libvirt. Note All of these guides are available at the Red Hat Customer Portal: https://access.redhat.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Chapter 2. System requirements This chapter lists system requirements for successfully running virtual machines, referred to as VMs on Red Hat Enterprise Linux 6. Virtualization is available for Red Hat Enterprise Linux 6 on the Intel 64 and AMD 64 architecture. The KVM hypervisor is provided with Red Hat Enterprise Linux 6.
Chapt er 2 . Syst em requirement s Guest virtual machine requirements are further outlined in the Red Hat Enterprise Linux 6 Virtualization Administration Guide in Chapter 6. Overcommitting with KVM. C alcu lat in g swap sp ace Using swap space can provide additional memory beyond the available physical memory. The swap partition is used for swapping underused memory to the hard drive to speed up memory performance. The default size of the swap partition is calculated from the physical RAM of the host.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Chapter 3. KVM guest virtual machine compatibility To verify whether your processor supports the virtualization extensions and for information on enabling the virtualization extensions if they are disabled, refer to the Red Hat Enterprise Linux Virtualization Administration Guide. 3.1. Red Hat Ent erprise Linux 6 support limit s Red Hat Enterprise Linux 6 servers have certain support limits.
Chapt er 3.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide
Chapt er 3. KVM guest virt ual machine compat ibilit y Note A full list of supported CPU models and recognized CPUID flags can also be found using the q emu-kvm -cpu ? command.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Chapter 4. Virtualization restrictions This chapter covers additional support and product restrictions of the virtualization packages in Red Hat Enterprise Linux 6. 4 .1.
Chapt er 4 . Virt ualiz at ion rest rict ions SCSI emulation is not supported with KVM in Red Hat Enterprise Linux. Virt u aliz ed ID E d evices KVM is limited to a maximum of four virtualized (emulated) ID E devices per guest virtual machine. PC I d evices Red Hat Enterprise Linux 6 supports 32 PCI device slots per virtual machine, and 8 PCI functions per device slot. This gives a theoretical maximum of 256 PCI functions per guest when multi-function capabilities are enabled.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Live migration is only possible between hosts with the same CPU type (that is, Intel to Intel or AMD to AMD only). For live migration, both hosts must have the same value set for the No eXecution (NX) bit, either o n or o ff. For migration to work, cache= no ne must be specified for all block devices opened in write mode. Warning Failing to include the cache= no ne option can result in disk corruption.
Chapt er 4 . Virt ualiz at ion rest rict ions n et d u mp server You should carefully evaluate applications and tools that heavily utilize I/O or those that require realtime performance. Consider the para-virtualized drivers or PCI device assignment for increased I/O performance. Refer to Chapter 10, KVM Para-virtualized (virtio) Drivers for more information on the paravirtualized drivers for fully virtualized guests.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Chapter 5. Installing the virtualization packages Before you can use virtualization, the virtualization packages must be installed on your computer. Virtualization packages can be installed either during the host installation sequence or after host installation using Subscription Manager. The KVM hypervisor uses the default Red Hat Enterprise Linux kernel with the kvm kernel module. 5.1.
Chapt er 5. Inst alling t he virt ualiz at ion packages Fig u re 5.1. T h e R ed H at En t erp rise Lin u x p ackag e select io n screen Select the Vi rtual i zati o n Ho st server role to install a platform for guest virtual machines. Alternatively, ensure that the C usto mi ze No w radio button is selected before proceeding, to specify individual packages. 3. Select t h e Vi rtual i zati o n p ackag e g ro u p .
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 5.2. T h e R ed H at En t erp rise Lin u x p ackag e select io n screen Note If you wish to create virtual machines in a graphical user interface (virt - man ag er) later, you should also select the G eneral P urpo se D eskto p package group. 4. C u st o miz e t h e p ackag es ( if req u ired ) Customize the Vi rtual i zati o n group if you require other virtualization packages.
Chapt er 5. Inst alling t he virt ualiz at ion packages Fig u re 5.3. T h e R ed H at En t erp rise Lin u x p ackag e select io n screen Click on the C l o se button, then the Next button to continue the installation. When the installation is complete, reboot the system. Important You require a valid virtualization entitlement to receive updates for the virtualization packages.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide 5.2. Inst alling virt ualiz at ion packages on an exist ing Red Hat Ent erprise Linux syst em This section describes the steps for installing the KVM hypervisor on a working Red Hat Enterprise Linux 6 or newer system. To install the packages, your machines must be registered. To register via Red Hat Subscription Manager, run the subscri pti o n-manag er reg i ster command and follow the prompts.
Chapt er 5. Inst alling t he virt ualiz at ion packages The libvirt-client package provides the client-side APIs and libraries for accessing libvirt servers. The libvirt-client package includes the vi rsh command line tool to manage and control virtual machines and hypervisors from the command line or a special virtualization shell.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Chapter 6. Guest virtual machine installation overview After you have installed the virtualization packages on the host system you can create guest operating systems. This chapter describes the general processes for installing guest operating systems on virtual machines. You can create guest virtual machines using the New button in virt man ag er or use the command line interface vi rt-i nstal l .
Chapt er 6 . G uest virt ual machine inst allat ion overview You can use the vi rt-i nstal l command to create guest virtual machines from the command line. vi rt-i nstal l is used either interactively or as part of a script to automate the creation of virtual machines. Using vi rt-i nstal l with Kickstart files allows for unattended installation of virtual machines. The vi rt-i nstal l tool provides a number of options that can be passed on the command line.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Pro ced u re 6 .1. C reat in g a g u est virt u al mach in e wit h virt - man ag er 1. O p en virt - man ag er Start vi rt-manag er. Launch the Virt u al Mach in e Man ag er application from the Ap p licat io n s menu and Syst em T o o ls submenu. Alternatively, run the vi rt-manag er command as root. 2.
Chapt er 6 . G uest virt ual machine inst allat ion overview Fig u re 6 .2. N ame virt u al mach in e an d select in st allat io n met h o d Type in a virtual machine name and choose an installation type: Lo cal in st all med ia ( ISO imag e o r C D R O M) This method uses a CD -ROM, D VD , or image of an installation disk (for example, . i so ).
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide This method uses a Preboot eXecution Environment (PXE) server to install the guest virtual machine. Setting up a PXE server is covered in the Deployment Guide. To install via network boot, the guest must have a routable IP address or shared network device. For information on the required networking configuration for PXE installation, refer to Section 6.4, “ Installing guest virtual machines with PXE” .
Chapt er 6 . G uest virt ual machine inst allat ion overview Fig u re 6 .4 . Lo cal ISO imag e in st allat io n 6. C o n f ig u re C PU an d memo ry The next step involves configuring the number of CPUs and amount of memory to allocate to the virtual machine. The wizard shows the number of CPUs and amount of memory you can allocate; configure these settings and click Fo rward .
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 6 .5. C o n f ig u rin g C PU an d Memo ry 7. C o n f ig u re st o rag e Assign storage to the guest virtual machine.
Chapt er 6 . G uest virt ual machine inst allat ion overview Fig u re 6 .6 . C o n f ig u rin g virt u al st o rag e If you chose to import an existing disk image during the first step, vi rt-manag er will skip this step. Assign sufficient space for your virtual machine and any applications it requires, then click Fo rward to continue. 8.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 6 .7. Verif yin g t h e co n f ig u rat io n If you prefer to further configure the virtual machine's hardware first, check the C u st o miz e co n f ig u rat io n b ef o re in st all box first before clicking Fi ni sh. D oing so will open another wizard that will allow you to add, remove, and configure the virtual machine's hardware settings.
Chapt er 6 . G uest virt ual machine inst allat ion overview PXE guest installation requires a PXE server running on the same subnet as the guest virtual machines you wish to install. The method of accomplishing this depends on how the virtual machines are connected to the network. Contact Support if you require assistance setting up a PXE server.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 6 .8.
Chapt er 6 . G uest virt ual machine inst allat ion overview Fig u re 6 .9 .
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 6 .10.
Chapt er 6 . G uest virt ual machine inst allat ion overview Fig u re 6 .11. Sp ecif yin g st o rag e d et ails 2. St art t h e in st allat io n The installation is ready to start.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 6 .12. Fin aliz in g virt u al mach in e d et ails A D HCP request is sent and if a valid PXE server is found the guest virtual machine's installation processes will start.
Chapt er 7 . Inst alling a Red Hat Ent erprise Linux 6 guest virt ual machine on a Red Hat Ent erprise Linux 6 host Chapter 7. Installing a Red Hat Enterprise Linux 6 guest virtual machine on a Red Hat Enterprise Linux 6 host This chapter covers how to install a Red Hat Enterprise Linux 6 guest virtual machine on a Red Hat Enterprise Linux 6 host. These procedures assume that the KVM hypervisor and all other required packages are installed and the host is configured for virtualization.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 7.1. T h e Virt u al Mach in e Man ag er win d o w Click on the C reate a new vi rtual machi ne button to start the new virtualized guest wizard. Fig u re 7.2. T h e C reat e a n ew virt u al mach in e b u t t o n The New VM window opens. 3. N ame t h e virt u al mach in e Virtual machine names can contain letters, numbers and the following characters: '_', '. ' and '-'.
Chapt er 7 . Inst alling a Red Hat Ent erprise Linux 6 guest virt ual machine on a Red Hat Ent erprise Linux 6 host Choose the Lo cal i nstal l med i a (ISO i mag e o r C D R O M) radio button. Fig u re 7.3. T h e N ew VM win d o w - St ep 1 Click Fo rward to continue. 4. Select t h e in st allat io n med ia Select the appropriate radio button for your installation media.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 7.4 . Lo cat e yo u r in st all med ia A. If you wish to install from a CD -ROM or D VD , select the Use C D R O M o r D VD radio button, and select the appropriate disk drive from the drop-down list of drives available. B. If you wish to install from an ISO image, select Use ISO i mag e, and then click the Bro wse. . . button to open the Lo cate med i a vo l ume window.
Chapt er 7 . Inst alling a Red Hat Ent erprise Linux 6 guest virt ual machine on a Red Hat Ent erprise Linux 6 host Important For ISO image files and guest storage images, the recommended location to use is /var/l i b/l i bvi rt/i mag es/. Any other location may require additional configuration by SELinux. Refer to the Red Hat Enterprise Linux 6 Virtualization Administration Guide for more details on configuring SELinux.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Virtual machines require sufficient physical memory (RAM) to run efficiently and effectively. Red Hat supports a minimum of 512MB of RAM for a virtual machine. Red Hat recommends at least 1024MB of RAM for each logical core. Assign sufficient virtual CPUs for the virtual machine.
Chapt er 7 . Inst alling a Red Hat Ent erprise Linux 6 guest virt ual machine on a Red Hat Ent erprise Linux 6 host Note Live and offline migrations require virtual machines to be installed on shared network storage. For information on setting up shared storage for virtual machines, refer to the Red Hat Enterprise Linux Virtualization Administration Guide. a.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 7.7. T h e N ew VM win d o w - St ep 4 Click Fo rward to create a disk image on the local hard drive. Alternatively, select Sel ect manag ed o r o ther exi sti ng sto rag e, then select Bro wse to configure managed storage. b.
Chapt er 7 . Inst alling a Red Hat Ent erprise Linux 6 guest virt ual machine on a Red Hat Ent erprise Linux 6 host Fig u re 7.8. T h e Lo cat e o r creat e st o rag e vo lu me win d o w i. Select a storage pool from the Sto rag e P o o l s list. ii. Optional: Click on the New Vo l ume button to create a new storage volume. The Ad d a Sto rag e Vo l ume screen will appear. Enter the name of the new storage volume. Choose a format option from the Fo rmat dropdown menu.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 7.9 . T h e Ad d a St o rag e Vo lu me win d o w Click Fi ni sh to continue. 7. Verif y an d f in ish Verify there were no errors made during the wizard and everything appears as expected. Select the C usto mi ze co nfi g urati o n befo re i nstal l check box to change the guest's storage or network devices, to use the para-virtualized drivers or to add additional devices.
Chapt er 7 . Inst alling a Red Hat Ent erprise Linux 6 guest virt ual machine on a Red Hat Ent erprise Linux 6 host Fig u re 7.10. T h e N ew VM win d o w - lo cal st o rag e Click Fi ni sh to continue into the Red Hat Enterprise Linux installation sequence. For more information on installing Red Hat Enterprise Linux 6 refer to the Red Hat Enterprise Linux 6 Installation Guide. A Red Hat Enterprise Linux 6 guest virtual machine is now created from an ISO installation disc image.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide 7.2. Creat ing a Red Hat Ent erprise Linux 6 guest wit h a net work inst allat ion t ree Pro ced u re 7.2. C reat in g a R ed H at En t erp rise Lin u x 6 g u est wit h virt - man ag er 1. O p t io n al: Prep arat io n Prepare the storage environment for the guest virtual machine. For more information on preparing storage, refer to the Red Hat Enterprise Linux 6 Virtualization Administration Guide.
Chapt er 7 . Inst alling a Red Hat Ent erprise Linux 6 guest virt ual machine on a Red Hat Ent erprise Linux 6 host Fig u re 7.11. T h e main virt - man ag er win d o w Click on the C reate a new vi rtual machi ne button to start the new virtual machine wizard. Fig u re 7.12. T h e C reat e a n ew virt u al mach in e b u t t o n The C reate a new vi rtual machi ne window opens. 3. N ame t h e virt u al mach in e Virtual machine names can contain letters, numbers and the following characters: '_', '.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 7.13. T h e N ew VM win d o w - St ep 1 Click Fo rward to continue. 4. Provide the installation URL, and the Kickstart URL and Kernel options if required.
Chapt er 7 . Inst alling a Red Hat Ent erprise Linux 6 guest virt ual machine on a Red Hat Ent erprise Linux 6 host Fig u re 7.14 . T h e N ew VM win d o w - St ep 2 Click Fo rward to continue. 5. The remaining steps are the same as the ISO installation procedure. Continue from Step 5 of the ISO installation procedure. 7.3. Creat ing a Red Hat Ent erprise Linux 6 guest wit h PXE Pro ced u re 7.3. C reat in g a R ed H at En t erp rise Lin u x 6 g u est wit h virt - man ag er 1.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Important Various storage types may be used for storing guest virtual machines. However, for a virtual machine to be able to use migration features the virtual machine must be created on networked storage. Red Hat Enterprise Linux 6 requires at least 1GB of storage space.
Chapt er 7 . Inst alling a Red Hat Ent erprise Linux 6 guest virt ual machine on a Red Hat Ent erprise Linux 6 host Fig u re 7.16 . T h e creat e n ew virt u aliz ed g u est b u t t o n The New VM window opens. 3. N ame t h e virt u al mach in e Virtual machine names can contain letters, numbers and the following characters: '_', '. ' and '-'. Virtual machine names must be unique for migration and cannot consist only of numbers. Choose the installation method from the list of radio buttons. Fig u re 7.17.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide 4. The remaining steps are the same as the ISO installation procedure. Continue from Step 5 of the ISO installation procedure. From this point, the only difference in this PXE procedure is on the final New VM screen, which shows the Instal l : P XE Instal l field. Fig u re 7.18.
Chapt er 8 . Virt ualiz ing Red Hat Ent erprise Linux on O t her Plat forms Chapter 8. Virtualizing Red Hat Enterprise Linux on Other Platforms This chapter contains useful reference material for customers running Red Hat Enterprise Linux 6 as a virtualized operating system on other virtualization hosts. 8.1. On VMware ESX Red Hat Enterprise Linux 6.0 and onward provide the vmw_bal l o o n driver, a para-virtualized memory ballooning driver used when running Red Hat Enterprise Linux on VMware hosts.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide D ynamic expansion of fixed size Linux VHD Xs - Allows expansion of live mounted fixed size Red Hat Enterprise Linux VHD Xs. Boot using UEFI - Allows virtual machines to boot using Unified Extensible Firmware Interface (UEFI) on a Hyper-V 2012 R2 host. For more information, refer to the following article:" Enabling Linux Support on Windows Server 2012 R2 Hyper-V" .
Chapt er 9 . Inst alling a fully- virt ualiz ed Windows guest Chapter 9. Installing a fully-virtualized Windows guest This chapter describes how to create a fully-virtualized Windows guest using the command-line (vi rt-i nstal l ), launch the operating system's installer inside the guest, and access the installer through vi rt-vi ewer. To install a Windows operating system on the guest, use the vi rt-vi ewer tool.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide The path-to-disk must be a device (e.g. /d ev/sd a3) or image file (/var/l i b/l i bvi rt/i mag es/name. i mg ). It must also have enough free space to support the disk-size. Important All image files are stored in /var/l i b/l i bvi rt/i mag es/ by default. Other directory locations for file-based images are possible, but may require SELinux configuration.
Chapt er 1 0 . KVM Para- virt ualiz ed (virt io) Drivers Chapter 10. KVM Para-virtualized (virtio) Drivers Para-virtualized drivers enhance the performance of guests, decreasing guest I/O latency and increasing throughput 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. Virtio drivers are KVM's para-virtualized device drivers, available for Windows guest virtual machines running on KVM hosts.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide This section covers the installation process for the KVM Windows virtio drivers. The KVM virtio drivers can be loaded during the Windows installation or installed after the guest is installed.
Chapt er 1 0 . KVM Para- virt ualiz ed (virt io) Drivers 1. O p en virt - man ag er an d t h e g u est virt u al mach in e Open vi rt-manag er, then open the guest virtual machine from the list by double-clicking the guest name. 2. O p en t h e h ard ware win d o w Click the lightbulb icon on the toolbar at the top of the window to view virtual hardware details. Fig u re 10.1. T h e virt u al h ard ware d et ails b u t t o n Then click the Ad d Hard ware button at the bottom of the new view that appears.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 10.2. T h e Ad d n ew virt u al h ard ware wiz ard in R ed H at En t erp rise Lin u x 6 .1 Click the Fi ni sh button to proceed. 4. Select t h e ISO f ile Ensure that the Sel ect manag ed o r o ther exi sti ng sto rag e radio button is selected, and browse to the virtio driver's . i so image file. The default location for the latest version of the drivers is /usr/share/vi rti o -wi n/vi rti o -wi n.
Chapt er 1 0 . KVM Para- virt ualiz ed (virt io) Drivers Fig u re 10.4 . T h e Ad d n ew virt u al h ard ware wiz ard in R ed H at En t erp rise Lin u x 6 .1 6. R eb o o t Reboot or start the virtual machine to begin using the driver disc. Virtualized ID E devices require a restart to for the virtual machine to recognize the new device. Once the CD -ROM with the drivers is attached and the virtual machine has started, proceed with Procedure 10.2, “ Windows installation on a Windows 7 virtual machine” .
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 10.5. T h e C o mp u t er Man ag emen t win d o w 2. O p en t h e D evice Man ag er Select the D evi ce Manag er from the left-most pane. This can be found under C o mputer Manag ement > System T o o l s.
Chapt er 1 0 . KVM Para- virt ualiz ed (virt io) Drivers Fig u re 10.6 . T h e C o mp u t er Man ag emen t win d o w 3. St art t h e d river u p d at e wiz ard a. View availab le syst em d evices Expand System d evi ces by clicking on the arrow to its left. Fig u re 10.7. Viewin g availab le syst em d evices in t h e C o mp u t er Man ag emen t win d o w b.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 10.8. T h e C o mp u t er Man ag emen t win d o w c. O p en t h e d river u p d at e wiz ard From the drop-down menu, select Upd ate D ri ver So ftware. . . to access the driver update wizard. Fig u re 10.9 . O p en in g t h e d river u p d at e wiz ard 4. Sp ecif y h o w t o f in d t h e d river The first page of the driver update wizard asks how you want to search for driver software.
Chapt er 1 0 . KVM Para- virt ualiz ed (virt io) Drivers Fig u re 10.10. T h e d river u p d at e wiz ard 5. Select t h e d river t o in st all a. O p en a f ile b ro wser Click on Bro wse. . .
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 10.11. T h e d river u p d at e wiz ard b. B ro wse t o t h e lo cat io n o f t h e d river A separate driver is provided for each of the various combinations of operating system and architecture. The drivers are arranged hierarchically according to their driver type, the operating system, and the architecture on which they will be installed: driver_type/os/arch/.
Chapt er 1 0 . KVM Para- virt ualiz ed (virt io) Drivers Fig u re 10.13. T h e U p d at e D river So f t ware wiz ard The following screen is displayed while the driver installs: Fig u re 10.14 .
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide 6. C lo se t h e in st aller The following screen is displayed when installation is complete: Fig u re 10.15. T h e U p d at e D river So f t ware wiz ard Click C l o se to close the installer. 7. R eb o o t Reboot the virtual machine to complete the driver installation. 10.3.
Chapt er 1 0 . KVM Para- virt ualiz ed (virt io) Drivers Important Create the virtual machine, as normal, without starting the virtual machine. Follow one of the procedures below. Select one of the following guest-creation methods, and follow the instructions. a. C reat in g t h e g u est virt u al mach in e wit h virsh This method attaches the virtio driver floppy disk to a Windows guest before the installation.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 10.16 . T h e virt - man ag er g u est creat io n wiz ard Click on the Fi ni sh button to continue. ii. O p en t h e Ad d H ard ware wiz ard Click the Ad d Hard ware button in the bottom left of the new panel. iii. Select st o rag e d evice Sto rag e is the default selection in the Hard ware type list.
Chapt er 1 0 . KVM Para- virt ualiz ed (virt io) Drivers Fig u re 10.17. T h e Ad d n ew virt u al h ard ware wiz ard Ensure the Sel ect manag ed o r o ther exi sti ng sto rag e radio button is selected. Click Bro wse. . . . Fig u re 10.18. Select man ag ed o r exist in g st o rag e In the new window that opens, click Bro wse Lo cal . Navigate to /usr/share/vi rti o -wi n/vi rti o -wi n. vfd , and click Sel ect to confirm. Change D evi ce type to Fl o ppy d i sk, and click Fi ni sh to continue.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 10.20. T h e virt u al mach in e h ard ware in f o rmat io n win d o w You have now created a removable device accessible by your virtual machine. v. C h an g e t h e h ard d isk t yp e To change the hard disk type from IDE Disk to Virtio Disk, we must first remove the existing hard disk, D isk 1. Select the disk and click on the R emo ve button.
Chapt er 1 0 . KVM Para- virt ualiz ed (virt io) Drivers Fig u re 10.21. T h e virt u al mach in e h ard ware in f o rmat io n win d o w Add a new virtual storage device by clicking Ad d Hard ware. Then, change the D evi ce type from IDE disk to Virtio Disk. Click Fi ni sh to confirm the operation.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 10.22. T h e virt u al mach in e h ard ware in f o rmat io n win d o w vi. En su re set t in g s are co rrect Review the settings for VirtIO Disk 1. Fig u re 10.23. T h e virt u al mach in e h ard ware in f o rmat io n win d o w When you are satisfied with the configuration details, click the Beg i n Instal l ati o n button. You can now continue with Step 3. c.
Chapt er 1 0 . KVM Para- virt ualiz ed (virt io) Drivers Important If the device you wish to add is a d i sk (that is, not a fl o ppy or a cd ro m), you will also need to add the bus= vi rti o option to the end of the --disk parameter, like so: --disk path=/usr/share/virtio-win/virtiowin.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 10.24 . T h e Win d o ws Set u p screen Press S to install additional device drivers. Fig u re 10.25. T h e Win d o ws Set u p screen Fig u re 10.26 . T h e Win d o ws Set u p screen Press Enter to continue the installation. b.
Chapt er 1 0 . KVM Para- virt ualiz ed (virt io) Drivers Follow the same procedure for Windows Server 2003, but when the installer prompts you for the driver, click on Lo ad D ri ver, point the installer to D ri ve A: and pick the driver that suits your guest operating system and architecture. 10.4 . Using t he virt io drivers wit h Red Hat Ent erprise Linux 3.9 guest s Virtio drivers for Red Hat Enterprise Linux 3.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide vi rti o _net and vi rti o _bl k are the only drivers whose order can be changed. If other drivers are loaded in a different order, they will not work. Next, configure the modules. Locate the following section of the /etc/rc. d /rc. sysi ni t file. if [ -f /etc/rc.modules ]; then /etc/rc.modules fi Append the following lines after that section: if [ -f /etc/rc.modules ]; then /etc/rc.
Chapt er 1 0 . KVM Para- virt ualiz ed (virt io) Drivers # ethtool -K interface gso off # ethtool -K interface tso off Virt io d river swap p art it io n issu e After activating the virtio block device driver the swap partition may not be available. This issue is may be caused by a change in disk device name.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide 5. Remove the ad d ress tag inside the d isk tags. This must be done for this procedure to work. Libvirt will regenerate the ad d ress tag appropriately the next time the virtual machine is started. Alternatively, vi rt-manag er, vi rsh attach-d i sk or vi rsh attach-i nterface can add a new device using the virtio drivers. Refer to the libvirt website for more details on using Virtio: http://www.linux-kvm.
Chapt er 1 0 . KVM Para- virt ualiz ed (virt io) Drivers Fig u re 10.28. T h e Ad d n ew virt u al h ard ware wiz ard 5. Select t h e st o rag e d evice an d d river Create a new disk image or select a storage pool volume. Set the D evi ce type to Vi rti o d i sk to use the virtio drivers.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 10.29 . T h e Ad d n ew virt u al h ard ware wiz ard Click Fi ni sh to complete the procedure. Pro ced u re 10.6 . Ad d in g a n et wo rk d evice u sin g t h e virt io n et wo rk d river 1. Open the guest virtual machine by double clicking on the name of the guest in vi rtmanag er. 2. Open the Sho w vi rtual hard ware d etai l s tab by clicking the l i g htbul b button. Fig u re 10.30.
Chapt er 1 0 . KVM Para- virt ualiz ed (virt io) Drivers Fig u re 10.31. T h e Ad d n ew virt u al h ard ware wiz ard 5. Select t h e n et wo rk d evice an d d river Set the D evi ce mo d el to vi rti o to use the virtio drivers. Choose the desired Ho st d evi ce.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 10.32. T h e Ad d n ew virt u al h ard ware wiz ard Click Fi ni sh to complete the procedure. Once all new devices are added, reboot the virtual machine. Windows virtual machines may not recognize the devices until the guest is rebooted.
Chapt er 1 1 . Net work configurat ion Chapter 11. Network configuration This chapter provides an introduction to the common networking configurations used by libvirt based guest virtual machines. For additional information, consult the libvirt network architecture documentation: http://libvirt.org/intro.html.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide # brctl show bridge name virbr0 bridge id 8000.000000000000 STP enabled yes interfaces l i bvi rt adds i ptabl es rules which allow traffic to and from guest virtual machines attached to the vi rbr0 device in the INP UT , FO R WAR D , O UT P UT and P O ST R O UT ING chains. l i bvi rt then attempts to enable the i p_fo rward parameter.
Chapt er 1 1 . Net work configurat ion ... ... Setting the driver name to q emu forces packet processing into qemu user space, effectively disabling vhost-net for that interface. 11.3. Bridged net working wit h libvirt Bridged networking (also known as physical device sharing) is used to dedicate a physical device to a virtual machine.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Chapter 12. PCI device assignment Red Hat Enterprise Linux 6 exposes three classes of device to its virtual machines: Emulated devices are purely virtual devices that mimic real hardware, allowing unmodified guest operating systems to work with them using their standard in-box drivers. Virtio devices are purely virtual devices designed to work optimally in a virtual machine.
Chapt er 1 2 . PCI device assignment Pro ced u re 12.1. Prep arin g an In t el syst em f o r PC I d evice assig n men t 1. En ab le t h e In t el VT - d sp ecif icat io n s The Intel VT-d specifications provide hardware support for directly assigning a physical device to a virtual machine. These specifications are required to use PCI device assignment with Red Hat Enterprise Linux. The Intel VT-d specifications must be enabled in the BIOS. Some system manufacturers disable these specifications by default.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide These steps cover assigning a PCI device to a virtual machine on a KVM hypervisor. This example uses a PCIe network controller with the PCI identifier code, pci _0 0 0 0 _0 1_0 0 _0 , and a fully virtualized guest machine named guest1-rhel6-64. Pro ced u re 12.3. Assig n in g a PC I d evice t o a g u est virt u al mach in e wit h virsh 1.
Chapt er 1 2 . PCI device assignment pci_0000_00_1d_2 pci_0000_00_1d_7 pci_0000_00_1e_0 pci_0000_00_1f_0 pci_0000_00_1f_2 pci_0000_00_1f_3 pci_0000_01_00_0 pci_0000_01_00_1 pci_0000_02_00_0 pci_0000_02_00_1 pci_0000_06_00_0 pci_0000_07_02_0 pci_0000_07_03_0 Record the PCI device number that maps to the device you want to use; this is required in other steps. 2.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide bus='0' slot='25' function='0' If you want to convert to hexadecimal values, you can use the pri ntf utility to convert from decimal values, as shown in the following example: $ printf %x 0 0 $ printf %x 25 19 $ printf %x 0 0 The example device would use the following hexadecimal values in the configuration file: bus='0x0' slot='0x19' function='0x0' 4.
Chapt er 1 2 . PCI device assignment PCI devices can be added to guest virtual machines using the graphical vi rt-manag er tool. The following procedure adds a Gigabit Ethernet controller to a guest virtual machine. Pro ced u re 12.4 . Assig n in g a PC I d evice t o a g u est virt u al mach in e u sin g virt - man ag er 1. O p en t h e h ard ware set t in g s Open the guest virtual machine and click the Ad d Hard ware button to add a new device to the virtual machine. Fig u re 12.1.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Fig u re 12.2. T h e Ad d n ew virt u al h ard ware wiz ard 3. Ad d t h e n ew d evice The setup is complete and the guest virtual machine now has direct access to the PCI device.
Chapt er 1 2 . PCI device assignment Fig u re 12.3. T h e virt u al mach in e h ard ware in f o rmat io n win d o w 12.3. Assigning a PCI device wit h virt -inst all To use virt - in st all to assign a PCI device, use the --host-device parameter. Pro ced u re 12.5. Assig n in g a PC I d evice t o a virt u al mach in e wit h virt - in st all 1. Id en t if y t h e d evice Identify the PCI device designated for device assignment to the guest virtual machine. # lspci 00:19.0 Network 01:00.0 Network 01:00.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide # virsh nodedev-list --cap pci pci_0000_00_00_0 pci_0000_00_01_0 pci_0000_00_03_0 pci_0000_00_07_0 pci_0000_00_10_0 pci_0000_00_10_1 pci_0000_00_14_0 pci_0000_00_14_1 pci_0000_00_14_2 pci_0000_00_14_3 pci_0000_00_19_0 pci_0000_00_1a_0 pci_0000_00_1a_1 pci_0000_00_1a_2 pci_0000_00_1a_7 pci_0000_00_1b_0 pci_0000_00_1c_0 pci_0000_00_1c_1 pci_0000_00_1c_4 pci_0000_00_1d_0 pci_0000_00_1d_1 pci_0000_00_1d_2 pci_000
Chapt er 1 2 . PCI device assignment 2. Ad d t h e d evice Use the PCI identifier output from the vi rsh no d ed ev command as the value for the -host-device parameter. virt-install \ --name=guest1-rhel6-64 \ --disk path=/var/lib/libvirt/images/guest1-rhel6-64.img,size=8 \ --nonsparse --graphics spice \ --vcpus=2 --ram=2048 \ --location=http://example1.com/installation_tree/RHEL6.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide virsh nodedev-reattach pci_0000_01_00_0 The device is now available for host use. Pro ced u re 12.7. D et ach in g a PC I D evice f ro m a g u est wit h virt - man ag er 1. O p en t h e virt u al h ard ware d et ails screen In virt - man ag er, double-click on the virtual machine that contains the device. Select the Sho w vi rtual hard ware d etai l s button to display a list of virtual hardware.
Chapt er 1 3. SR- IO V Chapter 13. SR-IOV 13.1. Int roduct ion D eveloped by the PCI-SIG (PCI Special Interest Group), the Single Root I/O Virtualization (SR-IOV) specification is a standard for a type of PCI device assignment that can share a single device to multiple virtual machines. SR-IOV improves device performance for virtual machines. Fig u re 13.1.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide PCI devices which are backed on the physical PCI device by resources such as queues and register sets. Ad van t ag es o f SR - IO V SR-IOV devices can share a single physical port with multiple virtual machines. Virtual Functions have near-native performance and provide better performance than paravirtualized drivers and emulated access.
Chapt er 1 3. SR- IO V On an Intel system, enable Intel VT-d in the BIOS if it is not enabled already. Refer to Procedure 12.1, “ Preparing an Intel system for PCI device assignment” for procedural help on enabling Intel VT-d in the BIOS and kernel. Skip this step if Intel VT-d is already enabled and working. On an AMD system, enable the AMD IOMMU specifications in the BIOS if they are not enabled already. Refer to Procedure 12.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide # echo "options igb max_vfs=7" >>/etc/modprobe.d/igb.conf 6. In sp ect t h e n ew Virt u al Fu n ct io n s Using the l spci command, list the newly added Virtual Functions attached to the Intel 82576 network device. (Alternatively, use g rep to search for Vi rtual Functi o n, to search for devices that support Virtual Functions.) # lspci | grep 82576 0b:00.
Chapt er 1 3. SR- IO V Use the vi rsh no d ed ev-l i st command and the g rep command to filter the Intel 82576 network device from the list of available host devices. 0b is the filter for the Intel 82576 network devices in this example. This may vary for your system and may result in additional devices.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide 0 11 16 0 82576 Virtual Function Intel Corporation This example adds the Virtual Function pci _0 0 0 0 _0 b_10 _0 to the virtual machine in Step 9.
Chapt er 1 3. SR- IO V Note If you do not specify a MAC address, one will be automatically generated. The element is only used when connecting to an 802.11Qbh hardware switch. The element is new for Red Hat Enterprise Linux 6.4 and this will transparently put the guest's device on the VLAN tagged 42. When the virtual machine starts, it should see a network device of the type provided by the physical adapter, with the configured MAC address.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Erro r st art in g t h e g u est When starting a configured virtual machine, an error occurs as follows: # virsh start test error: Failed to start domain test error: internal error unable to start guest: char device redirected to /dev/pts/2 get_real_device: /sys/bus/pci/devices/0000:03:10.0/config: Permission denied init_assigned_device: Error: Couldn't get real device (03:10.
Chapt er 1 4 . KVM guest t iming management Chapter 14. KVM guest timing management Virtualization involves several intrinsic challenges for time keeping in guest virtual machines. Interrupts cannot always be delivered simultaneously and instantaneously to all guest virtual machines, because interrupts in virtual machines are not true interrupts; they are injected into the guest virtual machine by the host machine.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide If any output is given your CPU has the co nstant_tsc bit. If no output is given follow the instructions below. 14 .1.1. Configuring host s wit hout a const ant T ime St amp Count er Systems without a constant TSC frequency cannot use the TSC as a clock source for virtual machines, and require additional configuration.
Chapt er 1 4 . KVM guest t iming management R ed H at En t erp rise Lin u x versio n Ad d it io n al g u est kern el p aramet ers 5.5 x86 with the para-virtualized clock 5.5 x86 without the para-virtualized clock 5.4 AMD 64/Intel 64 5.4 x86 5.3 AMD 64/Intel 64 5.3 x86 4.8 AMD 64/Intel 64 4.8 x86 3.9 AMD 64/Intel 64 3.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Windows uses both the Real-Time Clock (RTC) and the Time Stamp Counter (TSC). For Windows guest virtual machines the Real-Time Clock can be used instead of the TSC for all time sources which resolves guest timing issues. To enable the Real-Time Clock for the P MT IMER clock source (the P MT IMER usually uses the TSC), add the following option to the Windows boot settings.
Chapt er 1 4 . KVM guest t iming management Steal time is reported in the CPU time fields in /pro c/stat as st. It is automatically reported by utilities such as to p and vmstat, and cannot be switched off. Large amounts of steal time indicate CPU contention, which can reduce guest performance. To relieve CPU contention, increase the guest's CPU priority or CPU quota, or run fewer guests on the host.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Chapter 15. Network booting with libvirt Guest virtual machines can be booted with PXE enabled. PXE allows guest virtual machines to boot and load their configuration off the network itself. This section demonstrates some basic configuration steps to configure PXE guests with libvirt. This section does not cover the creation of boot images or PXE servers.
Chapt er 1 5. Net work boot ing wit h libvirt 15.2. Boot ing a guest using PXE This section demonstrates how to boot a guest virtual machine with PXE. 15.2.1. Using bridged net working Pro ced u re 15.2. B o o t in g a g u est u sin g PXE an d b rid g ed n et wo rkin g 1. Ensure bridging is enabled such that the PXE boot server is available on the network. 2. Boot a guest virtual machine with PXE booting enabled.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Also ensure that the guest virtual machine is connected to the private network: 120
Chapt er 1 6 . Q EMU G uest Agent Chapter 16. QEMU Guest Agent The QEMU Guest Agent allows the host machine to issue commands to the guest operating system. The guest operating system then responds to those commands asynchronously. This section covers the options and commands available to the guest agent in detail. It also covers how to run the Guest Agent in the foreground, or as a daemon in the background. 16.1.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide 122
Net KVM Driver Paramet ers NetKVM Driver Parameters After the NetKVM driver is installed, you can configure it to better suit your environment. The parameters listed in this section can be configured in the Windows D evi ce Manag er (d evmg mt. msc). Important Modifying the driver's parameters causes Windows to re-load that driver. This interrupts existing network activity. Pro ced u re A.1. C o n f ig u rin g N et K VM Paramet ers 1. O p en D evi ce Manag er Click on the Start button.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Important High logging levels will slow down your guest virtual machine. Lo g g in g .St at ist ics( sec) An integer that defines whether log statistics are printed, and the time in seconds between each periodical statistics printout. The default value is 0 (no logging statistics). In it ial p aramet ers Assig n MAC A string that defines the locally-administered MAC address for the para-virtualized NIC.
Net KVM Driver Paramet ers In Red Hat Enterprise Linux 6.4 and onward, the valid values for this parameter are Al l (the default), which enables IP, TCP and UD P checksum offloading for both IPv4 and IPv6; T C P /UD P (v4 ,v6 ), which enables TCP and UD P checksum offloading for both IPv4 and IPv6; T C P /UD P (v4 ), which enables TCP and UD P checksum offloading for IPv4 only; and T C P (v4 ), which enables only TCP checksum offloading for IPv4 only. In Red Hat Enterprise Linux 6.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide 1 (enabled). T est O n ly.Packet Filt er A Boolean value that determines whether packet filtering is enabled. The default value is 1 (enabled). T est O n ly.B at ch R eceive A Boolean value that determines whether packets are received in batches, or singularly. The default value is 1, which enables batched packet receipt. T est O n ly.
Common libvirt errors and t roubleshoot ing Common libvirt errors and troubleshooting This appendix documents common lib virt -related problems and errors along with instructions for dealing with them. Locate the error on the table below and follow the corresponding link under So l uti o n for detailed troubleshooting information. T ab le B .1. C o mmo n lib virt erro rs Erro r D escrip t io n o f p ro b lem So lu t io n l i bvi rtd fai l ed to start The lib virt daemon failed to start.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Erro r D escrip t io n o f p ro b lem So lu t io n PXE boot (or D HCP) on guest failed A guest virtual machine starts successfully, but is unable to acquire an IP address from D HCP, boot using the PXE protocol, or both. This is often a result of a long forward delay time set for the bridge, or when the iptables package and kernel do not support checksum mangling rules.
Common libvirt errors and t roubleshoot ing Erro r D escrip t io n o f p ro b lem So lu t io n No guest virtual machines are present when lib virt d is started The lib virt daemon is successfully started, but no guest virtual machines appear to be present when running vi rsh l i st --al l . While lib virt d should listen on TCP ports for connections, the connection to the hypervisor fails. Section B.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Note This line is commented out by default to prevent lib virt from producing excessive log messages. After diagnosing the problem, it is recommended to comment this line again in the /etc/l i bvi rt/l i bvi rtd . co nf file. Restart lib virt to determine if this has solved the problem.
Common libvirt errors and t roubleshoot ing When running a command, the following error (or similar) appears: $ virsh -c name_of_uri list error: Cannot read CA certificate '/etc/pki/CA/cacert.pem': No such file or directory error: failed to connect to the hypervisor In vest ig at io n The error message is misleading about the actual cause. This error can be caused by a variety of factors, such as an incorrectly specified URI, or a connection that is not configured.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide unix_sock_group = unix_sock_ro_perms = unix_sock_rw_perms = Note The user running vi rsh must be a member of the g ro up specified in the uni x_so ck_g ro up option. B.2.3.
Common libvirt errors and t roubleshoot ing Nearly all new BIOSes allow enabling or disabling of the No eXecute bit. However, if disabled, some CPUs do not report this flag and thus lib virt detects a different CPU. Enabling this functionality instructs lib virt to report the correct CPU. Refer to your hardware documentation for further instructions on this subject. B.4 .
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide save was incomplete (for example, due to loss of power before the managed save image was flushed to disk), the save image is corrupted and will not be loaded by Q EMU . The older version of lib virt does not recognize the corruption, making the problem perpetual.
Common libvirt errors and t roubleshoot ing Symp t o m After building a guest virtual machine from an existing disk image, the guest booting stalls with the error message No bo o t d evi ce. However, the guest virtual machine can start successfully using the Q EMU command directly.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide /usr/libexec/qemu-kvm
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide address from D HCP or boot using the PXE protocol, or both. There are two common causes of this error: having a long forward delay time set for the bridge, and when the iptables package and kernel do not support checksum mangling rules. Lo n g f o rward d elay t ime o n b rid g e In vest ig at io n This is the most common cause of this error.
Common libvirt errors and t roubleshoot ing scri pts/i fcfg -name_of_bridge file to turn STP on with a 0 second delay: STP=on DELAY=0 After changing the configuration file, restart the bridge device: /sbin/ifdown name_of_bridge /sbin/ifup name_of_bridge Note If name_of_bridge is not the root bridge in the network, that bridge's delay will eventually reset to the delay time configured for the root bridge. In this case, the only solution is to disable STP completely on name_of_bridge.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide When these conditions occur, UD P packets sent from the host to the guest have uncomputed checksums. This makes the host's UD P packets seem invalid to the guest's network stack. So lu t io n To solve this problem, invalidate any of the four points above. The best solution is to update the host iptables and kernel to iptables-1.4.10 or newer where possible.
Common libvirt errors and t roubleshoot ing physical interface cannot be bounced back up to the macvtap bridge for forwarding to the guests. So lu t io n Use lib virt to create an isolated network, and create a second interface for each guest virtual machine that is connected to this network. The host and guests can then directly communicate over this isolated network, while also maintaining compatibility with NetworkManager. Pro ced u re B .3. C reat in g an iso lat ed n et wo rk wit h lib virt 1.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide This message appears: Could not add rule to fixup DHCP response checksums on network 'default' In vest ig at io n Although this message appears to be evidence of an error, it is almost always harmless. So lu t io n Unless the problem you are experiencing is that the guest virtual machines are unable to acquire IP addresses through D HCP, this message can be ignored. If this is the case, refer to Section B.
Common libvirt errors and t roubleshoot ing br0 Link encap:Ethernet HWaddr 00:00:5A:11:70:48 inet addr:10.22.1.5 Bcast:10.255.255.255 Mask:255.0.0.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:249841 errors:0 dropped:0 overruns:0 frame:0 TX packets:281948 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:106327234 (101.4 MiB) TX bytes:21182634 (20.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide warning: could not open /dev/net/tun: no virtual network emulation qemu-kvm: -netdev tap,script=/etc/my-qemuifup,id=hostnet0: Device 'tap' could not be initialized In vest ig at io n Use of the generic ethernet interface type () is discouraged, because using it requires lowering the level of host protection against potential security flaws in Q EMU and its guests.
Common libvirt errors and t roubleshoot ing cgroup_device_acl = [ "/dev/null", "/dev/full", "/dev/zero", "/dev/random", "/dev/urandom", "/dev/ptmx", "/dev/kvm", "/dev/kqemu", "/dev/rtc", "/dev/hpet", "/dev/net/tun", 4. Restart l i bvi rtd . Important Since each of these steps significantly decreases the host's security protections against Q EMU guest domains, this configuration should only be used if there is no alternative to using .
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Note that the address used for migration data cannot be automatically determined from the address used for connecting to destination lib virt d (for example, from q emu+ tcp: //19 2. 16 8. 122. 12/system).
Common libvirt errors and t roubleshoot ing In vest ig at io n By default, migration only transfers the in-memory state of a running guest (such as memory or CPU state). Although disk images are not transferred during migration, they need to remain accessible at the same path by both hosts. So lu t io n Set up and mount shared storage at the same location on both hosts. The simplest way to do this is to use NFS: Pro ced u re B .5. Set t in g u p sh ared st o rag e 1.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide # virsh list --all Id Name State ---------------------------------------------------# In vest ig at io n There are various possible causes of this problem.
Common libvirt errors and t roubleshoot ing # virsh uri qemu:///system This situation occurs when there are other hypervisors present, which lib virt may speak to by default. So lu t io n After performing these tests, use the following command to view a list of guest virtual machines: # virsh list --all B.16. Unable t o connect t o server at 'host :16509': Connect ion refused ...
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide To do this, modify the /etc/sysco nfi g /l i bvi rtd file and uncomment the following line: #LIBVIRTD_ARGS="--listen" Then restart the lib virt d service with this command: # /etc/init.d/libvirtd restart B.17. Common XML errors The lib virt tool uses XML documents to store structured data. A variety of common errors occur with XML documents when they are passed to lib virt through the API.
Common libvirt errors and t roubleshoot ing These documents contain definitions of states and configurations for the guests. These documents are automatically generated and should not be edited manually. Errors in these documents contain the file name of the broken document. The file name is valid only on the host machine defined by the URI, which may refer to the machine the command was run on. Errors in files created by lib virt are rare.
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide Ensure line number display is enabled in your text editor. Open the XML file, and locate the text on line 6: name_of_guest 524288 2< This snippet of a guest's XML file contains an extra < in the document: So lu t io n Remove the extra < or finish the new element. B.1 7 .2 .2 .
Common libvirt errors and t roubleshoot ing The message following the last colon, cl o ck l i ne 16 and d o mai n, reveals that contains a mismatched tag on line 16 of the document. The last hint is the pointer in the context part of the message, which identifies the second offending tag. Unpaired tags must be closed with />. The following snippet does not follow this rule and has produced the error message shown above: ...
Red Hat Ent erprise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide These XML examples will not parse correctly because of typographical errors such as a missing special character, or an additional character: So lu t io n To identify the problematic tag, read the error message for the context of the file, and locate the error with the pointer. Correct the XML and save the changes. B.17.3.
Common libvirt errors and t roubleshoot ing # virsh dumpxml domain ... ... So lu t io n Correct the XML by adding the missing parameter as follows: