17 hours ago
I am running Ubuntu 20.04 and recently did a dist-upgrade.
uname -r: 5.8.0-34-generic
I purged Virtualbox and associate files by:
sudo apt-get purge "^virtualbox-.*"
After trying to reinstall any software I get the following now:
>>$ sudo apt install --reinstall linux-headers-$(uname -r) Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded. 3 not fully installed or removed. Need to get 0 B/1,236 kB of archives. After this operation, 0 B of additional disk space will be used. (Reading database ... 328260 files and directories currently installed.) Preparing to unpack .../linux-headers-5.8.0-34-generic_5.8.0-34.37~20.04.2_amd64.deb ... Unpacking linux-headers-5.8.0-34-generic (5.8.0-34.37~20.04.2) over (5.8.0-34.37~20.04.2) ... Setting up linux-headers-5.8.0-34-generic (5.8.0-34.37~20.04.2) ... /etc/kernel/header_postinst.d/dkms: * dkms: running auto installation service for kernel 5.8.0-34-generic Kernel preparation unnecessary for this kernel. Skipping... Building module: cleaning build area... make -j8 KERNELRELEASE=5.8.0-34-generic -C /lib/modules/5.8.0-34-generic/build M=/var/lib/dkms/virtualbox/6.1.10/build...(bad exit status: 2) ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/virtualbox-dkms.0.crash' Error! Bad return status for module build on kernel: 5.8.0-34-generic (x86_64) Consult /var/lib/dkms/virtualbox/6.1.10/build/make.log for more information. ...done. Setting up virtualbox-dkms (6.1.10-dfsg-1~ubuntu1.20.04.1) ... Removing old virtualbox-6.1.10 DKMS files... ------------------------------ Deleting module version: 6.1.10 completely from the DKMS tree. ------------------------------ Done. Loading new virtualbox-6.1.10 DKMS files... Building for 5.8.0-34-generic Building initial module for 5.8.0-34-generic ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/virtualbox-dkms.0.crash' Error! Bad return status for module build on kernel: 5.8.0-34-generic (x86_64) Consult /var/lib/dkms/virtualbox/6.1.10/build/make.log for more information. dpkg: error processing package virtualbox-dkms (--configure): installed virtualbox-dkms package post-installation script subprocess returned error exit status 10 dpkg: dependency problems prevent configuration of virtualbox: virtualbox depends on virtualbox-dkms (>= 6.1.10-dfsg-1~ubuntu1.20.04.1) | virtualbox-source (>= 6.1.10-dfsg-1~ubuntu1.20.04.1) | virtualbox-modules; however: Package virtualbox-dkms is not configured yet. Package virtualbox-source is not installed. Package virtualbox-modules is not installed. Package virtualbox-dkms which provides virtualbox-modules is not configured yet. dpkg: error processing package virtualbox (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of virtualbox-qt: virtualbox-qt depends on virtualbox (= 6.1.10-dfsg-1~ubuntu1.20.04.1); however: Package virtualbox is not configured yet. dpkg: error processing package virtualbox-qt (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. No apport report written because the error message indicates its a followup err or from a previous failure. Errors were encountered while processing: virtualbox-dkms virtualbox virtualbox-qt E: Sub-process /usr/bin/dpkg returned an error code (1)
Running
sudo apt-get install -f
Does not fix the dependency problem. I still get the same output:
>>$ sudo apt-get install -f Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 3 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up virtualbox-dkms (6.1.10-dfsg-1~ubuntu1.20.04.1) ... Removing old virtualbox-6.1.10 DKMS files... ------------------------------ Deleting module version: 6.1.10 completely from the DKMS tree. ------------------------------ Done. Loading new virtualbox-6.1.10 DKMS files... Building for 5.8.0-34-generic Building initial module for 5.8.0-34-generic ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/virtualbox-dkms.0.crash' Error! Bad return status for module build on kernel: 5.8.0-34-generic (x86_64) Consult /var/lib/dkms/virtualbox/6.1.10/build/make.log for more information. dpkg: error processing package virtualbox-dkms (--configure): installed virtualbox-dkms package post-installation script subprocess returned error exit status 10 dpkg: dependency problems prevent configuration of virtualbox: virtualbox depends on virtualbox-dkms (>= 6.1.10-dfsg-1~ubuntu1.20.04.1) | virtualbox-source (>= 6.1.10-dfsg-1~ubuntu1.20.04.1) | virtualbox-modules; however: Package virtualbox-dkms is not configured yet. Package virtualbox-source is not installed. Package virtualbox-modules is not installed. Package virtualbox-dkms which provides virtualbox-modules is not configured yet. dpkg: error processing package virtualbox (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of virtualbox-qt: virtualbox-qt depends on virtualbox (= 6.1.10-dfsg-1~ubuntu1.20.04.1); however: Package virtualbox is not configured yet. dpkg: error processing package virtualbox-qt (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. No apport report written because the error message indicates its a followup error from a previous failure. Errors were encountered while processing: virtualbox-dkms virtualbox virtualbox-qt E: Sub-process /usr/bin/dpkg returned an error code (1)
Reconfiguring as below yields the same message:
sudo dpkg --configure -a
The crash report located at /var/crash/virtualbox-dkms.0.crash indicates the following:
ProblemType: Package DKMSBuildLog: DKMS make.log for virtualbox-6.1.10 for kernel 5.8.0-34-generic (x86_64) Thursday, January 07, 2021 AM09:37:43 HKT make: Entering directory '/usr/src/linux-headers-5.8.0-34-generic' CC [M] /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/linux/SUPDrv-linux.o CC [M] /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/SUPDrv.o CC [M] /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/SUPDrvGip.o CC [M] /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/SUPDrvSem.o CC [M] /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/SUPDrvTracer.o CC [M] /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/SUPLibAll.o CC [M] /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/r0drv/alloc-r0drv.o CC [M] /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/r0drv/initterm-r0drv.o CC [M] /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/r0drv/memobj-r0drv.o CC [M] /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/r0drv/mpnotification-r0drv.o CC [M] /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/r0drv/powernotification-r0drv.o CC [M] /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/r0drv/linux/assert-r0drv-linux.o In file included from ./include/asm-generic/percpu.h:7, from ./arch/x86/include/asm/percpu.h:556, from ./arch/x86/include/asm/preempt.h:6, from ./include/linux/preempt.h:78, from ./include/linux/spinlock.h:51, from /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/linux/../SUPDrvInternal.h:79, from /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/linux/SUPDrv-linux.c:32: /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/linux/SUPDrv-linux.c: In function âsupdrvOSChangeCR4â: /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/linux/SUPDrv-linux.c:760:38: error: âcpu_tlbstateâ undeclared (first use in this function); did you mean âcpuhp_stateâ? 760 | RTCCUINTREG uOld = this_cpu_read(cpu_tlbstate.cr4); | ^~~~~~~~~~~~ ./include/linux/percpu-defs.h:318:9: note: in definition of macro â__pcpu_size_call_returnâ 318 | typeof(variable) pscr_ret__; \ | ^~~~~~~~ /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/linux/SUPDrv-linux.c:760:24: note: in expansion of macro âthis_cpu_readâ 760 | RTCCUINTREG uOld = this_cpu_read(cpu_tlbstate.cr4); | ^~~~~~~~~~~~~ /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/linux/SUPDrv-linux.c:760:38: note: each undeclared identifier is reported only once for each function it appears in 760 | RTCCUINTREG uOld = this_cpu_read(cpu_tlbstate.cr4); | ^~~~~~~~~~~~ ./include/linux/percpu-defs.h:318:9: note: in definition of macro â__pcpu_size_call_returnâ 318 | typeof(variable) pscr_ret__; \ | ^~~~~~~~ /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/linux/SUPDrv-linux.c:760:24: note: in expansion of macro âthis_cpu_readâ 760 | RTCCUINTREG uOld = this_cpu_read(cpu_tlbstate.cr4); | ^~~~~~~~~~~~~ make[2]: *** [scripts/Makefile.build:288: /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/linux/SUPDrv-linux.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [scripts/Makefile.build:519: /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv] Error 2 make: *** [Makefile:1780: /var/lib/dkms/virtualbox/6.1.10/build] Error 2 make: Leaving directory '/usr/src/linux-headers-5.8.0-34-generic' DKMSKernelVersion: 5.8.0-34-generic Date: Thu Jan 7 09:37:46 2021 DuplicateSignature: dkms:virtualbox-dkms:6.1.10-dfsg-1~ubuntu1.20.04.1:/var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/linux/SUPDrv-linux.c:760:38: error: âcpu_tlbstateâ undeclared (first use in this function); did you mean âcpuhp_stateâ? Package: virtualbox-dkms 6.1.10-dfsg-1~ubuntu1.20.04.1 PackageVersion: 6.1.10-dfsg-1~ubuntu1.20.04.1 SourcePackage: virtualbox Title: virtualbox-dkms 6.1.10-dfsg-1~ubuntu1.20.04.1: virtualbox kernel module failed to build
Any help is appreciated.
After input from @Terrace and others, I tried installing from source. But I still get an error in installing virtualbox-dkms. After that, I uninstalled virtual-dkms directly:
sudo apt-get remove virtualbox-dkms
And then re-attempted the install
sudo dpkg -i virtualbox-6.1_6.1.16-140961~Ubuntu~eoan_amd64.deb ``` Wich succeeded. Thank you!
26 hours ago
Note: - This guide will become irrelevant in the near future when proposed migrates to release.
proposed
release
Bug
Pre-released updates (focal-proposed)
Software & Updates
Developer Options
Close
The information about available software is out-of-date
Reload
Software Updater
VirtualBox
Install Now
proposed updates
Bug virtualbox-dkms 6.1.10-dfsg-1~ubuntu1.20.04.1 fails to build with kernel 5.8 I followed @Terrance advice and installed 6.1.16 from the source. My previous VMs are all working.
Edit: Per @BeastOfCaerbannog request/suggestion.
*if GDebi is not installed > go to Software Store and install it *if Error: Conflicts with the installed package 'virtualbox-qt' > go to Software Store and Remove Virtualbox 6.1.10
cd Downloads
sudo apt install ./virtualbox-6.1_6.1.16-140961~Ubuntu~eoan_amd64.deb
or
sudo apt install ./v*
 thanks @Terrance
36 hours ago
Choose the latest working 5.4 kernel instead.
I have 20.04 and this worked for me:
sudo grub-reboot "1>4"
sudo reboot
Or just manually choose the 5.4 kernel at boot.
I guess this bug will be fixed for Ubuntus 5.8 kernel soon.
9 hours ago
6 hours ago
Virtualbox is directly installable from the ubuntu repositories, so there is no need to fiddle around with Virtualbox downloads, dkms etc. This is all taken care of by the ubuntu packages, including the dkms stuff WITH SECURE BOOT WORKING in case you have it activated and your MOK keys properly installed!!
You install it simply by sudo apt install virtualbox
sudo apt install virtualbox
On Ubuntu 20.04 you usually have kernel 5.4 and virtualbox comes there in version 6.1.10.
With Ubuntu 20.10 you have kernel 5.8 and virtualbox 6.1.14. Both work flawlessly on my machines.
Give it a try! ;-)
Hope that helps
5 hours ago
The 5.8.0 kernel seems to be buggy and is no longer part of the upgrade. If it is installed and things fail, it has to be removed.
5.8.0
I prefered to make it possible to select a kernel at boot. There are different paths for this but I chose to change the boot menu from hidden to menu and increase the timeout.
hidden
menu
$ sudo vi /etc/default/grub ... $ grep GRUB_TIMEOUT /etc/default/grub #GRUB_TIMEOUT_STYLE=hidden #GRUB_TIMEOUT=0 GRUB_TIMEOUT_STYLE=menu GRUB_TIMEOUT=10
Remember to update grub
sudo update-grub
A menu is now presented on boot, select "Advanced ..." and select an older kernel (5.4.0-60-generic in my case).
5.4.0-60-generic
After booting I had to update grub again for the menu setting to keep.
List installed kernel versions. APT warns that it is not "script friendly", i.e. output can vary, so use scripts with care.
# sudo apt list --installed 2>/dev/null | grep -o -E "^linux[^/]+5.8.0-[^/]+"
Remove linux-headers
# First remove linux-headers so that modprobe won't fail on virtualbox # I had to remove these versions, your list might differ. sudo apt remove linux-headers-5.8.0-34-generic sudo apt remove linux-headers-5.8.0-36-generic
Then remove remaining kernel packages
# NB! Handle with care. # Do this ONLY if you are comfortable, or prepare a list and run one by one. sudo apt remove $(sudo apt list --installed 2>/dev/null | grep -o -E "^linux[^/]+5.8.0-[^/]+")
Reboot, before starting to fix Nvidia drivers (if applicable to you).
After reverting the kernel my screen setup did not work - external monitors did not load. So I removed the Nvidia packages, booted, then installed them again.
sudo apt remove $(sudo apt list --installed 2>/dev/null | grep -o -E "^nvidia[^/]") # Remove packages now no longer needed sudo apt-get autoremove
Reboot - I did this to make absolutely sure of a clean system. You might be able to skip this.
Install Nvidia drivers again.
sudo apt install nvidia-driver-460
Rebooted, and now my external monitors came back to life.
sudo apt-get update sudo apt-get dist-upgrade sudo apt-get autoremove
My VirtualBox guests now started. I did not touch virtualbox at all during this process, only the kernel (and graphics driver).
Now would be the time to revert the Grub changes if you would rather skip the wait-for-menu, or bar this opportunity if your PC is in an office space where others have access physically.
33 hours ago
I managed to solve this by the following instruction
The first step is to remove all currently installed VirtualBox
sudo apt-get remove virtualbox sudo apt-get remove virtualbox-dkms # i have to remove manually
Download new version from page
Close all running VirtualBox instances
Install by running the following command :
sudo dpkg -i virtualbox-6.1_6.1.16-140961~Ubuntu~eoan_amd64.deb
When tried install with apt I got errors.
I personally couldn't get it running in 5.8.0 at all, so I decided to downgrade, and it's usually as easy as following @sastorsi answer, just selecting an older kernel at boot from the GRUB, but I went berserk trying to fix this and ended up with no older kernels. If you also happen to have no usable kernels, you can install the latest 5.4.0 with the following command:
sudo apt install linux-image-5.4.0-60-generic linux-headers-5.4.0-60 linux-headers-5.4.0-60-generic
And if you're having trouble with HDMI, WIFI, etc. you must install the kernel modules (I actually ended up reinstalling ubuntu because I didn't know this):
sudo apt install linux-modules-5.4.0-60-generic linux-modules-extra-5.4.0-60-generic
Then remove the buggy kernel:
sudo apt remove linux-image-5.8.0-36-generic && sudo apt autoremove
If it doesn't boot into the desired kernel automatically, you can either choose it at boot from the GRUB, or you can make GRUB pick a specific version with this answer. Basically all you have to do is add "Advanced options for Ubuntu>Ubuntu, with Linux 5.4.0-60-generic" to the GRUB_DEFAULT line, it should look something like this: GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 5.4.0-60-generic"
"Advanced options for Ubuntu>Ubuntu, with Linux 5.4.0-60-generic"
GRUB_DEFAULT
GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 5.4.0-60-generic"
And finally you should be able to install Virtualbox as usual:
sudo apt install virtualbox virtualbox-dkms