User Tools

Site Tools


getting_started_with_virtualization_on_fedora

Overview

Basic virtualization on Fedora using libvirt family of tools.

Image formats

The Virtualization group

The package group:

$ dnf group info virtualization
Last metadata expiration check: 0:10:25 ago on Thu 05 Apr 2018 05:08:42 AM EDT.

Group: Virtualization
 Description: These packages provide a graphical virtualization environment.
 Mandatory Packages:
   virt-install
 Default Packages:
   libvirt-daemon-config-network
   libvirt-daemon-kvm
   qemu-kvm
   virt-manager
   virt-viewer
 Optional Packages:
   guestfs-browser
   libguestfs-tools
   libvirt-client
   python-libguestfs
   virt-top
$

Install with all optional packages:

$ sudo dnf group install --with-optional virtualization
Last metadata expiration check: 1:13:33 ago on Thu 05 Apr 2018 04:06:20 AM EDT.
No match for group package "python-libguestfs"
Dependencies resolved.
=====================================================================================================
 Group                    Packages                                                                 
=====================================================================================================
Marking packages as installed by the group:
 @Virtualization          virt-manager        virt-top                libvirt-client               
                          virt-install        guestfs-browser         libvirt-daemon-config-network
                          virt-viewer         libguestfs-tools        libvirt-daemon-kvm           
                          qemu-kvm                                                                 
=====================================================================================================
 Package                                 Arch       Version                        Repository   Size
=====================================================================================================
Installing group packages:
 guestfs-browser                         x86_64     0.2.3-10.fc27                  fedora      1.3 M
 libguestfs-tools                        noarch     1:1.38.0-1.fc27                updates      36 k
 libvirt-client                          x86_64     3.7.0-4.fc27                   updates     301 k
 virt-install                            noarch     1.4.3-2.fc27                   updates      95 k
 virt-manager                            noarch     1.4.3-2.fc27                   updates     648 k
 virt-top                                x86_64     1.0.8-27.fc27                  fedora      584 k
 virt-viewer                             x86_64     6.0-1.fc27                     fedora      393 k
Installing dependencies:
 autogen-libopts                         x86_64     5.18.12-5.fc27                 fedora       73 k
 gnutls-dane                             x86_64     3.5.18-2.fc27                  updates      40 k
 gnutls-utils                            x86_64     3.5.18-2.fc27                  updates     311 k
 ocaml-camomile-data                     x86_64     0.8.6-0.1.git3f4d657d.fc27     fedora      2.1 M
 perl-Sys-Guestfs                        x86_64     1:1.38.0-1.fc27                updates     317 k
 perl-Sys-Virt                           x86_64     3.7.0-1.fc27                   fedora      280 k
 perl-hivex                              x86_64     1.3.14-8.fc27                  fedora       56 k
 python-backports-ssl_match_hostname     noarch     3.5.0.1-5.fc27                 fedora       17 k
 python-chardet                          noarch     3.0.4-2.fc27                   fedora      189 k
 python-ipaddr                           noarch     2.1.10-7.fc27                  fedora       40 k
 python-ipaddress                        noarch     1.0.18-2.fc27                  fedora       39 k
 python2-asn1crypto                      noarch     0.23.0-1.fc27                  updates     176 k
 python2-cffi                            x86_64     1.10.0-3.fc27                  fedora      227 k
 python2-cryptography                    x86_64     2.0.2-3.fc27                   updates     507 k
 python2-enum34                          noarch     1.1.6-3.fc27                   updates      57 k
 python2-gobject                         x86_64     3.26.1-1.fc27                  updates      23 k
 python2-idna                            noarch     2.5-2.fc27                     fedora       98 k
 python2-libvirt                         x86_64     3.7.0-1.fc27                   fedora      272 k
 python2-ply                             noarch     3.9-4.fc27                     fedora      107 k
 python2-pyOpenSSL                       noarch     17.2.0-2.fc27                  fedora       98 k
 python2-pycparser                       noarch     2.14-11.fc27                   fedora      146 k
 python2-pysocks                         noarch     1.6.7-1.fc27                   fedora       32 k
 python2-requests                        noarch     2.18.4-1.fc27                  fedora      122 k
 python2-urllib3                         noarch     1.22-3.fc27                    updates     178 k
 unbound-libs                            x86_64     1.6.8-6.fc27                   updates     414 k
 virt-manager-common                     noarch     1.4.3-2.fc27                   updates     1.2 M

Transaction Summary
=====================================================================================================
Install  33 Packages

Total download size: 10 M
Installed size: 58 M
...
Installed:
  guestfs-browser.x86_64 0.2.3-10.fc27                       libguestfs-tools.noarch 1:1.38.0-1.fc27 
  libvirt-client.x86_64 3.7.0-4.fc27                         virt-install.noarch 1.4.3-2.fc27        
  virt-manager.noarch 1.4.3-2.fc27                           virt-top.x86_64 1.0.8-27.fc27           
  virt-viewer.x86_64 6.0-1.fc27                              autogen-libopts.x86_64 5.18.12-5.fc27   
  gnutls-dane.x86_64 3.5.18-2.fc27                           gnutls-utils.x86_64 3.5.18-2.fc27       
  ocaml-camomile-data.x86_64 0.8.6-0.1.git3f4d657d.fc27      perl-Sys-Guestfs.x86_64 1:1.38.0-1.fc27 
  perl-Sys-Virt.x86_64 3.7.0-1.fc27                          perl-hivex.x86_64 1.3.14-8.fc27         
  python-backports-ssl_match_hostname.noarch 3.5.0.1-5.fc27  python-chardet.noarch 3.0.4-2.fc27      
  python-ipaddr.noarch 2.1.10-7.fc27                         python-ipaddress.noarch 1.0.18-2.fc27   
  python2-asn1crypto.noarch 0.23.0-1.fc27                    python2-cffi.x86_64 1.10.0-3.fc27       
  python2-cryptography.x86_64 2.0.2-3.fc27                   python2-enum34.noarch 1.1.6-3.fc27      
  python2-gobject.x86_64 3.26.1-1.fc27                       python2-idna.noarch 2.5-2.fc27          
  python2-libvirt.x86_64 3.7.0-1.fc27                        python2-ply.noarch 3.9-4.fc27           
  python2-pyOpenSSL.noarch 17.2.0-2.fc27                     python2-pycparser.noarch 2.14-11.fc27   
  python2-pysocks.noarch 1.6.7-1.fc27                        python2-requests.noarch 2.18.4-1.fc27   
  python2-urllib3.noarch 1.22-3.fc27                         unbound-libs.x86_64 1.6.8-6.fc27        
  virt-manager-common.noarch 1.4.3-2.fc27 

Manually install:

$ sudo dnf install python3-libguestfs

systemd

$ systemctl status libvirtd
● libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2018-04-04 11:40:44 EDT; 5h 21min ago
     Docs: man:libvirtd(8)
           http://libvirt.org
 Main PID: 1551 (libvirtd)
    Tasks: 18 (limit: 32768)
   Memory: 38.5M
      CPU: 512ms
   CGroup: /system.slice/libvirtd.service
           ├─1551 /usr/sbin/libvirtd
           ├─2027 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-
           └─2028 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
lines 1-15/15 (END)

Modules

$ lsmod | grep kvm
kvm_intel             233472  0
kvm                   700416  1 kvm_intel
irqbypass              16384  1 kvm
$

Creating virtual machines

virt-install

Package contents:

$ rpm -ql virt-install
/usr/bin/virt-clone
/usr/bin/virt-convert
/usr/bin/virt-install
/usr/bin/virt-xml
/usr/share/man/man1/virt-clone.1.gz
/usr/share/man/man1/virt-convert.1.gz
/usr/share/man/man1/virt-install.1.gz
/usr/share/man/man1/virt-xml.1.gz
/usr/share/virt-manager/virt-clone
/usr/share/virt-manager/virt-convert
/usr/share/virt-manager/virt-install
/usr/share/virt-manager/virt-xml
$

virt-manager

Managing virtual machines

virsh

getting_started_with_virtualization_on_fedora.txt · Last modified: 2018/04/05 10:31 by rpjday