There are a lot of ways to create a virtual machine using kvm in linux. I will introduce the one I think is the most convenient.
- Ubuntu 14.04 or later.
- Native system (physical machine).
-
install qemu-kvm, libvirt-bin and check if hardware supports the necessary virtualization extesions for KVM.
sudo apt install qemu-kvm libvirt-bin kvm-ok
-
install uvtool and uvtool-libvirt
sudo apt -y install uvtool
-
synchronize one specific cloud-image. Use xenial(16.04) for example here.
uvt-simplestreams-libvirt sync release=xenial arch=amd64
-
create ssh key if you don't have one.
ssh-keygen
-
create a new virtual machine
uvt-kvm create firsttest release=xenial
-
connect to the running VM
uvt-kvm ssh firsttest --insecure
https://help.ubuntu.com/lts/serverguide/virtualization.html
- qemu-kvm: directly using qemu-kvm gives you flexibility, but you need setup everything yourself.
- virt-manager: a gui-based tool, very intuitive to use, but you need GUI somewhere.
- ...