Virtual Disks in Oracle VirtualBox
Learn how Oracle VirtualBox virtual disks work, including image files, iSCSI targets, physical disks, and virtual storage controllers.
A guest operating system needs persistent storage for its operating system, applications, personal files, and configuration. In Oracle VirtualBox, a virtual disk is a storage device presented to the guest as if it were a physical hard drive.
The guest normally interacts with the disk device exposed by VirtualBox. It does not access the host's ordinary filesystem directly. VirtualBox manages the connection between the guest-visible disk and the storage resource that supplies the disk's data.
What Is a Virtual Disk?
A virtual disk is a storage device exposed to a guest virtual machine as a hard drive. The guest can partition it, format it, install an operating system on it, and store files on it just as it would with a physical disk.
For example, when installing Linux or Windows in a new VM, the installer looks for a hard disk. A VirtualBox virtual disk provides that disk. The guest may display it using a device name such as a disk device, but the exact name depends on the guest operating system and the selected virtual controller.
What the virtual disk contains
- The guest operating system and its boot data.
- Applications installed in the guest.
- User files and application data.
- Guest configuration files and filesystem metadata.
- Partitions, filesystems, and unused disk space created by the guest.
VirtualBox does not replace the guest's normal storage management. The guest still creates partitions and filesystems inside the disk it receives. VirtualBox supplies and presents the device; the guest operating system uses that device.
Guest Storage and Host Storage
The host is the physical computer on which VirtualBox runs. The guest is the virtual computer and operating system running inside VirtualBox. The guest-visible virtual disk and the host-side resource containing its data are different concepts.
VirtualBox maps a guest-visible hard disk to a storage resource available from the host environment. That resource might be a file on a host filesystem, a network-provided block-storage target, or a physical disk accessed directly.
- Guest view: The guest sees a hard-drive device connected to a virtual controller.
- VirtualBox configuration: VirtualBox records which disk is attached and which controller and port present it to the guest.
- Backing storage: The underlying file, iSCSI target, or physical disk supplies the actual disk data.
- Host or storage environment: The host filesystem, local device, or separate iSCSI server stores or provides that data.
Storage Components and Their Roles
Virtual Disk Backing Options
Backing storage means the resource underneath a guest-visible virtual disk. VirtualBox supports several conceptual approaches.
Disk Image Files
A disk image file is a host-side file that stores the contents of a guest virtual hard disk. Although it is an ordinary file from the host's point of view, VirtualBox presents its contents to the guest as a block storage device.
This is the normal backing approach for most virtual machines. During VM creation, you can create a virtual hard disk image, choose where it is stored, and attach it to the VM. The guest then sees an attached hard disk rather than a file in the host's folders.
Disk image files are convenient because they can generally be managed with normal host storage tools, subject to VirtualBox's requirements. You should still maintain enough free space on the host and protect the image file from accidental deletion while the VM needs it.
Standard desktop example
A new VM has a virtual hard disk backed by an image file on the host's local drive. The image is attached to an available port on the VM's configured storage controller. During operating-system installation, the installer detects the virtual disk and creates the guest's partitions and filesystem on it.
In this example, the image file describes where the disk data resides. It does not by itself describe how the guest communicates with the disk. That second responsibility belongs to the virtual storage controller.
iSCSI-Backed Storage
iSCSI is a protocol for providing block storage from a network storage server to a client. An iSCSI target is the storage resource offered by that server. Unlike a file share, block storage is presented to the client as a disk-like resource.
VirtualBox can attach an available iSCSI target and expose it to a guest as a disk. This provides an alternative when VM storage is supplied by a separate storage server rather than stored solely in a local image file.
Network-provided VM example
An administrator configures a VM to use an iSCSI target supplied by a storage server. The guest receives the target as a virtual hard disk through its configured storage controller. The disk data is provided by the network storage environment instead of a disk image stored on the local host.
Using iSCSI requires more planning than using a local image file. The storage server must be reachable, the intended target must be available, and the connection details must be correct. Network availability can affect whether the disk can be attached or used.
Raw or Direct Physical-Disk Access
With direct physical-disk access, a VM is configured to access a selected physical disk on the host directly rather than using a normal disk image file. This is an advanced storage arrangement.
Before using it, identify exactly which host disk is being exposed. A mistake can expose the wrong device, make data available to the wrong operating system, or cause conflicting access if both host and guest attempt to use the disk at the same time.
Advanced direct-disk example
An administrator grants a VM access to a selected physical host disk. The disk is attached to a virtual controller, and the guest uses it as a hard drive. Before starting the VM, the administrator verifies the exact host device and reviews whether the host must avoid using that disk while the guest is running.
Virtual Disks and Storage Controllers
Every virtual storage device must be attached to a storage controller presented to the virtual machine. A controller is the guest-visible hardware interface through which the guest communicates with a disk.
A virtual hard disk controller emulates a hardware storage-controller interface. The guest operating system detects that interface and uses its storage driver to communicate with attached disks.
The backing type and controller are related, but they are distinct choices:
- The backing type answers: Where does the disk data come from? It may come from a disk image file, an iSCSI target, or a physical disk.
- The controller answers: How is the disk presented to the guest? The disk is connected to a selected virtual controller and an available port.
For example, a file-backed disk and an iSCSI-backed disk are different backing resources, but both can be presented to a guest through an appropriate virtual storage controller.
Controller standards
Disk controllers follow hardware interface standards. VirtualBox supports commonly used virtual disk controller standards so that guest operating systems can communicate with virtual disks using familiar storage interfaces. The best controller depends on guest support, compatibility needs, and the storage configuration.
Controller selection and configuration are the next storage subject to study. See virtual hard disk controllers for controller-specific configuration concepts.
Configure a Virtual Disk in VirtualBox Manager
- Open the virtual machine's Storage settings.
- Add or select a virtual storage controller.
- Attach a virtual disk to an available controller port.
- Choose the backing source: a disk image file, an iSCSI target, or direct physical-disk access.
- Verify that the intended disk appears beneath the intended controller.
- Confirm that the guest has a disk attached before beginning operating-system installation. For installation guidance, see installing a guest operating system.
Configuration checks
- Identify the underlying storage resource associated with each guest-visible disk.
- Verify the controller to which each disk is attached.
- Verify the controller port and attachment state.
- For iSCSI, confirm that the storage server and intended target are available.
- For direct physical-disk access, verify the exact host device selected.
Troubleshooting Virtual Disk Attachments
The guest installer reports that no hard disk is available
Likely causes include:
- No virtual disk has been created or attached.
- A disk exists but is not connected to a virtual storage controller.
- The disk is attached to an unexpected controller or port.
Inspect the VM's Storage settings. Confirm that a disk appears beneath a configured controller and that its backing storage is accessible.
A network-backed disk cannot be used
Possible causes include an unavailable iSCSI target, missing network access to the storage server, or incorrect target details.
- Confirm connectivity to the iSCSI storage server.
- Confirm that the intended iSCSI target is available.
- Review the VM's configured storage attachment and target information.
A direct physical-disk configuration behaves unexpectedly
Possible causes include selecting the wrong host disk, conflicting host and guest access, or treating direct access like an ordinary image-file disk.
- Identify the selected physical disk carefully.
- Review host and guest access expectations before making changes.
- Check whether the host is using the same disk while the VM is running.
- Prefer a normal disk image when direct access is not required.
Key Points to Remember
- A virtual disk is a hard-drive device presented to the guest operating system.
- The guest sees a disk device, not the host's ordinary filesystem.
- A disk image file is the usual backing method for most VMs.
- An iSCSI target provides network-backed block storage.
- Direct physical-disk access is advanced and requires careful device identification.
- Backing storage and the virtual storage controller are separate configuration concepts.
- Every virtual disk must be attached to a virtual storage controller and an available port.