Create VM using KVM and Virt Manager

Type this command to see if the processor is enough to handle virtualization

$ egrep -c ‘(vmx|svm)’ /proc/cpuinfo

if the output is greater than 0 (zero) you’re good to go.

next is to install these packages by using this command

$ sudo apt install -y qemu qemu-kvm libvirt-daemon libvirt-clients bridge-utils virt-manager

Start and enable libvirt and check the status

$ sudo systemctl start libvirt

$ sudo systemctl enable libvirt

$ sudo systemctl status libvirt

Before creating vm using libvirt, it is recommended using .qcow2 image, if the available image is not in .qcow2 format you can convert the raw image using this command

$ qemu-img convert -f raw -o qcow2 <image path> <new image path .qcow2>

Now you can use this command below to create a vm with KVM and Virt Manager using CLI (Command Line Interface)

$ sudo virt-install –name <vm_name> –disk <path to image> –import –vcpus <vm’s vcpu> –memory <vm’s memory> –os-variant <vm’s os of choice> –network default

Leave a Reply

Your email address will not be published. Required fields are marked *