Run a Distribution-Supplied Kernel
Updated by Linode
Your Linode runs on KVM, and is capable of using your choice of Linode’s own kernel, or the upstream kernel provided by a Linux distribution’s maintainers. Booting with Linode’s kernel is enabled by default, with exception to CoreOS Container Linux, Fedora, and Ubuntu 17.10+ which boot their upstream kernels by default.
The steps in this section currently apply only to the distributions under Recommended in the Linode Manager’s Deploy an Image dropdown.
Shut down your Linode from the Linode Manager.
Click Edit to view a distribution’s configuration profile options:
Under Boot Settings is a Kernel dropdown menu. By default, this will be set to the latest Linode-supplied 64 bit kernel:
To switch to the distro’s default kernel, select GRUB 2 instead of the latest 64 bit.
Click Save Changes at the bottom of the page and reboot into the new kernel.
Once booted, you can verify the kernel information with
[root@archlinux ~]# uname -r 4.11.7-1-ARCH
If you want to switch back to the Linode kernel at any time:
- Shut down your Linode.
- Select the latest 64 bit Linode kernel using the steps above.
- Click Save Changes and reboot.
CentOS 7 and Fedora ship with SELinux installed and running in permissive mode. When switching from the Linode kernel to the CentOS or Fedora kernel, SELinux may need to run a relabeling of the filesystem to boot. When completed, the Linode will reboot and if you have Lassie enabled, you’ll be back at the login prompt shortly. If you do not have Lassie enabled, you will need to manually click Reboot in the Linode Manager.
The relabel process is triggered by the empty
1 2 3
[root@li901-254 ~]# ls -a / . .autorelabel boot etc lib lost+found mnt proc run srv tmp var .. bin dev home lib64 media opt root sbin sys usr
If your system is unable to GRUB2 boot and instead shows you a Grub command line prompt in Lish like shown below, then you need to install the kernel and configure Grub. This should only be necessary on Linodes which were created before February 2017.
Install the Kernel
Ensure that your system is up to date using the distribution’s package manager.
Install the Linux kernel and Grub. During installation, you may be asked which disk image to install to. Since Linode provides the grub bootloader, your system need only provide the
grub.cfgfile. You also don’t need to install
grubto your MBR.
pacman -S linux grub
yum install kernel grub2
apt-get install linux-image-amd64 grub2
There are two main ways to install Gentoo’s kernel: Manual configuration and using the
genkerneltool. Which you use and how you configure the kernel will depend on your preferences, so see the Gentoo Handbook for instructions.
apt install linux-image grub2
When the installation finishes, you’ll then see the kernel and other components in the
/boot directory. For example:
[root@archlinux ~]# ls /boot grub initramfs-linux-fallback.img initramfs-linux.img vmlinuz-linux
/etc/default/grubin a text editor and go to the line beginning with
GRUB_CMDLINE_LINUX. Remove the word
quietif present, and add
console=ttyS0,19200n8 net.ifnames=0. Leave the other entries in the line. For example, on CentOS 7 you should have something similar to:
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb console=ttyS0,19200n8 net.ifnames=0"
Then add or change the following options to match the following example. There will be other variables in this file, but we are only concerned with these lines.
1 2 3 4 5
GRUB_TERMINAL=serial GRUB_DISABLE_OS_PROBER=true GRUB_SERIAL_COMMAND="serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1" GRUB_DISABLE_LINUX_UUID=true GRUB_GFXPAYLOAD_LINUX=text
Run the following command to prepare and update the bootloader:
Arch and Gentoo
grub-mkconfig -o /boot/grub/grub.cfg
The .autorelabel file is necessary to queue the SELinux filesystem relabeling process when rebooting from the Linode kernel to the CentOS kernel.
1 2 3 4
mkdir /boot/grub ln -s /boot/grub2/grub.cfg /boot/grub/grub.cfg grub2-mkconfig -o /boot/grub/grub.cfg touch /.autorelabel
Debian and Ubuntu
This guide is published under a CC BY-ND 4.0 license.