Checklist
Pre-installation Checklist
Before diving into the installation, let’s go through a pre-installation checklist to ensure your system is ready:
-
Verify that your CPU supports hardware virtualization. For KVM to run, a processor that supports hardware virtualization is needed. Both Intel and AMD have developed such extensions for their processors: Intel VT-x (code name Vanderpool) and AMD-V (code name Pacifica), respectively. To check if your processor supports one of these, you can execute the following commands:
For an Intel CPU:
egrep -c '(vmx|svm)' /proc/cpuinfo
For an AMD CPU:
grep --color svm /proc/cpuinfo
Alternatively, you can use the following command for a more detailed output:
egrep -wo 'vmx|lm|aes' /proc/cpuinfo | sort | uniq\ | sed -e 's/aes/Hardware encryption=Yes (&)/g' \ -e 's/lm/64 bit cpu=Yes (&)/g' -e 's/vmx/Intel hardware virtualization=Yes (&)/g'
The output should look something like this:
- Hardware encryption=Yes (aes)
- 64 bit cpu=Yes (lm)
- Intel hardware virtualization=Yes (vmx)
-
Ensure that virtualization support is enabled in your system’s BIOS.
By following these steps, you can prepare your system for KVM Libvirt installation.
Alternatively, you can use the ‘cpu-checker’ package to verify your CPU’s compatibility. Here’s how to install it and check:
- Install the package with the following command:
apt install cpu-checker
- Then, execute the following command:
kvm-ok
This should produce an output similar to the one below, confirming that your system can utilize KVM acceleration:
INFO: /dev/kvm exists
KVM acceleration can be used
Before installing KVM Libvirt, you should update your system, set up your environment, and make some necessary configuration changes. Here are the steps:
System Update and Upgrade
First, update and upgrade your system packages with the following command:
apt update && apt upgrade -y
Remove Needrestart
For Ubuntu 22.04 LTS, remove the ’needrestart’ package:
apt -y remove needrestart
Set UTF-8 Locale
Ensure your system is using the UTF-8 locale:
dpkg-reconfigure locales
Set Hostname
Specify your system’s hostname, replacing “{ID}” with your unique identifier:
hostnamectl set-hostname {ID}.cloudresource.io
Set Time Zone
Adjust the system time zone to your preferred setting. For instance, to set it to Europe/Riga:
timedatectl set-timezone Europe/Riga
Configure Systemd Journal Logs
Rotate and manage journal logs using these commands:
journalctl --rotate
journalctl --vacuum-time=2days
journalctl --vacuum-size=10M
journalctl --vacuum-files=5
Update the Systemd configuration to limit journal storage:
sed -i 's/#SystemMaxUse=/SystemMaxUse=10M/' /etc/systemd/journald.conf
Lastly, reload the Systemd daemon for the changes to take effect:
systemctl daemon-reload