在客户机上创建安装目录“/tmp/”失败:VERR_NOT_FOUND。——那么,如何通过终端升级 Virtualbox 客户机附加功能?

在客户机上创建安装目录“/tmp/”失败:VERR_NOT_FOUND。——那么,如何通过终端升级 Virtualbox 客户机附加功能?

今天,当我启动 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 应用程序,但是问题并没有得到解决。

答案1

似乎无法正确安装来宾添加程序,原因是

  1. 未升级的 apt 软件包
  2. 重复的行/etc/apt/sources.list

当我尝试从 Virtualbox 顶栏菜单“设备”虚拟插入并安装 gust additions CD 时,这两个问题导致文件无法VBoxLinuxAdditions.run 在 guest additions 的安装目录中生成。这可能是 Virtualbox UI 弹出窗口显示的错误。/dev/cdrom

我已经解决了这些问题

1-升级软件包

apt list --upgradable

然后运行

sudo apt upgrade <PACKAGE>

对于前一个命令返回的路径的每个“第一级目录”,遵循依赖顺序(如果返回错误则跳过一个包,继续下一个,然后返回)。

例如
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 中的重复行

sudo vim /etc/apt/sources.list

然后注释掉第 50 行和第 51 行,如下图所示

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

3 - 重试安装 Virtualbox Guest Additions

sudo apt update

不再返回警告,那么

sudo apt-get install build-essential linux-headers-$(uname -r)

然后通过 重新启动虚拟机sudo reboot

然后,从 VirtualBox 顶栏“设备”菜单 -> 单击“插入客户添加 CD”(它似乎没有执行任何操作,但确实如此)

最后

sudo mkdir -p /mnt/cdrom
sudo mount /dev/cdrom /mnt/cdrom
cd /mnt/cdrom
sudo ./VBoxLinuxAdditions.run 

当系统询问您是否要安装客户机添加功能(即使它们已经在操作系统上)时,请继续,然后再次通过 重新启动虚拟机sudo reboot

这次我看到之前禁用的选项又恢复正常工作了。

相关内容