Skip to main content

KVM

Let's explain the necessary steps to deploy Barbara OS on a Kernel-based Virtual Machine (KVM) on linux.

Pre-requisites

  1. Install the virt-install command in Linux. Just follow this article.
  2. Install the libvirt service. Just follow [this rticle, too.
  3. Download the .zip containing the Barbara OS Image from panel.

Download image from Panel

Download image from Panel

General Hardware Requirements

Minimum

  • RAM: 2GB
  • Hard Drive: 32GB
  • Processor: 1 processor / 2 cores
  • Network: 1 x Ethernet Interface
  • RAM: 4GB
  • Hard Drive: 64GB
  • Processor: 2 processor / 2 cores
  • Network: 2 x Ethernet Interface

Steps

  1. Unzip the downloaded image file
Unzipping image file
unzip kvm_amd64-pro-4.3.3-1706699899-IMG.zip
  1. Create the folder to store libvirt images:
Create libvirt/images folder
sudo mkdir -p /var/lib/libvirt/images/
  1. Create a copy of the original disk image (optional)
Copy original disk image
sudo cp kvm_amd64-pro-4.3.3-1706699899.qcow2 /var/lib/libvirt/images/kvm_amd64-pro-4.3.3-1706699899_original.qcow2
  1. Copy the disk image that the virtual machine will use as its hard disk
Copy disk image
sudo cp /var/lib/libvirt/images/kvm_amd64-pro-4.3.3-1706699899_original.qcow2 /var/lib/libvirt/images/kvm_prueba_01.qcow2
  1. Copy the firmware UEFI/OVMF to be used (needed to boot up using UEFI and with disabled secure boot)
Copy firmware
sudo cp /usr/share/OVMF/OVMF_VARS_4M.fd /var/lib/libvirt/qemu/nvram/no-secure-boot.fd
  1. Execute the command to resize disk (optional). This is not mandatory, but if desired, this command must be executed before booting up for the first time.
Resize disk
sudo qemu-img resize /var/lib/libvirt/images/kvm_prueba_01.qcow2 32G
  1. Finally, create a new virtual machine using the disk image we have downloaded from Panel.
Create virtual machine
sudo virt-install --name barbara_kvm_01 --ram 2048 --disk path=/var/lib/libvirt/images/kvm_prueba_01.qcow2,bus=virtio --network network=default,model=e1000 --import --osinfo linux2022 --graphics none --boot uefi,loader=/usr/share/OVMF/OVMF_CODE.secboot.fd,loader.readonly=yes,loader.secure='no',loader.type=pflash,nvram=/var/lib/libvirt/qemu/nvram/no-secure-boot.fd

In the previous command you can modify the following parameters:

  • RAM Size: - - ram 2048
  • Machine name: - - name barbara_kvm_01
  • Disk: - - disk /var/lib/libvirt/images/kvm_prueba_.qcow2