Virt-manager

From Gentoo Wiki
Jump to:navigation Jump to:search
This article is a stub. Please help out by expanding it (how to get started).

The virt-manager application is a desktop user interface for managing virtual machines through libvirt. It primarily targets KVM VMs, but also manages Xen and LXC (linux containers). It presents a summary view of running domains, their live performance & resource utilization statistics. Wizards enable the creation of new domains, and configuration & adjustment of a domain’s resource allocation & virtual hardware. An embedded VNC and SPICE client viewer presents a full graphical console to the guest domain [1].

Installation

Kernel

The following kernel config is recommended by the libvirt installer (source?).

Note
Check the logs to see if any additional kernel configs are requested by the build.
KERNEL libvirt (CONFIG_BRIDGE_EBT_MARK, CONFIG_NETFILTER_ADVANCED, CONFIG_NETFILTER_XT_CONNMARK, CONFIG_NETFILTER_XT_TARGET_CHECKSUM, CONFIG_IP6_NF_NAT)
[*] Networking support
    Networking Options  --->
        [*] Network packet filtering framework (Netfilter)  --->
            [*] Advanced netfilter configuration
            Core Netfilter Configuration  --->
                <*> "conntrack" connection tracking match support
                <*> CHECKSUM target support
            IPv6: Netfilter Configuration  --->
                <*> ip6tables NAT support
                
            <*> Ethernet Bridge tables (ebtables) support  --->
                <*> ebt: nat table support
                <*> ebt: mark filter support
        [*] QoS and/or fair queueing  --->
            <*> Hierarchical Token Bucket (HTB)
            <*> Stochastic Fairness Queueing (SFQ)
            <*> Ingress/classifier-action Qdisc
            <*> Netfilter mark (FW)
            <*> Universal 32bit comparisons w/ hashing (U32)
            [*] Actions
            <*>    Traffic Policing

USE flags

USE flags for app-emulation/virt-manager A graphical tool for administering virtual machines

gtk Add support for x11-libs/gtk+ (The GIMP Toolkit)
policykit Enables sys-auth/polkit authentication support, required when using app-emulation/libvirt with PolicyKit authentication
sasl Depend on the proper libraries needed to connect to SASL-enabled libvirtd instances (e.g. Kerberos-protected instances).
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)

Emerge

root #emerge --ask app-emulation/virt-manager
Note
When using virt-manager, be sure to enable the usbredir and spice USE flags on the qemu package for correct operation.

Configuration

User Permissions

After emerging, to run virt-manager as a normal user, ensure each user has been added to the libvirt group:

root #usermod -a -G libvirt <user>

Uncomment the following lines from the libvirtd configuration file:

FILE /etc/libvirt/libvirtd.conf
auth_unix_ro = "none"
auth_unix_rw = "none"
unix_sock_group = "libvirt"
unix_sock_ro_perms = "0777"
unix_sock_rw_perms = "0770"

Be sure to have the user log out then log in again for the new group settings to be applied.

Note
If policykit USE flag is not enabled for libvirt package, the libvirt group is not created, in which case another group, such as wheel must be used for unix_sock_group.

Issue the following command to restart the libvirtd service under OpenRC:

root #/etc/init.d/libvirtd restart

Issue the following command to restart the libvirtd service under systemd:

root #systemctl restart libvirtd

virt-admin should now be launchable as a regular user.

Note
If permission denied issues are experienced when loading ISO images user directories (somewhere beneath /home/) then the /var/lib/libvirt/images/ directory can be used to store the images.

Files

  • /etc/libvirt/libvirtd.conf - Global (system wide) configuration file.

Service

OpenRC

root #rc-service libvirtd start
root #rc-update add libvirtd default

systemd

root #systemctl start libvirtd
root #systemctl enable libvirtd

Usage

Checking networking

Network interfaces for virt-manager can be checked by running virsh net-list

Removal

Unmerge

root #emerge --ask --depclean --verbose app-emulation/virt-manager

See also

  • QEMU — a generic, open source hardware emulator and virtualization suite.
  • GPU passthrough with libvirt qemu kvm — directly present an internal PCI GPU to a virtual machine
  • Virtualization — the concept and technique that permits running software in an environment separate from a computer operating system.