KVM (Kernel-based Virtual Machine) is a virtualization technology that allows you to run multiple virtual machines on a single physical host. You can use KVM cloud images on Ubuntu Linux to create and run virtual machines quickly and easily.
Here's how to use KVM cloud images on Ubuntu Linux:
sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients
Download a KVM cloud image. You can find KVM cloud images for various operating systems on the internet. Make sure to download a cloud image that is compatible with KVM.
Create a new virtual machine. To create a new virtual machine, use the virt-install
command. Specify the name of the virtual machine, the path to the cloud image, and the amount of memory and CPU resources to allocate to the virtual machine.
For example, to create a new virtual machine named vm1
with 1 GB of memory and 1 CPU core, using the cloud image image.qcow2
, you can use the following command:
virt-install --name vm1 --memory 1024 --vcpus 1 --disk path=image.qcow2,format=qcow2 --os-type linux --os-variant ubuntu20.04 --graphics vnc --noautoconsole
virsh
command.virsh start vm1
vncviewer
. The VNC display number for the virtual machine can be found using the virsh
command:virsh vncdisplay vm1
For example, if the VNC display number is :1
, you can connect to the virtual machine using the following command:
vncviewer localhost:1