VirtualBox
2009-11-19 09:28:29 阿炯

VirtualBox最早是德国一家软件公司InnoTek所开发的虚拟系统软件,后来被Sun收购,改名为Sun VirtualBox,性能有很大的提高且功能强大,Sun公司后又被Oracle所收购;其更名为Oracle VM VirtualBox。可以在 Linux/Mac 和 Windows 主机中运行并支持在其中安装 Windows NT4.0以上、DOS/Windows 3.x、Linux (2.4和2.6,3.x,4.x)、BSD、Android 等系列的客户操作系统。假如曾经有用过虚拟机软件的经历的话,相信使用 VirtualBox 不在话下。即便是对于新手也没有问题,它提供了详细的文档助你在短期内入门。


VirtualBox 最初是以专有软件协议的方式提供。在2008年2月InnoTek软件公司被Sun公司所并购。Sun VirtualBox 由Sun计算机公司进行开发,是Sun xVM虚拟化平台技术的一部份;它提供使用者在32位或64位的Windows、Solaris 及Linux操作系统上虚拟其它x86的操作系统,当然它现在是Oracle公司的资产了。2007年1月InnoTek 以 GNU General Public License (GPLv2) 释出 VirtualBox,并提供二进位版本及开放源码版本的代码。2010年1月21日改名成“Oracle VM VirtualBox”。更多关于其授权信息可参考其官方的授权问题说明,其主体采用的是GPLv2,少部分高端功能需要一定的授权。2022年10月v7.0发布,因其依赖的Qt开发库的授权有变更,故整体授权升级为GPLv3

与同性质的VMware及Virtual PC比较下,VirtualBox独到之处包括远程桌面协议(RDP)、iSCSI及USB的支持,其在客户机操作系统上已可以支持USB 2.0的硬件装置(不过要安装 VirtualBox Extension Pack,但这个组件并非开源软件系列,下文有说明)。

VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use. Not only is VirtualBox an extremely feature rich, high performance product for enterprise customers, it is also the only professional solution that is freely available as Open Source Software under the terms of the GNU General Public License (GPL). See "About VirtualBox" for an introduction.

Presently, VirtualBox runs on Windows, Linux, Macintosh and OpenSolaris hosts and supports a large number of guest operating systems including but not limited to Windows (NT 4.0, 2000, XP, Server 2003, Vista, Windows 7), DOS/Windows 3.x, Linux (2.4 and 2.6), Solaris and OpenSolaris, and OpenBSD.

VirtualBox is being actively developed with frequent releases and has an ever growing list of features, supported guest operating systems and platforms it runs on. VirtualBox is a community effort backed by a dedicated company: everyone is encouraged to contribute while Oracle ensures the product always meets professional quality criteria.


模拟的环境

能够安装多个客户端操作系统,每个客户端系统皆可独立开启、暂停与停止。主端操作系统与客户端操作系统皆能相互通讯,多个操作系统同时执行的环境,也彼此能够同时使用网络。

硬件模拟
* VirtualBox支持Intel VT-x 与AMD AMD-V 硬件虚拟化技术。
* 硬盘被模拟在一个称为虚拟磁盘映像文件(Virtual Disk Images)的特殊容器,目前此格式不兼容于其它虚拟机平台执行,通常作为一个系统文件存放在主机端操作系统(扩展名.vdi)。VirtualBox 能够连结iSCSI,且能在虚拟硬盘上运作,此外VirtualBox可以读写VMware VMDK档与VirtualPC VHD档。
* ISO映像文件可以被挂载成CD/DVD装置,例如下载的Linux发行版DVD映像档可以直接使用在VirtualBox,而不需烧录在光盘片上,亦可直接在虚拟机上挂载实体光驱。
* 预设上VirtualBox提供了一个支持VESA兼容的虚拟显示卡,与一个供Windows、Linux、Solaris、OS/2客户端系统额外的驱动程序,可以提供更好的效能与功能,如当虚拟机的窗口被缩放时,会动态的调整分辨率。
* 在声卡方面,VirtualBox虚拟一个Intel ICH AC97 声卡与SoundBlaster 16 声霸卡。
* 在以太网适配卡方面,VirtualBox虚拟了数张网络卡:AMD PCnet PCI II、AMD PCnet-Fast III、Intel Pro/1000 MT Desktop 、Intel Pro/1000 MT Server、Intel Pro/1000 T Server。

功能特色
* 支持64位客户端操作系统,即使主机使用16位CPU
* 支持SATA硬盘NCQ技术
* 虚拟硬盘快照
* 无缝窗口模式
* 能够在主机端与客户端共享剪贴簿
* 在主机端与客户端间建立分享数据夹
* 附带额外的驱动程序更容易在主机端与客户端间切换
* 内建远程桌面服务器
* 支持VMware VMDK磁盘文件及Virtual PC VHD磁盘文件格式
* 3D虚拟化技术支持 OpenGL(2.1版后支持)、Direct3D(3.0版后支援)
* 最多虚拟32颗CPU(3.0版后支持)
* 支持VT-x与AMD-V硬件虚拟化技术
* iSCSI支援
* USB与USB2.0支援

与VMware相比还是有许多优点的:
1、免费使用,即使收归Oracle旗下之后,其还是免费使用的,主体是开源的;
2、跨平台使用,VirtualBox不仅仅支持 Windows平台,其他的一些主流平台,如Linux、Unix等等,有许多用户使用它很大一部分原因也在于此;
3、最新的版本支持的操作系统也相当丰富。

1、运行效率
在运行效率上VirtualBox毫不逊色,相同配置的系统进行对比,虚拟系统启动后宿主Cpu占用均不超过5%,内存则均为600多兆,并且虚拟机的运行速度在VirtualBox下在明显要快。启动两个虚拟机是宿主系统的资源占用情况,可以看出VirtualBox系统启动时间明显要短于VMware,而运行过程中的资源占用也不占劣势。

2、资源占用
在运行时的资源占用可以说是难分高下。

3、中文支持
VirtualBox下载安装后自动显示为中文,而使用VMware需要我们安装汉化补丁。

4、功能
在支持的操作系统方面,VirtualBox也毫不示弱,主流的操作系统都可以模拟,没有VMware的虚拟机工具,反而让初学者更容易上手。

5、开源
因为VirtualBox是免费的,功能上不输给VMware(其有免费的VMware Player供非商业环境使用)。完全没有必要再去Google上苦苦寻找VMware新版的破解补丁,也不用担心使用破解版中会不会有病毒。当然作为回报就要大家不遗余力的宣传和推荐。

开源版与闭源版的区别

VirtualBox有闭源版本和开源版本VirtualBox Open Source Edition (OSE),两者区别如下:
闭源版的特色功能:
1.VRDP功能
在虚拟硬件的基础上提供了一个完整的VRDP服务(与Microsoft的RDP兼容),可以允许用户通过任意RDP客户端连接到一个远程服务器(虚拟机)。
2.虚拟USB控制器
虚拟USB控制器,无需在Host上安装驱动就可以在虚拟机中使用USB设备。 
3.USB over RDP
作为RDP服务器的虚拟机仍然可以访问RDP客户端插入的USB设备。
4.License
闭源版的许可协议为:VirtualBox Personal Use and Evaluation License

开源版的特色功能:(VirtualBox OSE)
1.VNC服务支持
在虚拟硬件的基础上提供了一个完整的VNC服务,可以允许用户通过任意VNC客户端连接到一个远程的虚拟机(vmware workstation虚拟机软件也是使用VNC作为其远端连接解决方案)。
2.License
开源版本VirtualBox OSE的许可协议为:GNU GPLv2
特别注意:当virtualbox被oracle公司收购后,virtualbox从4.0版本以后把闭源版本拥有的特性而开源版本没有的特性做成了一个扩展包,叫做“VirtualBox Oracle VM VirtualBox Extension Pack”。我们可以从官方注释中看到如下的说明:
"Before version 4.0, there were two editions of VirtualBox: a full binary containing all features and an "Open Source Edition" (OSE) with source code. With version 4.0, there is only one version any more, which is open source, and the closed-source components have been moved to a separate extension pack."

Linux Kernel 正在获得 Guest Additions

2018年1月18日消息,在 VirtualBox 上运行 Linux 发行版将变得更容易,可以在 VirtualBox 上轻松地尝试 Linux 发行版,而无需更换当前的操作系统。但在此之前需要下载安装 VirtualBox Guest Additions 软件包。现在告诉你一个好消息,很快您就不需要安装 VirtualBox Guest Additions 软件包,就能获得与主机操作系统完全集成的 Linux 体验了。Linux 内核开发人员正在努力将 VB Guest Additions 提供的功能添加到 Linux 内核中。根据OMGUbuntu(Via Reddit)的说法,开发团队会在 Linux 4.16 中完成一部分工作。这一改变将使所有操作 Linux 系统的用户受益。在 VirtualBox 中安装了一个内核为 4.16 的 Linux 发行版之后,你不需要额外安装任何东西来获得完整的体验,如屏幕大小调整,USB 控制等等。

VirtualBox支持的虚拟机文件类型


VDI:Virtual Disk Image,这是VirtualBox默认使用的虚拟机文件类型。
VMDK:这是VMware默认使用的虚拟机文件类型。
VHD:这是微软出品虚拟机软件默认使用的虚拟机文件类型。

VirtualBox 5.0 半虚拟化接口

选项有:空,默认,旧的,最少,hyper-v,kvm。

hyper-v由于是微软的系统所以我选择它,hyper-v是windows server 2008 R2以后版本才有的虚拟化技术。

在虚拟机的设置中有个"半虚拟化接口(Paravirtualization providers)"的选项。看了一下帮助文件,得到了一个很有用的信息。简单来说,如果宿主机是 Linux,虚拟机是 Windows,那么此选项应选择"Hyper-V";反之,如果宿主机是 Windows,虚拟机是 Linux,那么应选择"KVM"。正确的半虚拟化接口可以帮助虚拟机更高效准确的运行软件。在手册页中有相关的说明如下:

10.4 Paravirtualization providers

VirtualBox allows exposing a paravirtualization interface to facilitate accurate and efficient execution of software within a virtual machine. These interfaces require the guest operating system to recognize their presence and make use of them in order to leverage the benefits of communicating with the VirtualBox hypervisor.

Most modern mainstream guest operating systems, including Windows and Linux, ship with support for one or more paravirtualization interfaces. Hence, there is typically no need to install additional software in the guest to take advantage of this feature.

Exposing a paravirtualization provider to the guest operating system does not rely on the choice of host platforms. For example, the Hyper-V paravirtualization provider can be used for VMs to run on any host platform (supported by VirtualBox) and not just Windows.

VirtualBox provides the following interfaces:

• Minimal: Announces the presence of a virtualized environment. Additionally, reports the TSC and APIC frequency to the guest operating system. This provider is mandatory for running any Mac OS X guests.

• KVM: Presents a Linux KVM hypervisor interface which is recognized by Linux kernels starting with version 2.6.25. VirtualBox’s implementation currently supports paravirtualized clocks and SMP spinlocks. This provider is recommended for Linux guests.

• Hyper-V: Presents a Microsoft Hyper-V hypervisor interface which is recognized by Windows 7 and newer operating systems. VirtualBox’s implementation currently supports paravirtualized clocks, APIC frequency reporting, guest debugging, guest crash reporting and relaxed timer checks. This provider is recommended for Windows guests.


VirtualBox版本更新录(202x)


官方主页:http://www.virtualbox.org/


该文章最后由 阿炯 于 2024-04-12 16:13:17 更新,目前是第 4 版。