• No results found

iSCSI servers

In document Oracle VM VirtualBox R User Manual (Page 86-90)

While buffering is a useful default setting for virtualizating a few machines on a desktop computer, there are some disadvantages to this approach:

1. Delayed writing through the host OS cache is less secure. When the guest OS writes data, it considers the data written even though it has not yet arrived on a physical disk. If for some reason the write does not happen (power failure, host crash), the likelihood of data loss increases.

2. Disk image files tend to be very large. Caching them can therefore quickly use up the entire host OS cache. Depending on the efficiency of the host OS caching, this may slow down the host immensely, especially if several VMs run at the same time. For example, on Linux hosts, host caching may result in Linux delaying all writes until the host cache is nearly full and then writing out all these changes at once, possibly stalling VM execution for minutes. This can result in I/O errors in the guest as I/O requests time out there.

3. Physical memory is often wasted as guest operating systems typically have their own I/O caches, which may result in the data being cached twice (in both the guest and the host caches) for little effect.

If you decide to disable host I/O caching for the above reasons, VirtualBox uses its own small cache to buffer writes, but no read caching since this is typically already performed by the guest OS. In addition, VirtualBox fully supports asynchronous I/O for its virtual SATA, SCSI and SAS controllers through multiple I/O threads.

Since asynchronous I/O is not supported by IDE controllers, for performance reasons, you may want to leave host caching enabled for your VM’s virtual IDE controllers.

For this reason, VirtualBox allows you to configure whether the host I/O cache is used for each I/O controller separately. Either uncheck the “Use host I/O cache” box in the “Storage” settings for a given virtual storage controller, or use the following VBoxManage command to disable the host I/O cache for a virtual storage controller:

VBoxManage storagectl <vm> --name <controllername> --hostiocache off

See chapter8.19,VBoxManage storagectl, page133for details.

For the above reasons also, VirtualBox now uses SATA controllers by default for new virtual machines.

5.8 Limiting bandwidth for disk images

Starting with version 4.0, VirtualBox allows for limiting the maximum bandwidth used for asyn- chronous I/O. Additionally it supports sharing limits through bandwidth groups for several im- ages. It is possible to have more than one such limit.

Limits are configured throughVBoxManage. The example below creates a bandwidth group named “Limit”, sets the limit to 20 MB/s and assigns the group to the attached disks of the VM:

VBoxManage bandwidthctl "VM name" add Limit --type disk --limit 20M

VBoxManage storageattach "VM name" --controller "SATA" --port 0 --device 0 --type hdd --medium disk1.vdi --bandwidthgroup Limit

VBoxManage storageattach "VM name" --controller "SATA" --port 1 --device 0 --type hdd --medium disk2.vdi --bandwidthgroup Limit

All disks in a group share the bandwidth limit, meaning that in the example above the band- width of both images combined can never exceed 20 MB/s. However, if one disk doesn’t require bandwidth the other can use the remaining bandwidth of its group.

The limits for each group can be changed while the VM is running, with changes being picked up immediately. The example below changes the limit for the group created in the example above to 10 MB/s:

VBoxManage bandwidthctl "VM name" set Limit --limit 10M

5.9 CD/DVD support

The virtual CD/DVD drive(s) by default support only reading. The medium configuration is changeable at runtime. You can select between three options to provide the medium data:

Host Drive defines that the guest can read from the medium in the host drive.

Image file (typically an ISO file) gives the guest read-only access to the data in the image.

Empty stands for a drive without an inserted medium.

Changing between the above, or changing a medium in the host drive that is accessed by a machine, or changing an image file will signal a medium change to the guest operating system, which can then react to the change (e.g. by starting an installation program).

Medium changes can be prevented by the guest, and VirtualBox reflects that by locking the host drive if appropriate. You can force a medium removal in such situations via the VirtualBox GUI or the VBoxManage command line tool. Effectively this is the equivalent of the emergency eject which many CD/DVD drives provide, with all associated side effects: the guest OS can issue error messages, just like on real hardware, and guest applications may misbehave. Use this with caution.

Note: The identification string of the drive provided to the guest (which, in the guest,

would be displayed by configuration tools such as the Windows Device Manager) is always “VBOX CD-ROM”, irrespective of the current configuration of the virtual drive. This is to prevent hardware detection from being triggered in the guest operating sys- tem every time the configuration is changed.

The standard CD/DVD emulation allows for reading standard data CD and DVD formats only. As an experimental feature, for additional capabilities, it is possible to give the guest direct access to the CD/DVD host drive by enabling “passthrough” mode. Depending on the host hardware, this may enable three things to work, potentially:

• CD/DVD writing from within the guest, if the host DVD drive is a CD/DVD writer; • playing audio CDs;

There is a “Passthrough” checkbox in the GUI dialog for configuring the media attached to a storage controller, or you can use the--passthroughoption withVBoxManage storageattach; see chapter8.18,VBoxManage storageattach, page131for details.

Even if pass-through is enabled, unsafe commands, such as updating the drive firmware, will be blocked. Video CD formats are never supported, not even in passthrough mode, and cannot be played from a virtual machine.

On Solaris hosts, pass-through requires running VirtualBox with real root permissions due to security measures enforced by the host.

5.10 iSCSI servers

iSCSI stands for “Internet SCSI” and is a standard that allows for using the SCSI protocol over Internet (TCP/IP) connections. Especially with the advent of Gigabit Ethernet, it has become affordable to attach iSCSI storage servers simply as remote hard disks to a computer network. In iSCSI terminology, the server providing storage resources is called an “iSCSI target”, while the client connecting to the server and accessing its resources is called “iSCSI initiator”.

VirtualBox can transparently present iSCSI remote storage to a virtual machine as a virtual hard disk. The guest operating system will not see any difference between a virtual disk image (VDI file) and an iSCSI target. To achieve this, VirtualBox has an integrated iSCSI initiator.

VirtualBox’s iSCSI support has been developed according to the iSCSI standard and should work with all standard-conforming iSCSI targets. To use an iSCSI target with VirtualBox, you must use the command line; see chapter8.18,VBoxManage storageattach, page131.

6 Virtual networking

As briefly mentioned in chapter3.8,Network settings, page52, VirtualBox provides up to eight virtual PCI Ethernet cards for each virtual machine. For each such card, you can individually select

1. the hardware that will be virtualized as well as

2. the virtualization mode that the virtual card will be operating in with respect to your physical networking hardware on the host.

Four of the network cards can be configured in the “Network” section of the settings dialog in the graphical user interface of VirtualBox. You can configure all eight network cards on the command line via VBoxManage modifyvm; see chapter8.8,VBoxManage modifyvm, page120.

This chapter explains the various networking settings in more detail.

6.1 Virtual networking hardware

For each card, you can individually select what kind of hardware will be presented to the virtual machine. VirtualBox can virtualize the following six types of networking hardware:

• AMD PCNet PCI II (Am79C970A);

• AMD PCNet FAST III (Am79C973, the default); • Intel PRO/1000 MT Desktop (82540EM); • Intel PRO/1000 T Server (82543GC); • Intel PRO/1000 MT Server (82545EM); • Paravirtualized network adapter (virtio-net).

The PCNet FAST III is the default because it is supported by nearly all operating systems out of the box, as well as the GNU GRUB boot manager. As an exception, the Intel PRO/1000 family adapters are chosen for some guest operating system types that no longer ship with drivers for the PCNet card, such as Windows Vista.

The Intel PRO/1000 MT Desktop type works with Windows Vista and later versions. The T Server variant of the Intel PRO/1000 card is recognized by Windows XP guests without additional driver installation. The MT Server variant facilitates OVF imports from other platforms.

The “Paravirtualized network adapter (virtio-net)“ is special. If you select this, then VirtualBox does not virtualize common networking hardware (that is supported by common guest operating systems out of the box). Instead, VirtualBox then expects a special software interface for virtualized environments to be provided by the guest, thus avoiding the complexity of emulating networking hardware and improving network performance. Starting with version 3.1, VirtualBox provides support for the industry-standard “virtio” networking drivers, which are part of the open-source KVM project.

The “virtio” networking drivers are available for the following guest operating systems: • Linux kernels version 2.6.25 or later can be configured to provide virtio support; some

• For Windows 2000, XP and Vista, virtio drivers can be downloaded and installed from the KVM project web page.1

VirtualBox also has limited support for so-calledjumbo frames, i.e. networking packets with

more than 1500 bytes of data, provided that you use the Intel card virtualization and bridged networking. In other words, jumbo frames are not supported with the AMD networking devices; in those cases, jumbo packets will silently be dropped for both the transmit and the receive direction. Guest operating systems trying to use this feature will observe this as a packet loss, which may lead to unexpected application behavior in the guest. This does not cause problems with guest operating systems in their default configuration, as jumbo frames need to be explicitly enabled.

In document Oracle VM VirtualBox R User Manual (Page 86-90)