Virtual Box 中 安装 VBox Guest Additions扩展程序

Posted xiaoruilin

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Virtual Box 中 安装 VBox Guest Additions扩展程序相关的知识,希望对你有一定的参考价值。

环境:

Win10 安装 VBox(6.1.10),虚拟机系统为:Centos8

开始:

http://download.virtualbox.org/virtualbox  中找到你的VBox版本下载对应版本:

后面以为的版本为例:

http://download.virtualbox.org/virtualbox/6.1.10/ 

下载:VBoxGuestAdditions_6.1.10.iso 文件

关闭你的 虚拟机系统为:Centos8

技术图片

 

 

 技术图片

 

 

 技术图片

 

 

 VBox->设置->存储->控制器->添加虚拟光驱->注册->"选择VBoxGuestAdditions_6.1.10.iso" ->选择

系统和虚拟机复制,如下设置也设置一下,不知道有没有作用

技术图片

 

 

 

 开启Centos8:

mkdir /mnt/cdrom

sudo mount /dev/cdrom /mnt/cdrom #加载虚拟光盘
sudo umount /dev/cdrom /mnt/cdrom  #挂载虚拟光盘

cd /mnt/cdrom

./VBoxLinuxAdditions.run

 

上面执行可能会碰到问题

 

#将所有组件更新到最新
yum -y groupinstall "Development Tools"
yum install update yum update kernel yum update kernel
-devel yum install kernel-headers yum install gcc* yum install gcc make reboot

 

问题1

Building the main Guest Additions 6.1.10 module for kernel 4.18.0-193.6.3.el8_2.x86_64.
Error building the module.  Build output follows.
make V=1 CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/4.18.0-193.6.3.el8_2.x86_64/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j1 modules
Makefile:978: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel".  Stop.
make: *** [/tmp/vbox.0/Makefile-footer.gmk:114: vboxguest] Error 2
modprobe vboxguest failed

上面问题解决方法:https://www.cnblogs.com/mychangee/p/12087954.html

1. 安装kernel-devel,并将kernel和kernel-devel更新至同一版本
# yum install -y kernel-devel gcc //安装kernel-devel和gcc编译工具链
# yum -y upgrade kernel kernel-devel //更新kernel和kernel-devel到最新版本
# reboot //重启,重启时,选择最新版本的内核启动
2. 以新版本内核启动,并删除旧版本内核
//启动之后
# uname -r //查看当前启动的内核版本
# rpm -qa | grep kernel-[0-9] //查看全部的内核
# yum remove 旧版本内核 //删除旧版本内核
完成之后,就可以继续安装virtualbox增强工具了。

 

问题2:

"CANNOT GENERATE ORC METADATA FOR CONFIG_UNWINDER_ORC=Y, PLEASE INSTALL LIBELF-DEV, LIBELF-DEVEL OR ELFUTILS-LIBELF-DEVEL". STOP.

未找到“libelf-dev 或 elfutils-libelf-devel”

yum install elfutils-libelf-devel

 

 

成功返回如下:

技术图片
[root@localhost cdrom]# ./VBoxLinuxAdditions.run 
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.1.10 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 6.1.10 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel 
modules.  This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: or
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Building the modules for kernel 
4.18.0-193.6.3.el8_2.x86_64.
ValueError: File context for /opt/VBoxGuestAdditions-6.1.10/other/mount.vboxsf already defined
View Code

 

大功造成现在使用真爽!

以上是关于Virtual Box 中 安装 VBox Guest Additions扩展程序的主要内容,如果未能解决你的问题,请参考以下文章

安装virtual box

5.6 安装Virtual box

Oracle VM Virtual Box的安装

关于virtual box 虚拟机使用

Virtual Box 6.1 安装 Ubuntu 20.04 LTS

windows下安装virtual box(ubuntu)