Project

General

Profile

Support #659

Updated by Daniel Curtis about 9 years ago

This is a simple guide for getting started with virt-manager on Arch Linux. 

 h2. Prepare the Environment 

 * Make sure the system is up to date: 
 <pre> 
 sudo pacman -Syu 
 </pre> 

 * Install libvirt and a few dependencies: 
 <pre> 
 sudo pacman -S libvirt qemu ebtables dnsmasq bridge-utils openbsd-netcat 
 </pre> 
 #* *NOTE*: Extra architectures can be installed by installing the qemu-arch-extra package 
 <pre> 
 sudo pacman -S qemu-arch-extra 
 </pre> 

 * Create the *qemu* user and added it to *kvm* group: 
 <pre> 
 sudo useradd -MrG kvm qemu 
 </pre> 

 * Edit the qemu config: 
 <pre> 
 sudo nano /etc/libvirt/qemu.conf 
 </pre> 
 #* And set the user and groups that qemu will use: 
 <pre> 
 user = "qemu" 
 group = "kvm" 
 </pre> 

 * Start and enable libvirtd.service at boot: 
 <pre> 
 sudo systemctl enable libvirtd.service 
 sudo systemctl start libvirtd.service 
 </pre> 

 * Change the group authorized to access the RW daemon socket, create the following file: 
 <pre> 
 sudo nano /etc/polkit-1/rules.d/49-org.libvirt.unix.manager.rules 
 </pre> 
 #* And add the following: 
 <pre> 
 /* Allow users in kvm group to manage the libvirt 
 daemon without authentication */ 
 polkit.addRule(function(action, subject) { 
     if (action.id == "org.libvirt.unix.manage" && 
         subject.isInGroup("kvm")) { 
             return polkit.Result.YES; 
     } 
 }); 
 </pre> 

 * Then add the *bob* user bob to the *kvm* kvm group: 
 <pre> 
 groupadd kvm 
 usermod -aG kvm bob 
 </pre>  

 * Log out and then log back in for the permissions to take effect. 

 h2. Install virt-manager 

 * Install virt-manager hypervisor: 
 <pre> 
 pacman -S virt-manager 
 </pre> 

 * Create a new *QEMU/KVM Session* connection  

 h2. Resources 

 * https://wiki.archlinux.org/index.php/Libvirt 
 * https://wiki.archlinux.org/index.php/QEMU 
 * https://wiki.archlinux.org/index.php/KVM 
 * https://wiki.archlinux.org/index.php/LXC 
 * https://bbs.archlinux.org/viewtopic.php?id=157162

Back