"Best" kernel / parameters for Linux guests?

n0x0n

Member
Jan 20, 2022
35
3
13
Hi all, I put "best" in quotation marks, because that obviously varies per usecase, but perhaps you can help me gain some insights. My storage is ZFS, cluster nodes are old-ish SFF desktop machines and I don't use any passthrough, in case that's relevant. Guest doesn't use X / Wayland, is i440fx and uses VirtIO SCSI single as a controller.
  • Is there a kernel that's best suited for VMs, or do you all use the distro bog standard kernel in your VMs? Most everything comes as a loadable module today, so I guess there's nothing to be optimized thinking of RAM
  • Any Kernel parameters you set in your guest VMs - and why?
Thank you in advance
 
  • Is there a kernel that's best suited for VMs, or do you all use the distro bog standard kernel in your VMs? Most everything comes as a loadable module today, so I guess there's nothing to be optimized thinking of RAM
I once tried a KVM-specific kernel that comes with Ubuntu but that did not go well, but I can't remember the details but I guess it assumed some specific VM configuration different from Proxmox.

  • Any Kernel parameters you set in your guest VMs - and why?
console=ttyS0 (combined with GRUB_TERMINAL=serial) to make sure my Linux VMs use the virtual serial console (serial0: socket with vga: serial0 in the VM configuration), when they don't need graphics.

PS: For Q35 VMs, I also use pci_stub,ids=8086:293e to hide the non-functional (virtual) audio device that comes with the Q35 chipset to not confuse audio software.

EDIT: If your Linux VMs don't need graphics, maybe running them in a container is more efficient?
 
Last edited:
Is there a kernel that's best suited for VMs,
For my Ubuntu VMs I use
Code:
apt show linux-virtual ; apt show linux-image-virtual 

Description: Minimal Generic Linux kernel and headers
 This package will always depend on linux-image-virtual and
 linux-headers-virtual.

Package: linux-image-virtual

Description: Virtual Linux kernel image
 This package will always depend on the latest minimal generic kernel image
 used for virtual instances.

This way I do get rid of the "normal" kernels. Works fine for me.

For Debian there is:
Code:
apt show linux-image-cloud-amd64

Description: Linux for x86-64 cloud (meta-package)
 This package depends on the latest Linux kernel and modules for use on
 cloud platforms including Amazon EC2, Microsoft Azure, and Google Compute
 Engine.