如何解决这个问题?/var/crash/virtualbox-guest-dkms.0.crash 包含:
ProblemType: Package
DKMSBuildLog:
DKMS make.log for virtualbox-guest-6.1.10 for kernel 5.8.0-36-generic (x86_64)
Sun 10 Jan 11:53:48 EET 2021
make: Entering directory '/usr/src/linux-headers-5.8.0-36-generic'
CC [M] /var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/VBoxGuest-linux.o
CC [M] /var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/VBoxGuest.o
CC [M] /var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/common/string/strformatrt.o
CC [M] /var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/combined-agnostic.o
CC [M] /var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/combined-os-specific.o
In file included from /var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/combined-os-specific.c:30:
/var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/r0drv/linux/alloc-r0drv-linux.c: In function ‘rtR0MemAllocExecVmArea’:
/var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/r0drv/linux/alloc-r0drv-linux.c:171:15: error: implicit declaration of function ‘__get_vm_area’; did you mean ‘get_vm_area’? [-Werror=implicit-function-declaration]
171 | pVmArea = __get_vm_area(cbAlloc, VM_ALLOC, MODULES_VADDR, MODULES_END);
| ^~~~~~~~~~~~~
| get_vm_area
/var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/r0drv/linux/alloc-r0drv-linux.c:171:13: warning: assignment to ‘struct vm_struct *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
171 | pVmArea = __get_vm_area(cbAlloc, VM_ALLOC, MODULES_VADDR, MODULES_END);
| ^
/var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/r0drv/linux/alloc-r0drv-linux.c:204:14: error: implicit declaration of function ‘map_vm_area’; did you mean ‘get_vm_area’? [-Werror=implicit-function-declaration]
204 | if (!map_vm_area(pVmArea, PAGE_KERNEL_EXEC,
| ^~~~~~~~~~~
| get_vm_area
In file included from /var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/combined-os-specific.c:33:
/var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/r0drv/linux/memobj-r0drv-linux.c: In function ‘rtR0MemObjNativeFree’:
/var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/r0drv/linux/memobj-r0drv-linux.c:596:43: error: ‘struct mm_struct’ has no member named ‘mmap_sem’; did you mean ‘mmap_base’?
596 | down_read(&pTask->mm->mmap_sem);
| ^~~~~~~~
| mmap_base
/var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/r0drv/linux/memobj-r0drv-linux.c:611:41: error: ‘struct mm_struct’ has no member named ‘mmap_sem’; did you mean ‘mmap_base’?
611 | up_read(&pTask->mm->mmap_sem);
| ^~~~~~~~
| mmap_base
/var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/r0drv/linux/memobj-r0drv-linux.c: In function ‘rtR0MemObjNativeLockUser’:
/var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/r0drv/linux/memobj-r0drv-linux.c:1079:31: error: ‘struct mm_struct’ has no member named ‘mmap_sem’; did you mean ‘mmap_base’?
1079 | down_read(&pTask->mm->mmap_sem);
| ^~~~~~~~
| mmap_base
/var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/r0drv/linux/memobj-r0drv-linux.c:1165:33: error: ‘struct mm_struct’ has no member named ‘mmap_sem’; did you mean ‘mmap_base’?
1165 | up_read(&pTask->mm->mmap_sem);
| ^~~~~~~~
| mmap_base
/var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/r0drv/linux/memobj-r0drv-linux.c:1192:29: error: ‘struct mm_struct’ has no member named ‘mmap_sem’; did you mean ‘mmap_base’?
1192 | up_read(&pTask->mm->mmap_sem);
| ^~~~~~~~
| mmap_base
/var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/r0drv/linux/memobj-r0drv-linux.c: In function ‘rtR0MemObjNativeMapUser’:
/var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/r0drv/linux/memobj-r0drv-linux.c:1607:36: error: ‘struct mm_struct’ has no member named ‘mmap_sem’; did you mean ‘mmap_base’?
1607 | down_write(&pTask->mm->mmap_sem);
| ^~~~~~~~
| mmap_base
/var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/r0drv/linux/memobj-r0drv-linux.c:1724:34: error: ‘struct mm_struct’ has no member named ‘mmap_sem’; did you mean ‘mmap_base’?
1724 | up_write(&pTask->mm->mmap_sem);
| ^~~~~~~~
| mmap_base
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:290: /var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/combined-os-specific.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [scripts/Makefile.build:519: /var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest] Error 2
make: *** [Makefile:1780: /var/lib/dkms/virtualbox-guest/6.1.10/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.8.0-36-generic'
DKMSKernelVersion: 5.8.0-36-generic
Date: Sun Jan 10 11:53:52 2021
DuplicateSignature: dkms:virtualbox-guest-dkms:6.1.10-dfsg-1~ubuntu1.20.04.1:/var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/r0drv/linux/alloc-r0drv-linux.c:171:15: error: implicit declaration of function ‘__get_vm_area’; did you mean ‘get_vm_area’? [-Werror=implicit-function-declaration]
Package: virtualbox-guest-dkms 6.1.10-dfsg-1~ubuntu1.20.04.1
PackageVersion: 6.1.10-dfsg-1~ubuntu1.20.04.1
SourcePackage: virtualbox
Title: virtualbox-guest-dkms 6.1.10-dfsg-1~ubuntu1.20.04.1: virtualbox-guest kernel module failed to build
答案1
使用 dpkg 下载并安装 VirtualBox 6.1.16 (解决方案领英Janaka Priyadarshana 的评论) 有效。
- 访问https://www.virtualbox.org/wiki/Linux_Downloads
- 下载适合您系统的版本。
- 从 bash 运行:
sudo dpkg -i filename.deb
来安装它。
答案2
遇到了同样的情况。我回到了内核 5.4:这解决了问题。