Displaying boot logs in the KVM

View as Markdown

Find out how to diagnose a VPS by checking the boot log

Objective

If your VPS has become unresponsive, you still have the possibility to access it from your Control Panel via KVM. The quickest way to diagnose the problem is to check the boot log of the server. However, the GRUB configuration needs to be modified in order for these logs to appear.

Info

Please note that for some environments, the KVM is unable to provide any useful information because the boot sequence occurs in the serial console, or GRUB is configured in silent mode.

This guide explains how to activate boot logs that can help with troubleshooting a VPS.

Information regarding OVHcloud service administration and how to find appropriate assistance

When using OVHcloud guides, please be aware of the following conditions:

  • User instructions aim to provide as many details as possible but cannot cover individual use cases. You might need to adapt the pertinent actions to your requirements.
  • The OVHcloud ecosystem is built for flexibility and freedom of choice. Customers are therefore responsible for the secure and proper configuration of their services. To prevent data loss, we strongly recommend to apply backup strategies to all your important data.
  • Our guides and tutorials may reference third-party software or services in combination with OVHcloud solutions. The technical support provided by OVHcloud does not include the configuration of systems or products outside of our responsibility. This includes but is not limited to:
    • Operating systems and user interfaces (Windows, Debian, Plesk, etc.).
    • Any other third-party software (FTP clients, email software, etc.).
    • Services offered by other providers (DNS, APIs, user interfaces, etc.).

To receive the appropriate assistance for any issues you might experience, follow these guidelines:

  • You seek personalized advice or you would like to discuss a topic that is not covered in detail by our documentation?
    Join the OVHcloud Community to search for your topic and reach out to other users.
  • You need to report an incident regarding your OVHcloud service or you are experiencing difficulties in the OVHcloud Control Panel?
    Create a support request in our Help Centre.
  • You require professional assistance for your project or you need help with tasks outside our support scope?
    Visit our partner portal to search for experts who are familiar with OVHcloud solutions.
  • You are looking for more detailed information regarding our support levels and Professional Services?
    Please visit our web pages for OVHcloud support levels and OVHcloud Professional Services.

You can participate in improving our documentation:

  • You would like to share feedback to improve a guide page or you want to report insufficient information on a specific page?
    Use the "Was this page helpful?" buttons at the bottom of the page to let us know.
  • You would like to propose a specific documentation update?
    Use the "Edit this page" function, available at the bottom of the page and in the sidebar.

Requirements

  • A VPS in your OVHcloud account

OVHcloud Control Panel Access

  • Direct link:
  • Navigation path: Bare Metal Cloud > Virtual private servers > Select your VPS

Instructions

Warning

These modifications will change the GRUB configuration. OVHcloud cannot be held responsible for any loss or damage to your data caused by these operations. Be sure to perform backups of all your important data before any modifications.

If you still have access to your VPS via SSH, you can skip to step 6.

Step 1: Restart the VPS into rescue mode

Initiate a server reboot in rescue mode from the Control Panel. Refer to our rescue mode guide if necessary.

Step 2: Perform initial verification

On older VPS ranges, your partitions will be automatically mounted in rescue mode. You can use the following commands to verify this and identify where your partition is mounted:

df -h

~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            5.8G     0  5.8G   0% /dev
tmpfs           1.2G   17M  1.2G   2% /run
/dev/sda1       2.4G  1.5G  788M  66% /
tmpfs           5.8G     0  5.8G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           5.8G     0  5.8G   0% /sys/fs/cgroup
/dev/sdb1        49G  1.2G   48G   3% /mnt/sdb1
/dev/sdb15      105M  3.6M  101M   4% /mnt/sdb15

lsblk

~$ lsblk
NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda       8:0    0  2.5G  0 disk
└─sda1    8:1    0  2.5G  0 part /
sdb       8:16   0   50G  0 disk
├─sdb1    8:17   0 49.9G  0 part /mnt/sdb1
├─sdb14   8:30   0    4M  0 part
└─sdb15   8:31   0  106M  0 part /mnt/sdb15

The example output above shows that the system partition is mounted on /mnt/sdb1. (The primary disk is sdb, whereas sda is the rescue disk and sda1 is the primary rescue partition mounted on /).

If your VPS is of the current ranges, no automatic mounting will occur and the MOUNTPOINT column should be empty. In that case, proceed with step 4.

Step 3: Unmount the partition (older ranges only)

On a legacy VPS in rescue mode, the primary disk is already mounted. Therefore, it first needs to be unmounted before remounting it in step 4:

~$ umount /dev/sdb1

Step 4: Mount the partition with the correct settings

If your VPS is of the current ranges, first make sure the mount folder is created:

~$ mkdir -p /mnt/sdb1

Enter the following commands to mount the partition with the appropriate settings:

~$ mount /dev/sdb1 /mnt/sdb1
~$ mount -t proc none /mnt/sdb1/proc
~$ mount -o bind /dev /mnt/sdb1/dev
~$ mount -t sysfs none /mnt/sdb1/sys/

The system partition is now mounted for use with the chroot command, in order to carry out actions that require access to the sys, dev and proc directories.

Step 5: Use the CHROOT command to configure your system files

You now need to access and edit the GRUB files of your system. You can do this by using the chroot command:

~$ chroot /mnt/sdb1

From now on, all commands that you enter will be applied to your VPS instead of the temporary rescue mode environment.

Step 6: Modify the GRUB configuration

For Debian 8 or higher and Ubuntu 18 or higher

Create a backup copy of the config file:

~$ cp /etc/default/grub /root/grub.backup

In order to access the boot log with the KVM console, make sure you have the following value inside the file /etc/default/grub:

GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0 console=tty0"

If this line is missing or different, modify the file with an editor and save it.

Then use the following command to regenerate the GRUB configuration file (the changes will be saved for the next reboot):

~$ update-grub

For CentOS 7 or higher (grub2)

Create a backup copy of the config file:

~$ cp /etc/default/grub /root/grub.backup

In order to access the boot log with the KVM console, make sure you have the following values inside the file /etc/default/grub:

GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto rhgb"
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0"

If these lines are missing or different, modify the file with an editor and save it.

Then use the following command to regenerate the GRUB configuration file (the values will be saved for the next reboot):

~$ grub2-mkconfig -o "$(readlink /etc/grub.cfg)"

Once you have done the modifications, reboot your VPS in 'normal' mode in your . Boot log information should now appear when using the KVM console.

Go further

Using the KVM for a VPS

Activating rescue mode on a VPS

Join our community of users.

Was this page helpful?