Архив рубрики: KVM

Виртуализация КVM

Remove password prompt in virt-manager

Solution 1

When you start virt-manager as a regular user, you may still be asked for the root password, even when you have setup the correct unix socket permissions (notification: “system policy prevents management of local virtualized systems”). This is because older versions of libvirt were using PolicyKit by default. Disable the use of PolicyKit by editing /etc/libvirt/libvirtd.conf. Uncomment the following options and change them to none :

 

Solution 2

Добавить пользователя в группу libvirt, чтобы не требовались root-права при запуске.

KVM: Starting / Stopping Guest Operating Systems With virsh Command

The virsh command can be used to mange local or remote guest operating systems. The program can be used to create, pause, and shutdown domains. It can also be used to list current domains.

List Running VMS

Type the following command:

Sample outputs:

Shut Down A Guest

Rebooting A Guest

Forcefully Stop A Guest

Force a guest to stop with the virsh command if it is not responding or crashed

Get Information About Guest

Sample outputs:

Sample Outputs:

Mount QCOW2

# Загружаем модуль ядра Network Block Device

# «Подключаем» образ к устройству /dev/nbd0.

# Ищем разделы на устройстве.

# Здесь ты можешь делать с разделами /dev/mapper/ndb0p* что угодно: монтировать, форматировать и т.п.
# Например открыть Dolphin
# ReadOnly вариант подключения:

##############################################################
# Убираем девайсы разделов.

# Выключаем qemu-nbd.

Spice USB

First of all do this:

and all is OK. I’ve got USB flash disk and USB-COM cabel in my guest Windows 7 x64. And little more.
For disable asking root password for low level USB device access I made little changes in file
/usb/share/polkit-1/actions/org.spice-spice.lowlevelusbaccess.policy.
Before changes I had follow

After I have

Look man polkit for these options.
And now I have no need root password for USB redirection.