问题
在Win10的 virtual Box中安装CentOS 虚拟机
点击虚拟机菜单栏 -> 设备 -> 安装增强功能,弹出"未能加载虚拟光盘 C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso 到虚拟电脑 CentOS."的提示。
运行安装文件报错
- "This system is currently not set up to build kernel modules. Please install the gcc make perl packages from your distribution. ": 这是在提示我们安装 gcc、make 和 perl,可以通过安装开发工具集合"Development Tools"来解决。
- "VirtualBox Guest Additions: Look at /var/log/vboxadd-setup.log to find out what went wrong modprobe vboxguest failed": 这里没有直接给出错误原因,而是让我们去看日志。执行
less /var/log/vboxadd-setup.log
查看日志,显示"Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel",这是在提示我们需要安装 libelf-dev, libelf-devel, elfutils-libelf-devel 三者之一,经测试,默认源中只有 elfutils-libelf-devel,安装它即可
安装依赖
dnf group install -y "Development Tools"
dnf install -y elfutils-libelf-devel