libvirt
Добавлено: 17 янв 2016, 12:57
Давно уже пора вынести всё, что касается libvirt в отдельную тему...
Форум по операционной системе GNU/Linux и свободному программному обеспечению
http://linux-ru.ru:80/
1. Начиная с обзора: Анатомия библиотеки виртуализации libvirt - хоть и не нового, но достаточно внятного.Olej писал(а):Давно уже пора вынести всё, что касается libvirt в отдельную тему...
Совместно с libvirt используется менеджер виртуальных машин virt-manager, предоставляющий графический и консольный интерфейс для создания, контроля состояния виртуальных машин (средства virt-viewer, virt-manager).
В состав libvirt входит сервис libvirtd и консольный инструмент virsh.
Поддерживаемые гипервизоры
LXC – Linux container system
OpenVZ – Linux container system
Kernel-based Virtual Machine/QEMU (KVM) – hypervisor
Xen – hypervisor
User-mode Linux (UML) paravirtualized kernel
VirtualBox – hypervisor
VMware ESX and GSX – hypervisors
VMware Workstation and Player – hypervisors
Hyper-V – hypervisor by MicroSoft
PowerVM – hypervisor by IBM
Parallels Workstation – hypervisor
BHyVe
Код: Выделить всё
olej@nvidia ~ $ sudo apt-get install libvirt-bin
Чтение списков пакетов… Готово
...
Код: Выделить всё
olej@nvidia ~ $ virsh
Добро пожаловать в virsh — интерактивный терминал виртуализации.
Введите «help» для получения справки по командам
«quit» для выхода
...
virsh # exit
Код: Выделить всё
olej@nvidia ~ $ apt install virt-manager
Чтение списков пакетов… Готово
...
Код: Выделить всё
olej@nvidia ~ $ apt install virt-viewer
Чтение списков пакетов… Готово
Построение дерева зависимостей
...
Код: Выделить всё
bash-4.2$ sudo yum install virt-manager
...
Код: Выделить всё
bash-4.2$ sudo yum install virt-viewer
...
Код: Выделить всё
olej@nvidia ~ $ sudo virt-manager &
[1] 9669
[1]+ Готово sudo virt-manager
olej@nvidia ~ $
В свежей системе как это выглядит:Olej писал(а):Или так, ... кому больше нравится :
...
Так это выглядит в RPM дистрибутивах ... где имена и состав пакетов зачастую отличаются.
Код: Выделить всё
[olej@xenix ~]$ lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: Fedora
Description: Fedora release 27 (Twenty Seven)
Release: 27
Codename: TwentySeven
Код: Выделить всё
[olej@xenix ~]$ dnf list '*libvirt*'
Последняя проверка окончания срока действия метаданных: 11 days, 2:49:09 назад, Вс 01 апр 2018 17:44:36.
Имеющиеся пакеты
fence-virtd-libvirt.x86_64 0.4.0-3.fc27 fedora
libvirt.x86_64 3.7.0-4.fc27 updates
libvirt-admin.x86_64 3.7.0-4.fc27 updates
libvirt-cim.i686 0.6.3-8.fc27 fedora
libvirt-cim.x86_64 0.6.3-8.fc27 fedora
libvirt-client.x86_64 3.7.0-4.fc27 updates
libvirt-daemon.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-config-network.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-config-nwfilter.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-interface.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-libxl.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-lxc.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-network.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-nodedev.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-nwfilter.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-qemu.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-secret.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-storage.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-storage-core.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-storage-disk.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-storage-gluster.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-storage-iscsi.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-storage-logical.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-storage-mpath.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-storage-rbd.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-storage-scsi.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-storage-sheepdog.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-storage-zfs.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-uml.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-vbox.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-driver-xen.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-kvm.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-lxc.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-qemu.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-uml.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-vbox.x86_64 3.7.0-4.fc27 updates
libvirt-daemon-xen.x86_64 3.7.0-4.fc27 updates
libvirt-designer.x86_64 0.0.2-6.fc27 fedora
libvirt-designer-devel.i686 0.0.2-6.fc27 fedora
libvirt-designer-devel.x86_64 0.0.2-6.fc27 fedora
libvirt-designer-devel-doc.x86_64 0.0.2-6.fc27 fedora
libvirt-designer-libs.i686 0.0.2-6.fc27 fedora
libvirt-designer-libs.x86_64 0.0.2-6.fc27 fedora
libvirt-designer-vala.x86_64 0.0.2-6.fc27 fedora
libvirt-devel.i686 3.7.0-4.fc27 updates
libvirt-devel.x86_64 3.7.0-4.fc27 updates
libvirt-docs.x86_64 3.7.0-4.fc27 updates
libvirt-gconfig.i686 1.0.0-2.fc26 fedora
libvirt-gconfig.x86_64 1.0.0-2.fc26 fedora
libvirt-gconfig-devel.i686 1.0.0-2.fc26 fedora
libvirt-gconfig-devel.x86_64 1.0.0-2.fc26 fedora
libvirt-glib.i686 1.0.0-2.fc26 fedora
libvirt-glib.x86_64 1.0.0-2.fc26 fedora
libvirt-glib-devel.i686 1.0.0-2.fc26 fedora
libvirt-glib-devel.x86_64 1.0.0-2.fc26 fedora
libvirt-gobject.i686 1.0.0-2.fc26 fedora
libvirt-gobject.x86_64 1.0.0-2.fc26 fedora
libvirt-gobject-devel.i686 1.0.0-2.fc26 fedora
libvirt-gobject-devel.x86_64 1.0.0-2.fc26 fedora
libvirt-java.noarch 0.4.9-11.fc27 fedora
libvirt-java-devel.noarch 0.4.9-11.fc27 fedora
libvirt-java-javadoc.noarch 0.4.9-11.fc27 fedora
libvirt-libs.i686 3.7.0-4.fc27 updates
libvirt-libs.x86_64 3.7.0-4.fc27 updates
libvirt-lock-sanlock.x86_64 3.7.0-4.fc27 updates
libvirt-login-shell.x86_64 3.7.0-4.fc27 updates
libvirt-nss.i686 3.7.0-4.fc27 updates
libvirt-nss.x86_64 3.7.0-4.fc27 updates
libvirt-sandbox.x86_64 0.6.0-5.fc27 fedora
libvirt-sandbox-devel.i686 0.6.0-5.fc27 fedora
libvirt-sandbox-devel.x86_64 0.6.0-5.fc27 fedora
libvirt-sandbox-libs.i686 0.6.0-5.fc27 fedora
libvirt-sandbox-libs.x86_64 0.6.0-5.fc27 fedora
libvirt-snmp.x86_64 0.0.3-7.fc24 fedora
libvirt-wireshark.x86_64 3.7.0-4.fc27 updates
mingw32-libvirt.noarch 3.7.0-1.fc27 fedora
mingw32-libvirt-gconfig.noarch 1.0.0-3.fc27 fedora
mingw32-libvirt-glib.noarch 1.0.0-3.fc27 fedora
mingw32-libvirt-gobject.noarch 1.0.0-3.fc27 fedora
mingw32-libvirt-static.noarch 3.7.0-1.fc27 fedora
mingw64-libvirt.noarch 3.7.0-1.fc27 fedora
mingw64-libvirt-gconfig.noarch 1.0.0-3.fc27 fedora
mingw64-libvirt-glib.noarch 1.0.0-3.fc27 fedora
mingw64-libvirt-gobject.noarch 1.0.0-3.fc27 fedora
mingw64-libvirt-static.noarch 3.7.0-1.fc27 fedora
nbdkit-plugin-libvirt.x86_64 1.1.25-1.fc27 updates
ocaml-libvirt.x86_64 0.6.1.4-21.fc27 fedora
ocaml-libvirt-devel.i686 0.6.1.4-21.fc27 fedora
ocaml-libvirt-devel.x86_64 0.6.1.4-21.fc27 fedora
pcp-pmda-libvirt.x86_64 4.0.0-2.fc27 updates
php-libvirt.x86_64 0.5.4-1.fc27 fedora
php-libvirt-doc.noarch 0.5.4-1.fc27 fedora
python2-libvirt.x86_64 3.7.0-1.fc27 fedora
python3-libvirt.x86_64 3.7.0-1.fc27 fedora
rubygem-fog-libvirt.noarch 0.3.0-3.fc27 fedora
rubygem-fog-libvirt-doc.noarch 0.3.0-3.fc27 fedora
rubygem-ruby-libvirt.x86_64 0.7.1-1.fc27 updates
rubygem-ruby-libvirt-doc.noarch 0.7.1-1.fc27 updates
vagrant-libvirt.noarch 0.0.40-3.fc27 updates
vagrant-libvirt-doc.noarch 0.0.40-3.fc27 updates
Код: Выделить всё
[olej@xenix ~]$ dnf list 'virt-*'
Последняя проверка окончания срока действия метаданных: 11 days, 2:54:03 назад, Вс 01 апр 2018 17:44:36.
Установленные пакеты
virt-what.x86_64 1.18-1.fc27 @fedora
Имеющиеся пакеты
virt-dib.x86_64 1:1.38.0-1.fc27 updates
virt-install.noarch 1.4.3-2.fc27 updates
virt-manager.noarch 1.4.3-2.fc27 updates
virt-manager-common.noarch 1.4.3-2.fc27 updates
virt-p2v-maker.x86_64 1:1.38.0-1.fc27 updates
virt-top.x86_64 1.0.8-27.fc27 fedora
virt-v2v.x86_64 1:1.38.0-1.fc27 updates
virt-viewer.x86_64 6.0-1.fc27 fedora
virt-who.noarch 0.17-4.fc27 fedora
Код: Выделить всё
[olej@xenix ~]$ service libvirtd status
Redirecting to /bin/systemctl status libvirtd.service
● libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:libvirtd(8)
http://libvirt.org
[olej@xenix ~]$ systemctl status libvirtd
● libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:libvirtd(8)
http://libvirt.org
[olej@xenix ~]$ sudo systemctl start libvirtd
[sudo] пароль для olej:
[olej@xenix ~]$ systemctl status libvirtd
● libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2018-04-12 21:00:04 EEST; 2s ago
Docs: man:libvirtd(8)
http://libvirt.org
Main PID: 11814 (libvirtd)
Tasks: 18 (limit: 32768)
CGroup: /system.slice/libvirtd.service
├─11814 /usr/sbin/libvirtd
├─11942 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr
└─11944 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr
апр 12 21:00:05 xenix.localdomain dnsmasq[11942]: started, version 2.79 cachesize 150
апр 12 21:00:05 xenix.localdomain dnsmasq[11942]: compile time options: IPv6 GNU-getopt DBus no-i18n IDN2 DHCP DHCPv6 no
апр 12 21:00:05 xenix.localdomain dnsmasq-dhcp[11942]: DHCP, IP range 192.168.122.2 -- 192.168.122.254, lease time 1h
апр 12 21:00:05 xenix.localdomain dnsmasq-dhcp[11942]: DHCP, sockets bound exclusively to interface virbr0
апр 12 21:00:05 xenix.localdomain dnsmasq[11942]: reading /etc/resolv.conf
апр 12 21:00:05 xenix.localdomain dnsmasq[11942]: using nameserver 192.168.1.3#53
апр 12 21:00:05 xenix.localdomain dnsmasq[11942]: using nameserver 8.8.4.4#53
апр 12 21:00:05 xenix.localdomain dnsmasq[11942]: read /etc/hosts - 3 addresses
апр 12 21:00:05 xenix.localdomain dnsmasq[11942]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses
апр 12 21:00:05 xenix.localdomain dnsmasq-dhcp[11942]: read /var/lib/libvirt/dnsmasq/default.hostsfile
[olej@xenix ~]$ sudo systemctl enable libvirtd