14

Yesterday, I tried to upgrade my version of Ubuntu from 17.10* to 18.04 LTS. The update has been achieved correctly except for some elements.

One of these elements is the installation of Nvidia drivers with secure boot.

I tried several things to install nvidia drivers (version 396) with secure boot but it seems that it is not working at the moment...

Finally, I found a workaround: I disabled secure boot. But this is just a trick to solve the problem of the nvidia driver installation...

So I want to know if it is possible to have nvidia drivers working with secure boot.

The procedure that I used when secure boot is activated (Which does not work):

Commands used for the installation:

sudo apt update
sudo apt upgrade
sudo ubuntu-drivers autoinstall

During the installation process when secure boot is enabled the installation phase is stuck with MOK private key. a trick to overcome that is explained in this thread.

But for me, the solution does not work. So I need to interrupt the script and run the update & software application. After a while, a dialogue box appears asking me a password for MOK key.

So I complete the dialogue box and reboot the PC but when secure boot is enabled, the x server settings are still empty.

Thanks in advance for your answers.

5
  • Do you really think that disabling SB is needed only to INSTALL the drivers? The Nvidia proprietary module won't work with SB enabled.
    – Pilot6
    Jun 20, 2018 at 9:10
  • Just by disabling SB it is working so yes by simply disabling SB is working but without doing that it does not work. And what is the reason why Nvidia proprietary module does not work with SB ?
    – Loic L.
    Jun 20, 2018 at 9:17
  • 1
    The reason is that it is not signed. SB is useless BTW. Just disable it and forget. See also askubuntu.com/questions/762254/…
    – Pilot6
    Jun 20, 2018 at 9:36
  • thanks for your answer :). Well normally, as you said in the post that your linked. Mok utils should overcome the problem of SB. And I think that the installation tried to achieve when you run ubuntu-drivers autoinstall but in my case it does not work. But never mind, I have the nvidia driver installed so everything goes well.
    – Loic L.
    Jun 20, 2018 at 10:01
  • It is correct. ubuntu-drivers tries to disable SB, but it is much easier to disable it in BIOS. You can try to sign the driver, but it is not worth the effort IMHO.
    – Pilot6
    Jun 20, 2018 at 14:18

2 Answers 2

20

My steps to make it work with secure boot were as follows:

When I was installing Ubuntu 18.04.1, when I reached the "updates and other software stage" in the installation, there was an option to set a password for secure boot, so I went ahead and enabled the check box and entered a new password for secure boot.

Later on after the installation, when I wanted to install Nvidia drivers, I did the following:

Standard Ubuntu procedure:

sudo apt-get update
sudo apt-get upgrade
  1. Add the Official Nvidia PPA to Ubuntu

    sudo add-apt-repository ppa:graphics-drivers/ppa
    
  2. Update and upgrade again

    sudo apt-get update
    sudo apt-get upgrade
    
  3. I checked which was the recommended driver for my GPU via the command:

    ubuntu-drivers devices
    
  4. I opened "Software & Updates" and clicked the "Additional Drivers" tab, I then chose the recommended driver and clicked "Apply Changes", while the driver was installing somewhere in the middle it prompted me for secure boot password, that it when I entered the password I set up when I was installing Ubuntu, after it finished applying I restarted my device, when it was rebooting a blue menu appeared asking to press any key, I pressed then a menu labeled as "Perform MOK Management" appeared, there were the following four options:

    1. Continue boot
    2. Enroll Key
    3. Enroll Key from Disk
    4. Enroll Key from Hash

I chose option number 2, then I continued to boot, it finally worked, I went to Ubuntu settings->Details and my Graphic Card name was shown correctly.

2
  • After choosing Enroll Key there's no option to input such a key, but there's an option to view. Does it mean enrolling is done automatically?
    – fikr4n
    Jun 4, 2021 at 0:01
  • After enrolling, my keyboard and mouse have stopped working Oct 4, 2021 at 13:11
2

Been battling this a little bit recently, and the other answer is valid, but there is a simpler solution that probably works:

sudo apt install linux-headers-generic
sudo apt reinstall nvidia-dkms-495

(replace 495 with which ever driver version you are using)

Secureboot compatible drivers are built by DKMS, but the driver packages don't have a kernel header dependency, but they require them to build the kernel modules.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .