Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that Ubuntu freezes during startup

2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to solve the problem of Ubuntu freezing at startup". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Solve the freeze problem caused by NVIDIA driver in Ubuntu startup

The solution I introduce is suitable for systems with NVIDIA graphics cards, because the system freeze you are facing is caused by the open source NVIDIA Nouveau driver.

It's not too late. Let's take a look at how to solve this problem right away.

Step 1: edit Grub

During the process of starting the system, please stop on the Grub interface shown in the figure below. If you don't see this interface, hold down the Shift key when you start the computer.

On this interface, press E to enter edit mode.

Press the "E" button

You should see some of the code shown in the following figure. You should focus on the line that starts with "linux" at the moment.

Go to the line at the beginning of Linux

Step 2: temporarily modify Linux kernel parameters in Grub

Recall that our problem was with the NVIDIA graphics driver, which was caused by the misadaptation of the open source NVIDIA driver. So all we can do here is disable these drivers.

At the moment, you have a variety of ways to disable these drivers. My favorite way is to disable the drivers of all graphics cards through nomodeset.

Add the following text to the end of the line that begins with "linux". You should be able to type normally here. Please make sure that you add this text to the end of the line.

Nomodeset

The display on your screen should now look like this:

Disable the video card driver by adding nomodeset to the kernel

Press Ctrl+X or F10 to save and exit. Next time you will boot with the modified kernel parameters.

An explanation of the above operation

So what exactly did we do? What is that nomodeset? Let me explain it to you briefly.

Generally speaking, the graphics card is not enabled until the X or other display server starts to execute, that is, after you log in to the system and see the graphical interface.

Recently, however, the video mode setting has been moved into the kernel. One of the many advantages of doing this is that you can see a beautiful and high-definition startup screen.

If you add the nomodeset parameter to the kernel, it instructs the kernel to load the video driver only after the display service starts.

In other words, you disable the loading of video drivers at this time, and the resulting conflicts will disappear. After you log in to the system, you can still see everything as usual, because the video card driver is loaded in the following process.

Step 3: update your system and install NVIDIA proprietary drivers

Don't cheer up too early just because you can log on to the system now. What you have done before is only a temporary measure, and your system will still try to load the Nouveau driver the next time you boot and therefore freeze.

Does this mean that you will have to constantly edit the kernel on the Grub interface? Congratulations, the answer is no.

You can install additional drivers for NVIDIA graphics cards on Ubuntu. After using a proprietary driver, Ubuntu will not freeze during startup.

I assume this is the first time you have logged in to a newly installed system. This means that you have to update Ubuntu before doing anything else. Open a terminal with the Ctrl+Alt+T system shortcut of Ubuntu and enter the following command:

Sudo apt update & & sudo apt upgrade-y

After the above command is executed, you can try to install additional drivers. But in my experience, you need to restart your system before installing a new driver. When you restart, you still need to modify the kernel parameters as we did before.

When your system has been updated and restarted, press the Windows key to open a menu bar and search for "Software and updates Software & Updates".

Click "Software & Updates"

Then switch to the extra driver Additional Drivers tab and wait a few seconds. Then you can see the proprietary drivers available for the system. You should be able to find NVIDIA on this list.

Select the proprietary driver and click "apply change Apply Changes".

NVIDIA driver installation

The installation fee for the new driver takes some time. If your system is enabled with UEFI secure boot, you will be asked to set a password. You can set it to any password that is easy to remember. Its usefulness will be explained in step 4.

You may need to set a secure startup password

After the installation is complete, you will be asked to restart the system for the previous changes to take effect.

Restart your system after the new driver is installed

Step 4: process MOK (only for devices with UEFI secure startup enabled)

If you have been asked to set a security startup password, you will now see a blue screen with "MOK management" on it. It's a complicated concept. I'll try to make a long story short.

The requirement for MOK (device owner password) is because the secure startup feature requires all kernel modules to be signed. All kernel modules distributed with the ISO image in Ubuntu have been signed. Because you have installed a new module (that is, the extra driver), or because you have made changes to the kernel module, your security system may regard it as an unverified external modification and refuse to boot.

So, you can sign the system module yourself (to tell the UEFI system not to make a fuss that you made these changes), or you can simply and rudely disable secure startup.

Now that you know something about secure startup and MOK, let's take a look at what to do with this blue interface.

If you choose "continue to start", there is a good chance that your system will start as usual, and you don't have to do anything. In this case, however, some of the features of the new driver may not work properly.

This is why you should "choose to sign up for MOK".

It will ask you to click "continue" on the next page, and then ask you to enter a password. Please enter the password you set when you installed the extra driver in the previous step.

Don't worry!

If you miss the blue screen on MOK, or accidentally click "continue to start" instead of "sign up for MOK", don't panic. Your main goal is to be able to boot the system successfully, and you have successfully achieved this by disabling the Nouveau graphics card driver.

The worst-case scenario is that your system switches to an Intel integrated graphics card instead of using a NVIDIA video card. You can install the NVIDIA graphics card driver at any time after that. Your first task is to activate the system.

Step 5: enjoy a Linux system with proprietary NVIDIA drivers installed

When the new driver is installed, you need to restart the system again. Don't worry! Things should be better now, and instead of having to modify kernel parameters, you can start the Ubuntu system directly.

This is the end of the content of "how to solve the problem that Ubuntu freezes when starting up". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report