5 Virtual storage As the virtual machine will most probably expect to see a hard disk built into its virtual computer, VirtualBox must be able to present “real” storage to the guest as a virtual hard disk. There are presently three methods in which to achieve this: 1. Most commonly, VirtualBox will use large image files on a real hard disk and present them to a guest as a virtual hard disk. This is described in chapter 5.2, Disk image files (VDI, VMDK, VHD, HDD), page 73. 2. Alternatively, if you have iSCSI storage servers, you can attach such a server to VirtualBox as well this is described in chapter 5.10, iSCSI servers, page 82. 3. Finally, as an experimental feature, you can allow a virtual machine to access one of your host disks directly this advanced feature is described in chapter 9.7.1, Using a raw host hard disk from a guest, page 142. Each such virtual storage device (image file, iSCSI target or physical hard disk) will need to be connected to the virtual hard disk controller that VirtualBox presents to a virtual machine. This is explained in the next section. 5.1 Hard disk controllers: IDE, SATA (AHCI), SCSI, SAS In a real PC, hard disks and CD/DVD drives are connected to a device called hard disk controller which drives hard disk operation and data transfers. VirtualBox can emulate the four most common types of hard disk controllers typically found in today’s PCs: IDE, SATA (AHCI), SCSI and SAS.1 IDE (ATA) controllers have been in use since the 1980s. Initially, this type of interface worked only with hard disks, but was later extended to also support CD-ROM drives and other types of removable media. In physical PCs, this standard uses flat ribbon parallel cables with 40 or 80 wires. Each such cable can connect two devices to a controller, which have traditionally been called “master” and “slave”. Typical hard disk controllers have two connectors for such cables as a result, most PCs support up to four devices. In VirtualBox, each virtual machine has one IDE controller enabled by default, which gives you up to four virtual storage devices that you can attach to the machine. (By default, one of these four the secondary master is preconfigured to be the machine’s virtual CD/DVD drive, but this can be changed.2) So even if your guest operating system has no support for SCSI or SATA devices, it should always be able to see the default IDE controller that is enabled by default. You can also select which exact type of IDE controller hardware VirtualBox should present to the virtual machine (PIIX3, PIIX4 or ICH6). This makes no difference in terms of per- formance, but if you import a virtual machine from another virtualization product, the 1SATA support was added with VirtualBox 1.6 experimental SCSI support was added with 2.1 and fully implemented with 2.2. Generally, storage attachments were made much more flexible with VirtualBox 3.1 see below. Support for the LSI Logic SAS controller was added with VirtualBox 3.2. 2The assignment of the machine’s CD/DVD drive to the secondary master was fixed before VirtualBox 3.1 it is now changeable, and the drive can be at other slots of the IDE controller, and there can be more than one such drive. 71
Previous Page Next Page