Ubuntu cloud images with virt-install

Earlier we looked at how we could use Ubuntu cloud images with KVM. Now we will use the libvirt cli virsh and virt-install to do the same process. virt-install is a part of the virt-manager supporting tools.

Fetch the Ubuntu Cloud image

This only need to be done once, or when you want to update the cloud image.

  1. Download a Ubuntu Focal image from Ubuntu Cloud Images.
    wget https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img
    
  2. Create an empty image in the default storage pool. This is a storage space where we upload the cloud image. Note that we use the correct postfix on the name here.
    virsh vol-create-as default focal-server-cloudimg-amd64.qcow2 20G
    
  3. Upload the downloaded cloud image to the storage pool in the reserved spaced.
    virsh vol-upload focal-server-cloudimg-amd64.qcow2 focal-server-cloudimg-amd64.img --sparse --pool default
    

Create the VM

Now we use the cloud image as a template for all our new VMs. Change the size and virt-install parameters to make it your own.

[Read More]

Vagrant with Ubuntu Focal (20.04)

Vagrant is a great way to script development environments for system administrators. It works with full virtualization and is closer to the real hardware than container systems.

There is a bug in the latest version of Ubuntu (Vagrant Box) that makes it hang during boot. It even hangs the VirtualBox and makes the GUI misbehave. The reason is a missing redirect of the console serial device. Console output fills up a buffer and then just hangs.

[Read More]