今天,当我启动 Virtualbox VM 并尝试启用第二个屏幕时,我发现启用它的按钮已“变灰”并且无法单击。直到昨天它还在工作。
我做了一些研究,发现几个线程(即这个)表明问题可能出在 VM Guest Additions 上。实际上,其他功能(例如主机和来宾操作系统之间的复制粘贴)被禁用。
因此,我尝试从 VM 顶部菜单(设备 > 升级来宾添加)更新 Virtualbox 来宾添加,但出现以下弹出错误:
Creating installation directory "/tmp/" on guest failed: VERR_NOT_FOUND.
Result Code:
VBOX_E_IPRT_ERROR (0X80BB0005)
Component:
GuestSessionWrap
Interface:
IGuestSession {234f0627-866d-48c2-91a5-4c9d50f04928}
我已经检查了我的机器上是否存在 /tmp/ 目录,但我猜由于某种原因它无法在那里下载新的安装文件。
所以我想通过终端更新 Virtualbox Guest Additions。
我该怎么做?
我尝试过的
通过遵循本教程,我尝试重新安装来宾添加项
sudo apt update
我在这里收到消息
4 packages can be upgraded. Run 'apt list --upgradable' to see them
然后出现此错误消息:
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11-icons-hidpi (main/dep11/[email protected]) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11 (restricted/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11 (restricted/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11-icons-small (restricted/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11-icons (restricted/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11-icons-hidpi (restricted/dep11/[email protected]) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target CNF (restricted/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target CNF (restricted/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
E: The repository 'http://security.ubuntu.com/ubuntu hirsute-security Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11-icons-hidpi (main/dep11/[email protected]) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11 (restricted/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11 (restricted/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11-icons-small (restricted/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11-icons (restricted/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11-icons-hidpi (restricted/dep11/[email protected]) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target CNF (restricted/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target CNF (restricted/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11-icons-hidpi (main/dep11/[email protected]) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11 (restricted/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11 (restricted/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11-icons-small (restricted/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11-icons (restricted/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target DEP-11-icons-hidpi (restricted/dep11/[email protected]) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target CNF (restricted/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target CNF (restricted/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:50
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11-icons-hidpi (main/dep11/[email protected]) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11 (restricted/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11 (restricted/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11-icons-small (restricted/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11-icons (restricted/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target DEP-11-icons-hidpi (restricted/dep11/[email protected]) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target CNF (restricted/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
W: Target CNF (restricted/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:51
所以我跑
apt list --upgradable
并得到
tommaso@tommaso-VirtualBox:~$ apt list --upgradable
Listing... Done
gjs/jammy-updates 1.72.4-0ubuntu0.22.04.1 amd64 [upgradable from: 1.72.2-0ubuntu2]
libgjs0g/jammy-updates 1.72.4-0ubuntu0.22.04.1 amd64 [upgradable from: 1.72.2-0ubuntu2]
transmission-common/jammy-updates,jammy-updates 3.00-2ubuntu2.1 all [upgradable from: 3.00-2ubuntu2]
transmission-gtk/jammy-updates 3.00-2ubuntu2.1 amd64 [upgradable from: 3.00-2ubuntu2]
然后
sudo apt install build-essential linux-headers-$(uname -r) -y
VM顶部菜单> Guest Additions CD Image,似乎什么也没发生,但我猜是因为它们已经安装了,但没有更新。
cd /media/<MY_USER>/VBox_GAs_7.0.4/
sudo ./VBoxLinuxAdditions.run
但我得到
Cannot reload kernel modules: one or more modules is still in use
所以我重新启动虚拟机,然后sudo ./VBoxLinuxAdditions.run
再次运行,但没有任何变化。
我已经更新了 VirtualBox 应用程序,但这并不能解决问题。
似乎来宾添加无法正确安装,因为
/etc/apt/sources.list
当我尝试从 Virtualbox 顶栏菜单“设备”虚拟插入和安装 gustadditions CD 时,这两个问题阻止了在 guestadditions 的
VBoxLinuxAdditions.run
安装目录中生成文件。这可能是 Virtualbox UI 弹出窗口显示的错误。/dev/cdrom
我已经解决了这些问题
1 - 升级软件包
然后运行
对于上一个命令返回的路径的每个“第一级目录”,遵循依赖顺序(如果返回错误则跳过一个包,继续下一个,然后返回)。
例如
gjs/jammy-updates 1.72.4-0ubuntu0.22.04.1 amd64 [upgradable from: 1.72.2-0ubuntu2]
-->
sudo apt upgrade gjs
2 - 删除 /etc/apt/sources.list 中的重复行
然后注释第 50 和 51 行,如所示
3 - 重试安装 Virtualbox Guest Additions
不再返回警告,然后
然后通过 重新启动虚拟机
sudo reboot
。然后,从 VirtualBox 顶部栏的“设备”菜单 -> 单击“插入来宾添加 CD”(看起来它没有执行任何操作,但确实如此)
最后
当它询问您是否要安装来宾添加项时继续,即使它们已经在操作系统上,然后再次通过 重新启动虚拟机
sudo reboot
。这次我看到之前禁用的选项又恢复工作了。