打开安装好的虚拟机系统,找到设备菜单,点击最下面有安装增强功能

如果出现“未能加载虚拟光盘”的错误提示,说明之前已经加载了一个虚拟光盘,需要先移除
依次点击菜单栏的设备->分配光驱->移除虚拟盘即可移除
移除后重新点击设备->安装增强功能
#进入虚拟机终端,挂载虚拟光驱,即可找到安装脚本

mount /dev/sr0 /media
cd  /media
./VBoxLinuxAdditions.run

#如果提示下面的错误

Uncompressing VirtualBox 6.1.26 Guest Additions for Linux........
bzip2 not found.  Please install: bzip2 tar; and try again.

则需要先安装bzip2 (可通过yum search bzip2查询安装包的全名)

yum -y install bzip2-x86_64 

再次执行

./VBoxLinuxAdditions.run

如果出现下面的提示
Verifying archive integrity… All good.
Uncompressing VirtualBox 6.1.26 Guest Additions for Linux…
VirtualBox Guest Additions installer
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
VirtualBox Guest Additions: or
VirtualBox Guest Additions: /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Kernel headers not found for target kernel
3.10.0-1127.el7.x86_64. Please install them and execute
/sbin/rcvboxadd setup
modprobe vboxguest failed
The log file /var/log/vboxadd-setup.log may contain further information.

#则继续执行

/sbin/rcvboxadd quicksetup all

重启

reboot
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐