Kvm guest tools linux
KVM, Kernel-based Virtual Machine, is a hypervisor built into the Linux kernel. It is similar to Xen in purpose but much simpler to get running. Unlike native QEMU, which uses emulation, KVM is a special operating mode of QEMU that uses CPU extensions (HVM) for virtualization via a kernel module.
Using KVM, one can run multiple virtual machines running unmodified GNU/Linux, Windows, or any other operating system. (See Guest Support Status for more information.) Each virtual machine has private virtualized hardware: a network card, disk, graphics card, etc.
Differences between KVM and Xen, VMware, or QEMU can be found at the KVM FAQ.
This article does not cover features common to multiple emulators using KVM as a backend. You should see related articles for such information.
Contents
Checking support for KVM
Hardware support
KVM requires that the virtual machine host’s processor has virtualization support (named VT-x for Intel processors and AMD-V for AMD processors). You can check whether your processor supports hardware virtualization with the following command:
If nothing is displayed after running either command, then your processor does not support hardware virtualization, and you will not be able to use KVM.
Kernel support
Arch Linux kernels provide the required kernel modules to support KVM.
- One can check if the necessary modules, kvm and either kvm_amd or kvm_intel , are available in the kernel with the following command:
The module is available only if it is set to either y or m .
- Then, ensure that the kernel modules are automatically loaded, with the command:
If the command returns nothing, the module needs to be loaded manually, see Kernel modules#Manual module handling.
Para-virtualization with Virtio
Para-virtualization provides a fast and efficient means of communication for guests to use devices on the host machine. KVM provides para-virtualized devices to virtual machines using the Virtio API as a layer between the hypervisor and guest.
All Virtio devices have two parts: the host device and the guest driver.
Kernel support
Use the following command to check if the VIRTIO modules are available in the kernel inside the virtual machine:
Then, check if the kernel modules are automatically loaded with the command:
In case the above commands return nothing, you need to load the kernel modules manually.
List of para-virtualized devices
- network device (virtio-net)
- block device (virtio-blk)
- controller device (virtio-scsi)
- serial device (virtio-serial)
- balloon device (virtio-balloon)
How to use KVM
See the main article: QEMU.
Tips and tricks
Nested virtualization
Nested virtualization enables existing virtual machines to be run on third-party hypervisors and on other clouds without any modifications to the original virtual machines or their networking.
On host, enable nested feature for kvm_intel :
Verify that feature is activated:
Enable the «host passthrough» mode to forward all CPU features to the guest system:
- If using QEMU, run the guest virtual machine with the following command: qemu-system-x86_64 -enable-kvm -cpu host .
- If using virt-manager, change the CPU model to host-passthrough .
- If using virsh, use virsh edit vm-name and change the CPU line to
Boot VM and check if vmx flag is present:
Enabling huge pages
This article or section is a candidate for merging with QEMU.
You may also want to enable hugepages to improve the performance of your virtual machine. With an up to date Arch Linux and a running KVM you probably already have everything you need. Check if you have the directory /dev/hugepages . If not, create it. Now we need the right permissions to use this directory. The default permission is root’s uid and gid with 0755, but we want anyone in the kvm group to have access to hugepages.
Add to your /etc/fstab :
Of course the gid must match that of the kvm group or specify the group name directly with gid=kvm . The mode of 1770 allows anyone in the group to create files but not unlink or rename each other’s files. Make sure /dev/hugepages is mounted properly:
Now you can calculate how many hugepages you need. Check how large your hugepages are:
Normally that should be 2048 kB ≙ 2 MB. Let us say you want to run your virtual machine with 1024 MB. 1024 / 2 = 512. Add a few extra so we can round this up to 550. Now tell your machine how many hugepages you want:
If you had enough free memory you should see:
If the number is smaller, close some applications or start your virtual machine with less memory (number_of_pages x 2):
Note the -mem-path parameter. This will make use of the hugepages.
Now you can check, while your virtual machine is running, how many pages are used:
Источник
Kvm guest tools linux
There are a several options available to manage kvm virtual machines:
(Please keep this list in alphabetical order)
Name/URL | Description | UI Type | Last Updated | Notes | License |
---|---|---|---|---|---|
Abiquo | Abiquo is a technology-agnostic solution for enterprises and service providers who want to quickly and simply build, manage and develop public and private clouds based on their existing heterogeneous environments. | Web, REST | Active | KVM, Xen, VirtualBox, VMware, Hyper-V & XenServer support; uses libvirt | Commercial |
Archipel | Archipel is an Open Source project that aims to bring push notifications to virtualization orchestration using XMPP. | Web | Active | KVM, Xen, Virtual Box & OpenVZ support; uses libvirt | AGPL v3 |
AQemu | a Qt4 user interface for KVM | Desktop | 2013-05-30 | GPL v2 | |
cloonix | cloonix is a virtualization management framework aimed at virtual networks building based on kvm. | Gui/cli | Active | KVM | RPL Licence |
CloudStack | Cloudstack is an open source project that enables the deployment, management, and configuration of multi-tier and multi-tenant infrastructure cloud services using Xen, KVM and VMware hypervisors. | Web | Active | KVM, Xen & VMware support | Apache License v2 |
ConVirt | ConVirt 2.0 Open Source is the leading open source product for managing Xen and KVM, enabling you to standardize and proactively manage your virtualized environment in a centralized fashion. | Web | Active | Xen & KVM; formerly known as xenman | GPL v2 |
Enomaly | a programmable virtual cloud infrastructure for small, medium and large businesses | Web, REST | Not available as of 2010-02-08 | they have commercial and open source editions | Commercial/AGPL v3 |
Eucalyptus | Eucalyptus is open source software for building AWS-compatible private and hybrid clouds. Eucalyptus allows IT organizations to build an on-premises Infrastructure as a Service (IaaS) cloud that pools together compute, storage, and network resources. With Eucalyptus, developers can leverage knowledge and tools around AWS APIs, including EC2, S3, EBS, IAM, Auto Scaling, Elastic Load Balancing, and CloudWatch. IT can create a flexible hybrid cloud environment so that developers can develop sooner, test more, and deploy faster while giving IT and cloud admins greater control of cloud performance, scale, and security. | Web, CLI, REST, SOAP | Active | Supports KVM and VMware. Uses libvirt. View the Eucalyptus Compatibility Matrix: http://bit.ly/QfH4Iv | GPL v3 |
Foreman | Foreman is aimed to be a Single Address For All Machines Life Cycle Management including bare metal / vm / cloud provisioning, configuration managememnt and configureation reports/auditing using puppet | Web, REST, CLI | Active | KVM, VMWare, oVirt RHEV-M, EC2, OpenStack | GPL v3 |
Ganeti | Ganeti is a cluster virtual server management software tool built on top of existing virtualization technologies | CLI | Active | KVM support added in Ganeti 2.0 | GPL v2 |
GKVM | A Gnome user interface for KVM. | Desktop | 2007-08-01 | GPL v2 | |
Karesansui | Karesansui is an open-source virtualization management application. It’s smart graphical user interface lowers your management cost, and brings a total management/audit solution for both physical and virtual servers. | Web, REST | November 2013 | KVM & Xen support; uses libvirt | LGPL v2.1/GPL v2 |
kimchi | Kimchi is an HTML5 based management tool for KVM. It is designed to make it as easy as possible to get started with KVM and create your first guest. | WEB | Active | KVM | LGPL,Apache License v2 |
Kubevirt | Virtualization API for Kubernetes | CLI, API | Active | Run VMs in Kubernetes | Apache License v2 |
kvmadm | a minimalistic set of command-line tools to control multi-user utilization of KVM | CLI | 2007-09-25 | GPL v2 | |
kvmupdown | simple, robust and no-bloat management interface. | CLI | Link broken, probably terminated project | KVM | public domain |
kvm-admin | Python scripts for managing the guests (boot, shutdown . ) and include a commandline monitor . | CLI | Active | kvm support | GPL v2 |
kvm-wrapper | kvm-wrapper is a lightweight, simple and intended to be hackable set of shell scripts that help manage kvm virtual machines a great deal. | CLI | Active | KVM support | WTFPL (v2) |
Mist.io | Mist.io provides a unifed dashboard / API for managing your entire infrastructure — public and private clouds, KVM and VMware hypervisors, bare metal, and containers. You can install the open-source version or use the freemium service. Try it out | Web, Mobile, REST API, CLI | Active | Uses libvirt and libcloud for VM management. Supports KVM, several public cloud providers, OpenStack, Docker and bare metal servers. | AGPL v3 for the open source version, Commercial for the service |
Morpheus | Morpheus provides a single dashboard for managing hybrid infrastructure — KVM, Xen, VMware hypervisors, public clouds, bare metal, and containers. Learn more. | UI, API, and CLI | Active | Commercial (community licensing for testing and lab environments; up to 25 workloads and 3 clouds) | |
nbsvm | No Bullshit VMs. No setup required. No dependencies but sudo, and LVM or ZFS. Start, stop, create and clone images and view VMs using simple chained commands. Basically applies sane (overridden by cli or file) defaults to the kvm invocation and gets out of the way. Sudo invocation is designed to allow user access controls. | CLI | February 2014 | WTFPL 2 | |
Nimbula Director | Nimbula Director is a Cloud Operating System that enables Infrastructure as a Service using the KVM. | Web, CLI, REST | Active | KVM support | Commercial (Freemium) |
op5 | op5 develops and delivers op5 Monitor a enterprise-class software for IT monitoring and administration of the whole IT. op5 developed a KVM plug-in to monitor KVM virtualization infrastructure that allows organizations to have better capacity planning, which enables the provisioning of usage of resources such as storage, CPU, and memory more proactively. | Web, REST | Active | Uses libvirt | GPL v2 |
OpenNebula | an open source virtual infrastructure engine | CLI, XML-RPC | Active | cloud computing managment; uses libvirt | Apache License v2 |
OpenNode | RHEL/CentOS based open-source server virtualization and management solution — simple bare-metal installer, providing KVM+OpenVZ host and standard libvirt, func management interfaces together with standard cli tools like virsh and vzctl. OpenNode Management Server with ajax web-based management console available — as is RPC-JSON API interface. | Web, CLI, API | Active | Bare-metal installer, KVM, OpenVZ hypervizors and variety of management tools | Unknown |
openQRM | openQRM is the next generation, open-source Data-center management platform. | Web | Active | KVM, Xen, VMware and Linux V-Server support | GPL v2 |
oVirt | oVirt is a virtualization management framework constisting of a small host image, the oVirt Node, that provides the libvirt service to host virtual machines, and a robust vm management software stack, controlled by a web-based management interface, the oVirt Server. | Web | Active | uses libvirt | Apache License v2 |
Platform9 Managed OpenStack | Platform9 makes it very easy to manage a KVM environment with resource pooling and automation. Platform9’s Openstack service easily integrates with any new or existing Linux servers. KVM expertise is helpful but not required. The OpenStack service supports major Linux distributions including CentOS, RHEL & Ubuntu. See the demos for KVM. | UI, OpenStack CLI, OpenStack API & integrations (puppet, ansible, chef, vagrant, etc). | Active | Fast, Easy & Affordable for anyone familiar with Linux. See KVM Management w/ OpenStack. | Commercial. A free trial is available. |
Proxmox VE | Proxmox Virtual Environment (Proxmox VE) is an open-source server virtualization management platform to manage VMs and containers. The Debian-based platform uses KVM as hypervisor and also provides OS-level virtualization using LXC containers. It provides enterprise-class features like clustering, high availability, networking, live migration, backup/restore, integrates a built-in firewall and come with various storage plugins such as LVM, LVM-thin, iSCSI/kernel, iSCSI/libiscsi, Ceph/RBD, Sheepdog, ZFS over iSCSI, ZFS (local), directory, NFS, CIFS, and GlusterFS. Источник |