我最近在Oracle的Virtualbox上安装了Ubuntu。现在,我要安装来宾添加项。
我启动了Ubuntu来宾操作系统,单击“设备”,然后选择“安装来宾附件”。什么也没发生,并且我在桌面上看不到CD图标。
我该如何进行这项工作?
如果在VirtualBox VM中安装Ubuntu时遇到问题,因为安装程序窗口不适合低分辨率屏幕尺寸,则可以使用Alt+移动该窗口F7。
如果我们已经从存储库安装了OSE版本的Virtual Box,则可以在来宾中添加来自存储库的来宾添加项。这将安装与从存储库获得的Virtual Box版本匹配的来宾添加项。这是不建议作为从Oracle库中获得虚框的新版本安装这些(见下文)。
或者,我们可以在主机Ubuntu中安装软件包virtualbox-guest-additions-iso。
sudo apt-get install virtualbox-guest-additions-iso
带有guest附加CD的OSE版本映像的.iso文件将安装在主机目录中/usr/share/virtualbox/VBoxGuestAdditions.iso
。将此.iso文件作为CD挂载到虚拟机的设置中。然后,在来宾中,您将可以通过安装程序访问CD-ROM。
万一Guest Additions无法构建,我们可能还必须安装Linux内核头文件(请参阅如何安装内核头文件?)或构建必备 工具。还建议安装dkms (请参阅下面的注释4)。您可以在终端中运行以下命令来安装这两个命令:
sudo apt install build-essential dkms
选择设备->安装来宾添加项(或在Virtual Box Manager中按Host+ D),将加载来宾添加项CD .iso,但未将其安装在来宾操作系统中。要进行安装,我们需要以VBoxLinuxAdditions.run
root用户或从自动运行提示符(请参见下文)中运行安装程序脚本。
要安装Guest Additions,我们将在虚拟驱动器挂载后在桌面上显示CD图标:
下一步是通过打开驱动器并单击“运行软件”按钮,在此已安装的CD上运行autorun.sh脚本(以根用户身份)。这将构建并安装所需的vbox内核模块。
来宾添加项作为虚拟CD挂载在启动器上可见:
In case the system is set up to autorun a CD it should just open the following autorun dialogue (if not select the CD symbol, choose open, then choose Open Autorun Prompt)
After having entered your credentials for root access the guest additions will build as seen from the terminal output:
Press Return to close the terminal.
Note 1
Guest Additions need a reboot of your guest OS to take effect.Note 2
In some systems the Virtual Box Guest Additions CD icon may not be shown on the desktop, but will be accessible from the Places menu. If the CD still was not there you may have to manually add the VBoxGuestAdditions.iso as a CD-ROM in the Virtual Box Manager Storage menu. In an Ubuntu host the disk image is in/usr/share/virtualbox/VBoxGuestAdditions.iso
.Note 3
In some systems (e.g. when running Xubuntu guests) we may not have an Autorun Prompt for the mounted CD. Then we can install the guest additions by opening a terminal on the mounted guest additions .iso to runsudo ./VBoxLinuxAdditions.run
. In Lubuntu or Ubuntu Server guests we additionally need to install the GNU C compiler (gcc ) and the make utility in the guest system to be able to compile the guest additions.Note 4
Running DKMS in the guest OS will keep Guest Additions installed after a guest kernel update. It is not a prerequisite for Guest Additions but if used it should be installed before we install the Guest Additions.
In case Guest Additions are not installed properly we may not be able to boot to the GUI. In this case we need to boot holding the Shift key to access the Grub menu where we access a root shell as depicted in the following question (we do need to mount the filesystem read/write to proceed):
The Guest Additions .iso file needs to be installed on /dev/cdrom
from the Virtual Box Manager (see above). We then may install Guest Additions by typing the following commands:
mount /dev/cdrom /mnt # or any other mountpoint
cd /mnt
./VBoxLinuxAdditions.run
reboot
如果安装来宾添加程序出现问题,或者来宾操作系统无法在安装后启动,则我们可能必须删除这些添加程序。也可以通过运行来宾目录中的卸载脚本从根外壳程序完成此操作。 /opt
cd /opt/<VirtualBoxAdditions-x.x.xx>/
sudo ./uninstall.sh
x.x.xx
用您当前版本的访客添加替换。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句