最近我将 Ubuntu 安装在 VirtualBox 中。问题是分辨率真的很小,即使我通过查看 → 切换到全屏来放大它,它仍然很小。我搜索并找到了这个解决方案:
sudo apt-get install virtualbox-guest-dkms
失败并显示以下错误消息:
File "/usr/share/apport/package-hooks/dkms_packages.py", line 98, in <module>
with apport.fileutils.make_report_file(report) as f: AttributeError: 'module' object has no attribute 'make_report_file'
Error! Bad return status for module build on kernel: 3.19.0-25-generic (x86_64)
Consult /var/lib/dkms/virtualbox-guest/4.3.10/build/make.log for more information
日志文件的内容:
DKMS make.log for virtualbox-guest-4.3.10 for kernel 3.19.0-25-generic (x86_64)
Mi 18. Nov 11:15:34 CET 2015
make: Entering directory `/usr/src/linux-headers-3.19.0-25-generic'
LD /var/lib/dkms/virtualbox-guest/4.3.10/build/built-in.o
LD /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/built-in.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/VBoxGuest-linux.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/VBoxGuest.o
/var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/VBoxGuest.c: In function ‘VBoxGuestCommonGetHandledEventsLocked’:
/var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/VBoxGuest.c:82:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
uint32_t u32AllowedGuestCaps = pSession->u32AquiredGuestCaps | (VMMDEV_EVENT_VALID_EVENT_MASK & ~pDevExt->u32AcquireModeGuestCaps);
^
/var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/VBoxGuest.c:2660:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
uint32_t fGenFakeEvents = 0;
^
/var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/VBoxGuest.c: In function ‘VBoxGuestCommonIOCtl’:
/var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/VBoxGuest.c:2807:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
VBoxGuestHGCMCallInfoTimed *pInfo = (VBoxGuestHGCMCallInfoTimed *)pvData;
^
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/VBoxGuest2.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/GenericRequest.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/HGCMInternal.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/Init.o
/Init.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/PhysHeap.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/SysHlp.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/VMMDev.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/alloc-r0drv.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/initterm-r0drv.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/memobj-r0drv.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/mpnotification-r0drv.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/powernotification-r0drv.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/alloc-r0drv-linux.o
/var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/alloc-r0drv-linux.c: In function ‘rtR0MemAllocExecVmArea’:
/var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/alloc-r0drv-linux.c:194:9: warning: passing argument 3 of ‘map_vm_area’ from incompatible pointer type [enabled by default]
if (!map_vm_area(pVmArea, PAGE_KERNEL_EXEC, &papPagesIterator))
^
In file included from ./arch/x86/include/asm/io.h:200:0,
from ./arch/x86/include/asm/realmode.h:5,
from ./arch/x86/include/asm/acpi.h:33,
from ./arch/x86/include/asm/fixmap.h:19,
from ./arch/x86/include/asm/apic.h:12,
from ./arch/x86/include/asm/smp.h:12,
from ./arch/x86/include/asm/mmzone_64.h:10,
from ./arch/x86/include/asm/mmzone.h:4,
from include/linux/mmzone.h:912,
from include/linux/gfp.h:5,
from include/linux/slab.h:14,
from /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/the-linux-kernel.h:72,
from /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/alloc-r0drv-linux.c:31:
include/linux/vmalloc.h:115:12: note: expected ‘struct page **’ but argument is of type ‘struct page ***’
extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
^
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/assert-r0drv-linux.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/initterm-r0drv-linux.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/memobj-r0drv-linux.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/memuserkernel-r0drv-linux.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/mp-r0drv-linux.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/mpnotification-r0drv-linux.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/process-r0drv-linux.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/semevent-r0drv-linux.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/semeventmulti-r0drv-linux.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/semfastmutex-r0drv-linux.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/semmutex-r0drv-linux.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/spinlock-r0drv-linux.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/thread-r0drv-linux.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/thread2-r0drv-linux.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/time-r0drv-linux.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/linux/RTLogWriteDebugger-r0drv-linux.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/r0drv/generic/semspinmutex-r0drv-generic.o
/common/alloc/alloc.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/err/RTErrConvertFromErrno.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/err/RTErrConvertToErrno.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/log/log.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/log/logellipsis.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/log/logrel.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/log/logrelellipsis.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/log/logcom.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/log/logformat.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/misc/RTAssertMsg1Weak.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/misc/RTAssertMsg1Weak.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/misc/RTAssertMsg2.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/misc/RTAssertMsg2Add.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/misc/RTAssertMsg2AddWeak.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/misc/RTAssertMsg2AddWeakV.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/misc/RTAssertMsg2Weak.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/misc/RTAssertMsg2WeakV.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/misc/assert.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/misc/thread.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/string/RTStrCopy.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/string/RTStrCopyP.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/string/RTStrCopyP.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/string/strformat.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/string/strformatrt.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/string/strformattype.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/string/strprintf.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/string/strtonum.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/table/avlpv.o
CC [M] /var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/time/time.o
/var/lib/dkms/virtualbox-guest/4.3.10/build/vboxguest/common/time/time.c: In function ‘VBoxGuest_RTTimeFromString’:
...
/var/lib/dkms/virtualbox-guest/4.3.10/build/vboxsf/dirops.c:129:29: error: ‘struct file’ has no member named ‘f_dentry’
sf_g = GET_GLOB_INFO(dir->f_dentry->d_inode->i_sb);
^
/var/lib/dkms/virtualbox-guest/4.3.10/build/vboxsf/vfsmod.h:144:60: note: in definition of macro ‘GET_GLOB_INFO’
# define GET_GLOB_INFO(sb) ((struct sf_glob_info *) (sb)->s_fs_info)
^
/var/lib/dkms/virtualbox-guest/4.3.10/build/vboxsf/dirops.c:135:16: error: ‘struct file’ has no member named ‘f_dentry’
inode = dir->f_dentry->d_inode;
^
make[2]: *** [/var/lib/dkms/virtualbox-guest/4.3.10/build/vboxsf/dirops.o] Error 1
make[1]: *** [/var/lib/dkms/virtualbox-guest/4.3.10/build/vboxsf] Error 2
make: *** [_module_/var/lib/dkms/virtualbox-guest/4.3.10/build] Error 2
make: Leaving directory `/usr/src/linux-headers-3.19.0-25-generic'
~
我该如何解决这个问题?
答案1
还有另一种方法可以做到这一点,我更喜欢这种方法。
- 打开终端
sudo apt-get update && upgrade -y
- 运行完成后:
sudo apt-get install build-essential
- 在正在运行的 VirtualBox 窗口顶部,选择“设备”>“插入 Guest addons cd 映像”。
- 在您的终端中导航到:
cd /media/USERNAME/
然后运行ls
,然后查看虚拟磁盘的名称(在我的情况下)VBOXADDITIONS_5.0.10_104061
以及cd
它的名称。 - 现在在文件夹运行
sudo sh ./VBoxLinuxAdditions.run
- 等待它完成
- 重新启动并享受。
让我知道你是怎么办的。
答案2
最后,我终于解决了这个问题。就我而言,问题在于我运行的是旧版 VirtualBox,更新后,命令 virtualbox-guest-dkms 起作用了,我可以切换到全屏模式。