Hypervisors are a type of software that manage virtual machines which are, in theory, emulated PCs. Thus, hypervisors can be seen as a type of emulator, in which one system pretends to be another by translating its code into something that can be executed.
Because the IBM PC's architecture, x86, is a complex instruction set by design, it is able to do complex operations that allow it to efficiently emulate other platforms. But how about x86 itself?
In x86, software runs in privilege levels (often called rings) and are organized by the operating system. Operating systems will often run their portion of the code (the kernel) in as low of a level as possible so that it can effectively manage the system and the userspace-- ring 0, thus referred to as the kernel mode. Standard software (like executable files you download from websites) run in ring 3, referred to as the user mode.
VirtualBox virtualizes x86 and does very little emulation of the user mode; instead of translating every instruction on-the-fly, it emulates ring 0 by relocating the virtual kernel code to ring 1 and traps instructions when the kernel or software calls for I/O access (i.e. drivers). There are other specific situations that the developers had to work around, but the rest of the software runs almost unmodified, allowing for near-bare-metal performance of software in many cases.
VirtualBox uses code based on QEMU, but it is not a QEMU fork. QEMU has KVM which allows for it to employ similar practices to VirtualBox, but it also targets a wide variety of platforms outside of x86 (such as PowerPC, ARM, and SPARC) that VirtualBox does not.
Hosts emulating Guests[edit | edit source]
In the context of virtualization, your main computer is called the host. It has access to physical components like the monitor, the keyboard and mouse, and the hard disk. When running an operating system in VirtualBox, a guest does not have that same access. It's instead replaced with virtual components that are managed by the hypervisor and the OS kernel, like virtual hard disks on the filesystem. VirtualBox allows you to interface with the guest using an emulated keyboard, mouse, and monitor that's as close to generic as possible so that the operating system has the correct drivers. If those drivers are not part of the operating system, VirtualBox will also include Guest Additions that install integrations with the host like clipboard sharing and dynamic resolutions (where the OS will resize the display to the window).
Host CPU requirements[edit | edit source]
SSE2 (Streaming SIMD Extensions 2) support is required for host CPUs in order for VirtualBox to work.
Virtual Media[edit | edit source]
Within VirtualBox you will encounter the Virtual Media Manager. This is a list of disks VirtualBox has previously used with guests. The three types-- hard disks, optical disks, and floppy disks-- are memorized and grouped by the manager, and can be removed or copied if needed. When these images cannot be detected at the program's start, it will notify the user.
The list of supported hard drive formats are:
VDI(Virtual Disk Image): VirtualBox's native format.
VMDK(Virtual Machine DisK): Designed by VMware.
VHD(Virtual Hard Disk): Previously Connectix's format for Virtual PC, but now used by Microsoft. On a Windows host, these files can be mounted natively in the Disk Management utility.[note 1]
VHDX(Virtual Hard Disk Extended): Microsoft's format for Hyper-V.
HDD(Hard Disk Drive): Parallels' native format. VirtualBox does not support versions newer than 2, citing lack of documentation on the format. Parallels includes utilities to downgrade the format, however.
QCOW(Quick Copy-On-Write): Previously QEMU's native format; it's since been succeeded by QCOW2. QCOW2 support is read-only in VirtualBox.
QED: An experimental successor to QCOW that has since been deprecated. Support is only included for compatibility with existing images, and it is recommend to convert to another format.
Floppy disks are a special case as they hold a low amount of data and thus, do not need a special image format to save disk space or speed up the machine.
There are two file extensions,
IMG, that are often used, but the amount of distinctions between these types are almost entirely zero. Floppy disk images are actually raw formats, as they completely preserve the data of the disk but not the physical aspects.
Dynamic Allocation and Compacting[edit | edit source]
Dynamic allocation is used in situations where saving space is crucial to your workflow, in which the image uses less space on the disk than it is assigned.
When you delete a file on any computer, the hard disk doesn't actually wipe its sectors (bigger files would take longer to delete if that was the case). Instead, it marks the sectors where the data was stored as overwritable, so that the space is freed. This explains why data recovery is possible; recovery software will search through "empty" sectors for data. To cut down the size of a virtual disk, you need software that will write null values to the empty sectors so that it becomes redundant, thus becoming a pattern that can be compressed. Disks can be compacted using the CLI tool
The Files[edit | edit source]
The files for your VirtualBox VMs can be found at:
You can quickly access a VM's folder by right-clicking on it from VirtualBox and selecting "Show in File Manager".[note 2]
The barebones components of a guest's folder includes:
- A .
vboxfile. This makes up all the details of the system itself, such as the specs, which images and devices are routed where, etc.
- A hard disk image
Other components may include:
- A .
vbox-prevfile. This is a backup copy of the .
- A Logs folder. This contains logs of the machine in case anything goes wrong.
- A Snapshots folder. This contains snapshots.
Notes[edit | edit source]
- On Windows 7 and newer only.
- On Windows, this is called Windows Explorer.