tencent cloud

Cloud Virtual Machine

Release Notes and Announcements
Release Notes
Public Image Release Notes
Official End of Support Plan for the Operating System
Announcements
Product Introduction
CVM Overview
Strengths
Basic Concepts
Regions and Zones
Tutorial
Service Regions and Service Providers
Billing
Billing Overview
Billing Modes
Billing Items
Billing Mode Conversion Overview
Purchasing Instances
Configuration Adjustment Billing Guide
Overdue Payments
Getting Started
Purchasing a Customized Linux Instance
Purchasing a Customized Windows Instance
User Guide
Operation Guide Overview
Use Limits
Instances
Spot Instances
Reserved Instances
Images
Storage
Backup and Restoration
Network
Security
Passwords/Keys
Monitoring and Alarms
Ops Management
Convenience Features
Migrating a Server
Online Migration
Migration Consultation
Troubleshooting
CVM Login Failures
Windows Instance Login Failures
Linux Instance Login Failures
Other Login Failures
Instance Running Failures
Linux Instance Memory Failures
Network Failures
Use Cases
Suggestions on CVM Model Selection
Environment Building
Website Building
Application Building
Visual GUI Building
Uploading Local Files to CVM
Network Performance Test
Other Practical Tutorials
API Documentation
History
Introduction
API Category
Making API Requests
Region APIs
Instance APIs
Cloud Hosting Cluster APIs
Image APIs
Instance Launch Template APIs
Placement Group APIs
Key APIs
Security Group APIs
Network APIs
Data Types
Error Codes
Security and Compliance
CAM
Network
FAQs
Regions and Zones
Billing
Instances
Storage
Images
Server Migration
Network
Security
Operating Systems
Ops and Monitoring
CAM
NTP Service
Scenarios
Agreements
CVM Service Level Agreements
Red Hat Enterprise Linux Image Service Agreement
Public IP Service Level Agreement
Glossary
DocumentationCloud Virtual MachineUse CasesOther Practical TutorialsAdding Kernel Parameters via GRUB on Linux Instances

Adding Kernel Parameters via GRUB on Linux Instances

PDF
Focus Mode
Font Size
Last updated: 2025-11-25 11:27:45

Scenarios

This document describes how to add kernel parameters via Grand Unified Bootloader (GRUB) on Cloud Virtual Machine (CVM) instances of Tencent Cloud. If you are using GRUB and want to modify or add kernel parameters, you can edit the GRUB configuration file. The following part describes the method for adding kernel boot parameters to the GRUB configuration file for specific distributions.

Example Operating Systems

This document uses CentOS 7.9, Ubuntu 24.04, OpenCloudOS 9, TencentOS Server 3.X, and TencentOS Server 4.X as example operating systems of CVM instances.

Prerequisites

Linux CVM instances have been purchased. If you have not purchased any CVM instance, see Purchasing a Customized Linux Instance.

Operation Steps

OpenCloudOS 9, TencentOS Server 3.X, and TencentOS Server 4.X systems have introduced the mainstream BLSCFG feature of GRUB in the industry. The default configurations are written in a fixed form to the entry file corresponding to /boot/loader/entries/. Therefore, modifying the general configuration file /etc/default/grub does not affect the kernel parameters of specific versions. Currently, the grubby tool is needed to modify the corresponding kernel parameters.
Perform the following operations based on your operating system version.
1. Log in to a Linux instance as described in Connecting to a Linux Instance via OrcaTerm (Recommended).
2. Add kernel boot parameters.
CentOS 7.9
Ubuntu 24.04
OpenCloudOS 9
TencentOS Server 3.X/TencentOS Server 4.X
1. Run the following command to edit the file /etc/default/grub.
vim /etc/default/grub
2. Press i to switch to the edit mode, locate the line GRUB_CMDLINE_LINUX, and add kernel parameters in the format of "name=value" to the end of GRUB_CMDLINE_LINUX. For example, the kernel parameter to be added is systemd.debug-shell=1.



3. Press Esc, enter :wq, save the file, and return to the command line.
4. Run the following command to regenerate the kernel configurations.
grub2-mkconfig -o /boot/grub2/grub.cfg
5. Run the following command to restart the instance.
reboot
6. Run the following command to check whether the modification is successful.
cat /proc/cmdline
If the returned result includes the added parameter, the addition is successful.



1. Run the following command to edit the file /etc/default/grub.
vim /etc/default/grub
2. Press i to switch to the edit mode, locate the line GRUB_CMDLINE_LINUX_DEFAULT, and add kernel parameters in the format of "name=value" to the end of GRUB_CMDLINE_LINUX_DEFAULT. For example, the kernel parameter to be added is systemd.debug-shell=1.



3. Press Esc, enter :wq, save the file, and return to the command line.
4. Run the following command to regenerate the kernel configurations.
grub-mkconfig -o /boot/grub/grub.cfg
5. Run the following command to restart the instance.
reboot
6. Run the following command to check whether the modification is successful.
cat /proc/cmdline
If the returned result includes the added parameter, the addition is successful.



1. Run the following command to add a kernel parameter.
grubby --update-kernel=ALL --args="systemd.debug-shell=1"
2. Run the following command to verify whether the addition is successful.
grubby --info ALL
If the added parameter is included as shown in the following figure, it indicates that the addition is successful.



3. Run the following command to restart the instance.
reboot
4. Run the following command to check whether the modification is successful.
cat /proc/cmdline
If the returned result includes the added parameter, the addition is successful.



1. Run the following command to add a kernel parameter.
grubby --update-kernel=ALL --args="systemd.debug-shell=1"
2. Run the following command to verify whether the addition is successful.
grubby --info ALL
If the added parameter is included as shown in the following figure, it indicates that the addition is successful.



3. Run the following command to restart the instance.
reboot
4. Run the following command to check whether the modification is successful.
cat /proc/cmdline
If the returned result includes the added parameter, the addition is successful.




Disabling the BLSCFG Feature and Reading the Traditional Kernel Parameter Configuration File

If GRUB_ENABLE_BLSCFG=true is set in /etc/default/grub, the system uses the BLSCFG feature of GRUB. If you want to disable the BLSCFG feature and add parameters using the traditional kernel parameter configuration file, set GRUB_ENABLE_BLSCFG=false in /etc/default/grub.

Operation Steps

Note:
This method applies to recent RHEL distributions, such as TencentOS Server 3.1 and TencentOS Server 3.2.
This method uses the traditional GRUB approach similar to that in CentOS 7, which reads configuration parameters from /etc/default/grub by default.
TencentOS Server 3.X/TencentOS Server 4.X
1. Run the following command to open the /etc/default/grub file.
vim /etc/default/grub
2. Press i to switch to the edit mode, locate the line GRUB_CMDLINE_LINUX, and add kernel parameters in the format of "name=value" to the end of GRUB_CMDLINE_LINUX. For example, the kernel parameter to be added is systemd.debug-shell=1.



3. Press Esc, enter :wq, save the file, and return to the command line.
4. Run the following command to disable the BLSCFG feature.
sed -i "s/GRUB_ENABLE_BLSCFG=true/GRUB_ENABLE_BLSCFG=false/g" /etc/default/grub
5. Run the following command to regenerate the kernel configurations.
grub2-mkconfig -o /boot/grub2/grub.cfg
6. Run the following command to restart the instance.
reboot
7. Run the following command to check whether the modification is successful.
cat /proc/cmdline
If the returned result includes the added parameter, the addition is successful.





Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback