I want to use VM Import/Export to import a virtual machine (VM) image to Amazon Elastic Compute Cloud (Amazon EC2) or export an Amazon Machine Image (AMI). The image is from Red Hat Enterprise Linux (RHEL) 8, CentOS 8, or Oracle Linux 8. However, I receive the "ClientError: BLSC-style GRUB found, but unable to detect default kernel" error.
Short description
The "ClientError: BLSC-style GRUB found" error occurs if VM Import/Export can't detect the default kernel in your VM image.
To use VM Import/Export in Amazon EC2, you must set the GRUB_ENABLE_BLSCFG parameter in the /etc/default/grub file to false. By default, GRUB_ENABLE_BLSCFG is set to true. If the parameter is true, then GRUB2 uses blscfg files and entries from the /boot/loader file instead of menuentry entries from the grub.cfg file. As a result, you receive the "ClientError: BLSC-style GRUB found" error message.
The "ClientError: BLSC-style GRUB found" error also occurs if you use an unsupported kernel.
Resolution
Prerequisites: Confirm that you use supported operating system (OS) and kernel versions.
If you use a supported OS and kernel and still receive the "ClientError: BLSC-style GRUB found" error message, then complete the following steps:
-
Open the /etc/default/grub file with a text editor such as vi.
Example command:
sudo vi /etc/default/grub
-
Set the GRUB_ENABLE_BLSCFG parameter to false.
Example text:
GRUB_ENABLE_BLSCFG=false
-
Run the following command to rebuild the GRUB configuration file:
grub2-mkconfig -o /boot/grub2/grub.cfg
-
Test the VM to ensure that it still works on premises. Then, import the new VM image, or export the AMI.
-
(Optional) Set the parameter back to true after you import the new image or export the AMI.