Elementary OS虚拟机安装Virtualbox增强功能(Guest Additions)

这篇教程介绍如何在Elementary OS虚拟机中安装Virtualbox增强功能(Guest Additions).增强功能可以让虚拟机全屏显示.这样使用虚拟机就跟使用物理机一样方便.增强功能还可以让宿主机和客户机共享文件夹。另外,增强功能还能提升虚拟机的3D图形加速

Elementary OS虚拟机安装Virtualbox增强功能

启动Elementary虚拟机,打开一个终端,使用下面的命令更新系统软件

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade

更新后重启Elementary虚拟机.

sudo reboot

安装编译内核模块所需要的软件包.

sudo apt-get install build-essential module-assistant dkms

准备编译Virtualbox内核模块.

sudo m-a prepare

在虚拟机窗口菜单里,选择设备 > 插入增强功能CD镜像

插入增强功能CD镜像

 

点击下载.这将下载增强功能的CD镜像.

下载增强功能CD镜像

 

如果你的宿主机是Linux,那么增强功能的CD镜像会下载到~/.config/VirtualBox/目录下.下载完成后,点击插入(insert),将CD镜像插入到虚拟光驱中.

插入增强功能CD镜像

 

现在,在Elementary OS虚拟机里打开一个终端,输入下面的命令。

blkid

输出:

/dev/sr0: LABEL="VBOXADDITIONS_4.3.36_105129" TYPE="iso9660"

/dev/sr0是虚拟光驱的设备名称。

SCSI控制器上的光驱叫做/dev/sr0;IDE控制器上的光驱叫做/dev/hda。/dev/cdrom是指向/dev/sr0或/dev/hda的一个软链接,也就是指向第一个光驱设备。

在/media目录下创建一个cdrom目录。然后将virtualbox增强功能的ISO镜像挂载到/media/cdrom。

sudo mkdir /media/cdrom

sudo mount /dev/sr0 /media/cdrom

然后,将当前的工作目录切换到/media/cdrom目录下,再运行virtualbox增强功能的安装程序。

cd /media/cdrom

sudo sh VBoxLinuxAdditions.run

输出:

Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.36 Guest Additions for Linux............
VirtualBox Guest Additions installer
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules ...done.
Doing non-kernel setup of the Guest Additions ...done.
You should restart your guest to make sure the new modules are actually used

Installing the Window System drivers
Installing X.Org Server 1.16 modules ...done.
Setting up the Window System to use the Guest Additions ...done.
You may need to restart the the Window System (or just restart the guest system)
to enable the Guest Additions.

Installing graphics libraries and desktop services components ...done.

重启Elementary OS虚拟机。

sudo reboot

现在,你可以按右ctrl+F键进入全屏模式,这说明增强功能成功安装好了.

为这篇文章评分
[Total: 4 Average: 3.8]

One Response to “Elementary OS虚拟机安装Virtualbox增强功能(Guest Additions)

Leave a Reply

Your email address will not be published.

The maximum upload file size: 2 MB. You can upload: image, audio, video, document, spreadsheet, interactive, text, archive, code, other. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here