「VirtualBox」- Guest Additions | VBoxGuestAdditions

认识

文档:https://www.virtualbox.org/manual/ch04.html

The Guest Additions are designed to be installed inside a virtual machine after the guest operating system has been installed. They consist of device drivers and system applications that optimize the guest operating system for better performance and usability. 简而言之, VBoxGuestAdditions,其安装在虚拟机中,其包含设备驱动和系统应用来增强虚拟机功能。

组成

Wip

性质

相关特征参考文档:https://www.virtualbox.org/manual/ch04.html#guestadd-intro

构建

安装

两种方法安装方法:

1)为 VirtualBox 添加 Oracle_VM_VirtualBox_Extension_Pack-5.2.44.vbox-extpack
—- 然后,对虚拟机实例 Insert Guest Additionals CD Images… 操作;
—- 最后,在 Guest 中挂在 CD 并安装其中的 ./VBoxLinuxAdditions.run 程序;

2)或下载 VBoxGuestAdditions.iso 到虚拟机中,并挂载;
—- 然后,在 Guest 中安装其中的 ./VBoxLinuxAdditions.run 程序;

这两种方法都需要 Guest 已经安装:

apt-get install -y gcc make perl

# apt-get install -i linux-headers-5.4.0-84
apt install linux-headers-$(uname -r)

卸载

Uninstall VirtualBox Guest Additions on Ubuntu and Windows 7

# Linux
sh /path/to/VBoxLinuxAdditions.run uninstall

改进

fatal error: linux/smp_lock.h: No such file or directory

在 VirtualBox 5.2.44 且 Guest 为 Ubuntu 20.04.3 中,安装 Gust Additions 扩展遇到该错误。

内核为 5.11.0-27 版本,我们通过降级到 5.4.0-84 解决该问题。

花屏、应用程序显示异常、无法正常渲染

问题描述
在 Ubuntu 20.04 TLS 中,VirtualBox 6.1.32,桌面部分应用程序出现花屏(渲染异常的问题;我们解决该问题后才记录笔记,所以没有截图)。

原因分析
我们猜测与开启 3D 加速有关。

解决方案
# 02/23/2022 在关闭 Display / Screen / Acceleration / Enable 3D Acceleration 功能后,目前桌面能够正常显示 ⇒ 我们不会播放视频,对 3D 加速没有特别严重的需求。

参考

Chapter 2. Installation Details/2.3.2. The Oracle VM VirtualBox Kernel Modules
Chapter 4. Guest Additions
https://download.virtualbox.org/virtualbox/
“Install Guest Additions” – nothing happens
How to Install Kernel Headers in Ubuntu and Debian