Linux VPS

Change Linux kernel boot parameters in GRUB on a VPS

View and change Linux kernel command-line parameters on a VPS or VM: edit /etc/default/grub, regenerate the config on Debian or RHEL, use grubby, test temporary changes and recover safely.

IntermediateLinux VPS and VMs2 min read

Some tuning and troubleshooting needs kernel boot parameters: a serial console, IOMMU for passthrough, disabling a driver, or setting a cgroup mode. This guide shows how to safely change kernel boot parameters in GRUB on a KVM VPS or VM.

Before you start

  • Root access and a working console (VNC or serial) in case the system fails to boot; see serial console.
  • A snapshot or backup.
  • Containers (OpenVZ/LXC) share the host kernel, so these steps do not apply there.

See current parameters

cat /proc/cmdline

Test a change temporarily

  1. Reboot and, at the GRUB menu (hold Shift or press Esc on many systems), select the entry and press e.
  2. Append the parameter to the line starting with linux.
  3. Press Ctrl+X or F10 to boot. The change lasts only for this boot.

Make it permanent on Debian/Ubuntu

Edit /etc/default/grub and add to GRUB_CMDLINE_LINUX_DEFAULT or GRUB_CMDLINE_LINUX:

GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"

Apply:

sudo update-grub

Some cloud images also have files in /etc/default/grub.d/ that override settings; check them.

Make it permanent on AlmaLinux/Rocky

Use grubby, which updates all kernel entries:

sudo grubby --update-kernel=ALL --args="console=ttyS0,115200n8"

Remove a parameter with --remove-args. Check with sudo grubby --info=DEFAULT.

Common parameters

ParameterPurpose
console=ttyS0,115200n8Serial console output
intel_iommu=on iommu=ptIOMMU for passthrough on hosts; see PCI passthrough
systemd.unit=rescue.targetBoot into rescue mode (temporary use)
net.ifnames=0Use classic eth0 interface names
mitigations=autoCPU vulnerability mitigations (default); avoid disabling on shared hosts

Reboot and verify

sudo reboot

After boot, check cat /proc/cmdline again.

Troubleshooting

  • Change not applied: config not regenerated, or the system boots via a different bootloader or EFI path.
  • System will not boot: edit the entry at the GRUB menu to remove the parameter, boot, then fix the file. Or use rescue mode.
  • Interfaces renamed after net.ifnames change: update network configuration before rebooting.

Frequently asked questions

Can I change kernel parameters on any VPS?

On KVM VPSs yes; on container-based VPSs no.

Should I disable CPU mitigations for speed?

Not on shared or internet-facing servers; the security risk outweighs the small gain.

What about sysctl?

Runtime kernel tunables go in /etc/sysctl.d/; boot parameters are for settings needed at startup.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.