This step-by-step guide demonstrates how to install exclusive NVIDIA drivers to fix Ubuntu freezing at boot. Although the instruction was carried out on a freshly installed Ubuntu system, it should work with other operating systems as well.
How to Fix Ubuntu Freezing
- Editing Grub
- Temporarily Modifying Linux kernel parameters in Grub
- Make permanent changes in Grub
- Enjoy Ubuntu Linux
- Simply halt at the Grub screen, which looks like the one below, when your computer boots.
- Hold the Shift key down while the computer boots if you don’t see this screen.
- Press the “E” key to enter editing mode on this screen.
- You ought to see a code similar to the one below.
- Concentrate on the line that begins with Linux.
Temporarily Modifying Linux kernel parameters in Grub
Remember that the NVIDIA Graphics drivers are the source of our issue. We can solve this problem by disabling the open-source NVIDIA drivers that were incompatible with the problem.
You can now try several methods to disable these drivers. My preferred method is to use nomodeset to disable every video/graphics card.
Simply insert the following text after the line that begins with Linux. Normal typing should be possible for you. To add it, just be sure to do so at the end of the line.
- Ctrl+X or F10 can be used to save and exit. The freshly updated kernel parameters will now be used when you boot.
Normally, the video/graphics card was utilized upon the launch of the X or other display servers. In other words, you see a graphical user interface after logging in to your machine.
But recently, the kernel received control over the video mode settings. It gives you the option to have a stunning, high-quality boot splash screen, among other advantages.
When the nomodeset kernel parameter is added, the kernel is told to load the video/graphics drivers after the display server has been launched.
In other words, you stopped the graphics driver from loading at this point, which resolved the dispute. As soon as you log in, the graphics card is loaded once more, so you can see everything.
Troubleshoot: Cannot boot even after using nomodeset?
If the nomodeset in the grub didn’t work and your computer still won’t boot, try some alternative settings.
The same procedures as those outlined above. Replace nomodeset with nouveau.noaccel=1 while editing grub. See if you can now boot after you save and exit grub.
If even that is unsuccessful, try substituting silent splash for noapic noacpi nosplash irqpoll in the grub.
Make permanent changes in Grub (if you can boot and there is no issue with graphics)
Poor-looking resolution may occasionally be the result of not utilizing the graphics driver at all or switching to the open-source driver. Try switching to a proprietary driver if that applies to you.
Just because you can finally log in to your system doesn’t mean you should be overjoyed just yet. What you did was only a temporary fix, and the next time your computer boots up, it will still attempt to load the graphics drivers and freeze.
Does this imply that editing Kernel will always be required from the grub screen? Fortunately, the response is no.
The grub settings can be changed in this location to prevent the Linux kernel from attempting to load the graphics driver before the display server.
- To do that, launch the terminal by pressing the Ctrl+Alt+T shortcut, and then enter the command below to launch the Gedit editor and open the grub configuration file:
- sudo gedit /etc/default/grub
For this file to open, you must enter your password. Look for the line that reads: GRUB CMDLINE LINUX DEFAULT=” quiet splash” once the text file has been opened.
This line should be changed to GRUB CMDLINE LINUX DEFAULT=
Silent Splash No Mode Set
For the modifications to take effect, save the file and update the grub. the following command:
- sudo update-grub
When it’s finished, restart your computer, and the freezing should be gone.
You can boot but the graphics look weird. Update your system and install proprietary graphics drivers
Alternatively, you can install extra NVIDIA and AMD drivers in Ubuntu if you don’t want to adjust the Grub configuration as described in the previous step. When these proprietary drivers are used, Ubuntu won’t crash on boot.
Proprietary driver installation is simple with Ubuntu and many other versions. In the Ubuntu menu, type “Additional Drivers” to find it. Additional graphics drivers for your system may be found in this section.
- Access a newly installed system for the first time.
- This means that before doing anything else, you must update Ubuntu.
- Using the Ubuntu keyboard shortcut Ctrl+Alt+T, open a terminal and type the following command:
- sudo apt update && sudo apt upgrade -y
After running the aforementioned command, you can attempt installing more drivers in Ubuntu, but in my experience, you’ll need to restart your computer before the new drivers will properly install. Additionally, you will need to modify the kernel setting once more in the same manner as before when you restart.
- After updating and restarting your system, use the Windows key to open the menu and look for Software & Updates.
- Go to the Additional Drivers tab right away, then wait a moment.
- You can see the proprietary drivers that are available for your system here.
- NVIDIA need should appear on this list.
- Select the exclusive driver, then click “Apply Changes.”
The installation of the new drivers will take some time. You will also be prompted to choose a password if your machine has UEFI secure boot enabled.
You’ll be prompted to restart the system to apply changes after the installation is complete.
Dealing with MOK (only for UEFI Secure Boot-enabled devices)
A blue screen with text regarding “MOK management” will appear if you were prompted to set up a secure boot password.
Because of the secure boot functionality, which mandates that all kernel modules be signed, MOK (Machine Owner Key) is required.
This is true of every kernel module that Ubuntu includes in the ISO. Your security system can view the new module (the additional driver) or modification in the kernel modules as an unauthorized/foreign change and prevent your system from booting.
To prevent your UEFI system from freaking out because you made these changes, you can either sign the kernel module on your own or just turn off the secure boot.
Now that you are familiar with secure boot and MOK, let’s discuss what to do if the blue screen appears during the subsequent boot.
The likelihood is that if you choose “Continue boot,” your system will boot normally and you won’t need to take any further action. However, not all of the new driver’s functions will probably function properly.
For this reason, you ought to select Enroll MOK.
The following screen will ask you to continue before requesting your password. Make use of the password that you put up while installing the extra drivers in the previous stage. Now, you’ll have to restart.
After the updated driver has been installed, you must restart your computer once more. Not to worry! Now that everything should be improved, you won’t need to change the kernel settings. You’ll immediately boot into Ubuntu.
Enjoy Ubuntu Linux
You were able to boot into your Ubuntu system after following this tutorial’s advice for fixing the issue of Ubuntu freezing during the boot process.
How do I stop Ubuntu 20.04 from freezing?
The restart key combination is Alt + SysRq + B.
Why is my Ubuntu frozen?
Linux freezing or hanging can be brought on by a variety of hardware or software-related problems. System resource depletion, program compatibility problems, hardware performance problems, slow networks, device/application settings, and lengthy unabruptible computations are a few of them.
- How to Fix Ubuntu Boot Problem
- Important Basic Linux Commands for Beginners
- How to Add and Remove Users on Ubuntu
How to fix Ubuntu freezing at boot by installing special NVIDIA drivers. When your computer boots to the Grub screen, which resembles the one below, just pause and press the “E” key to get into editing mode. If you don’t want to change the Grub settings as explained in the previous step, you can install additional NVIDIA and AMD drivers in Ubuntu. To find it, put “Additional Drivers” into the Ubuntu menu. This section may contain additional graphics drivers for your system.
If secure boot is enabled on your machine, you’ll be asked to enter a password. If you were required to create a secure boot password, a blue screen will show up.