Go to Virtualbox official website and download the virtualbox debian package file.
Change the virtualbox package file permissions:
sudo chmod 755 virtualbox-7.0_7.0.8-156879~Ubuntu~jammy_amd64.deb
Open terminal and use apt
command to install the virtualbox package file with its dependencies.
sudo apt install ./virtualbox-7.0_7.0.8-156879~Ubuntu~jammy_amd64.deb
It will prompt you to create a new MOK, and will guide you through the steps to enroll that key in your system's firmware. This process requires a reboot.
Select Ok and press enter.
Enter a password for secure boot and remember the password since it will be asked again after a reboot. Then select Ok and press enter.
Enter the same password again. Then select Ok and press enter.
At the end of the installation process, apt
displays an error due to installing a downloaded package. You can ignore this error message.
N: Download is performed unsandboxed as root, as file '/home/codingemperor/Downloads/virtualbox-7.0_7.0.8-156879~Ubuntu~jammy_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
Now reboot the machine, and you will see the blue screen as below.
Press any key as suggested, and we will see the next screen. Select Enroll MOK and press enter.
Select View Key 0 to view the key the and press enter
Press any key to close. Then select Continue and press enter.
Select Yes and press enter.
Enter the password which we entered before and press enter.
Select Reboot and press enter.
After your Ubuntu is rebooted completely, you can launch virtualBox to start using virtual machines on your system.