To install KVM on an Ubuntu 16.04 LTS headless server, you can use the following steps:
sudo apt-get update sudo apt-get install qemu-kvm libvirt-bin bridge-utils virt-manager
This will install the KVM packages, including qemu-kvm for hardware acceleration, libvirt-bin for managing virtual machines, bridge-utils for setting up network bridges, and virt-manager for managing virtual machines graphically.
libvirtd group:sudo adduser $USER libvirtd
This will allow you to manage virtual machines without using sudo.
libvirtd service:sudo systemctl enable libvirtd sudo systemctl start libvirtd
virsh -c qemu:///system list
This will list the virtual machines on the system. If the installation was successful, this command should return an empty list.