Libvirt/QEMU guest
From Gentoo Wiki
< Libvirt
Jump to:navigation
Jump to:search
This article covers libvirt and its creation of a virtual machine (VM) for use under the soft-emulation mode QEMU hypervisor Type-2, notably using virsh command.
The virsh command and its configuration toward the creation of an strict-emulation-mode virtual machine that an QEMU-capable operating system to be installed on.
Installation
Note
Use QEMU to install app-emulation/qemu and Libvirt to install app-emulation/libvirt. Once installed, return to this guide.
Use QEMU to install app-emulation/qemu and Libvirt to install app-emulation/libvirt. Once installed, return to this guide.
Verify system is capable of being a virtualization host.
root #
virt-host-validate
QEMU: Checking for hardware virtualization : PASS QEMU: Checking if device /dev/kvm exists : PASS QEMU: Checking if device /dev/kvm is accessible : PASS QEMU: Checking if device /dev/vhost-net exists : PASS QEMU: Checking if device /dev/net/tun exists : PASS QEMU: Checking for cgroup 'cpu' controller support : PASS QEMU: Checking for cgroup 'cpuacct' controller support : PASS QEMU: Checking for cgroup 'cpuset' controller support : PASS QEMU: Checking for cgroup 'memory' controller support : PASS QEMU: Checking for cgroup 'devices' controller support : PASS QEMU: Checking for cgroup 'blkio' controller support : PASS QEMU: Checking for device assignment IOMMU support : PASS QEMU: Checking if IOMMU is enabled by kernel : PASS QEMU: Checking for secure guest support : WARN (Unknown if this platform has Secure Guest support) CH: Checking for hardware virtualization : PASS CH: Checking if device /dev/kvm exists : PASS CH: Checking if device /dev/kvm is accessible : PASS
Usage
List virtual machines (domains)
root #
virsh list --all
Id Name State ------------------------------------- 1 gentoo running
Creating a virtual machine
Starting a virtual machine
Shutdown a virtual machine
Graceful shutdown, similar to pressing the power button on a physical machine.
root #
virsh shutdown <vm-id>
Hard shutdown, similar to pulling the power cord on a physical machine.
root #
virsh destroy <vm-id>
See also
- Virtualization — the concept and technique that permits running software in an environment separate from a computer operating system.
- QEMU — a generic, open source hardware emulator and virtualization suite.
- QEMU/QEMU front-ends
- Libvirt — a virtualization management toolkit.
- Libvirt/QEMU_networking — details the setup of Gentoo networking by Libvirt for use by guest containers and QEMU-based virtual machines.
- Virt-manager — desktop user interface for management of virtual machines and containers through the libvirt library
- Virt-manager/QEMU_guest — QEMU creation of a guest (VM or container)
- QEMU/Linux guest — describes the setup of a Gentoo Linux guest in QEMU using Gentoo bootable media.