Debian VM/cloud optimized kernel
-
When running debian (as a guest) in a virtual environment, it's a good idea to install the debian cloud kernel.
It's an official kernel flavor optimized for a virtual environment and compiled without features you can't use in a VM.
That makes it:
- use less memory
- run faster (as it can skip certain code)
- boot faster
Debian is pretty lean as-is but with the cloud kernel, memory usage is getting into realm of the ridiculous.
Debian 11 minimal installation running under KVM with the standard kernel. Uses 70MB RAM which is great.
After upgrading to the cloud kernel.
Uses only 54MB RAM.
How to install
Run as root:
apt install linux-image-cloud-amd64 reboot
After reboot verify with:
uname -r
On debian 11 (bullseye) it should now say:
5.10.0-19-cloud-amd64This is the official cloud kernel so updates and everything will work as you'd expect.
If you are running debian on a public cloud, you are almost certainly using a cloud kernel already.
-
I don't know if ubuntu has a similar cloud kernel.
Update: It looks like there is a
linux-kvm
kernel amongst others. Haven't tried it though.BTW, in Debian/Ubuntu and other distros the different kernels are often referred to as kernel flavors. Good to know if you want to search for them.