[Seek Help] vbox arm虚拟机下UOS V20 ARM版 编译VirtualBox Guest Additions 报错
Tofloor
poster avatar
闲聊
deepin
2025-12-13 11:58
Author

vbox arm虚拟机下编译VirtualBox Guest Additions 报错

这个实在是不会改,发到这里碰碰运气。。。

路过的大神帮忙看看

user@user-ap-m4:~$ uname -a
Linux user-ap-m4 4.19.0-arm64-desktop #7322 SMP Wed Dec 3 18:03:04 CST 2025 aarch64 GNU/Linux

sudo ./VBoxLinuxAdditions-arm64.run 运行报错 vbox是7.2 7.1的都报错,因为是ARM版本的再早的 貌似它也不支持了。。。

看日志是这个

In file included from /tmp/vbox.0/combined-os-specific.c:43:
/tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c: In function ‘rtR0MemObjNativeProtect’:
/tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c:2128:9: error: implicit declaration of function ‘__flush_tlb_all’; did you mean ‘flush_tlb_all’? [-Werror=implicit-function-declaration]
         __flush_tlb_all();
         ^~~~~~~~~~~~~~~
         flush_tlb_all
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:304:/tmp/vbox.0/combined-os-specific.o] 错误 1
make[1]: *** [Makefile:1531: _module_/tmp/vbox.0] Error 2
make: *** [/tmp/vbox.0/Makefile-footer.gmk:145: vboxguest] Error 2
kernel modules and services were not reloaded

千问说要这么干,但是。。没搞定 临时目录报错了就没了

是由于 VirtualBox Guest Additions 或内核模块(如 vboxdrv)在较新版本的 Linux 内核中编译时,调用了已被移除或重命名的内核函数。

具体来说,从 Linux 内核 5.8 开始,__flush_tlb_all() 函数被移除,统一使用 flush_tlb_all()。但旧版 VirtualBox(尤其是 6.1.x 及更早版本)的源码仍使用了已被废弃的 __flush_tlb_all,导致编译失败。

解决方案
✅ 方法一:升级 VirtualBox 到兼容版本
VirtualBox 6.1.18 及以上版本 已经修复了对 Linux 5.10+ 内核的兼容性问题 6。
如果你使用的是 VirtualBox 7.x,也请确保是 最新小版本(例如 7.0.16+),因为新内核(如 6.6、6.8、6.10+)常引入破坏性变更。
你当前的日期是 2025 年 12 月,强烈建议使用 VirtualBox 7.1 或 7.2 的最新版,它们已适配较新的内核(包括 6.x 系列)8。

✅ 方法二:打补丁(适用于无法升级的情况)
如果你必须使用旧版 VirtualBox,可以手动修改源码:

进入 /tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c
找到 __flush_tlb_all();
替换为 flush_tlb_all();
重新运行 make
Reply Favorite View the author
All Replies
ksgt0025
deepin
18 hours ago
#1

把错误日志复制给AI分析,问它怎么做。

Reply View the author
闲聊
deepin
3 hours ago
#2
ksgt0025

把错误日志复制给AI分析,问它怎么做。

给千问了 千问给了一个不可能的解决方案。。

DS也差不多

Reply View the author