Virt-manager

From Lsdf
Jump to navigationJump to search

UNDER CONSTRUCTION

A kvm image can be created on any linux system. The page describes how to install a kvm image using the virt-manager gui. Alternatively, the command line tool virsh could be used.

prerequeste

The following packages are needed:

  • libvirt-daemon-kvm
  • qemu-kvm
  • virt-manager

It is recommanded to use a CPU with virtualization support:

egrep '^flags.*(vmx|svm)' /proc/cpuinfo 

Make sure libvirtd is running:

/etc/init.d/libvirtd restart

Prepare a network bridge:
RedHat (CentOS, Fedora)
/etc/sysconfig/network-scripts/ifcfg-br0

DEVICE=br0
TYPE=Bridge
BOOTPROTO=dhcp
ONBOOT=yes
NM_CONTROLLED=no

/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
HWADDR=00:11:22:33:44:55
ONBOOT=yes
NM_CONTROLLED=no
BRIDGE=br0
brctl addbr br0
brctl addif br0 eth0
brctl show
bridge name     bridge id               STP enabled     interfaces
br0             0080.000000000000       no              eth0
ifup br0

Note that the NetworkManager does not support bridges.
Ubuntu

Installation of Image

  • Start virt-manager (as superuser) and click on 'Create a new virtual machine' button:

Virt-manager1.png

  • Enter a name for your VM and choose the type of installation of the OS. This example will show how to install CentOS6 with an netinstall iso image. Choose Local install media and click forward.
  • Enter the local path to the netinstall iso image

Converting an Image

  • Converting a raw image to qcow2:
qemu-img convert -O qcow2 myraw.img myqcow2.qcow2

Extending the Size of an Image

Mounting a KVM Image