且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何安装Virtual Box的VBox Guest Additions扩展程序

更新时间:2022-09-16 09:38:37

Virtual Box的默认安装是不包含Guest Addition这个扩展的,在实际使用过程中带来种种不便,比如只能通过小窗口访问虚拟机的操作系统,通过默认的右Ctrl切换鼠标,不能和宿主操作系统共享文件等等。


这些弊端在安装了Guest Additions扩展程序后能得到完美解决。


Guest Additions,故名思议,需要在Guest即虚拟机操作系统里安装。


在VirtualBox的官网下载VBoxGuestAdditions.iso这个镜像文件,


http://download.virtualbox.org/virtualbox/5.0.16/


如何安装Virtual Box的VBox Guest Additions扩展程序

然后将保存在宿主操作系统本地的iso文件挂接到虚拟机操作修通的光驱里:


如何安装Virtual Box的VBox Guest Additions扩展程序

我的虚拟机操作系统是Ubuntu,新建一个文件夹/mnt/cdrom:


如何安装Virtual Box的VBox Guest Additions扩展程序

然后使用命令行sudo mount /dev/cdrom /mnt/cdrom将光驱挂接到目录/mnt/cdrom去:

如何安装Virtual Box的VBox Guest Additions扩展程序


然后进入/mnt/cdrom, 就能看到镜像文件VBoxGuestAdditions.iso里的内容了:


如何安装Virtual Box的VBox Guest Additions扩展程序

执行脚本文件./VBoxLinuxAdditions.run:


如何安装Virtual Box的VBox Guest Additions扩展程序

稍后收到提示: Running kernel modules will not be replaced until the system is restarted. 这说明Guest Additions已经在虚拟机操作系统Ubuntu里安装成功,重启虚拟机即生效。

如何安装Virtual Box的VBox Guest Additions扩展程序