VirtualBox

source: vbox/trunk/doc/manual/en_US/user_Storage.xml@ 83876

Last change on this file since 83876 was 82952, checked in by vboxsync, 5 years ago

DOCS: number of SAS storage devices should be 255, not 8

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 64.3 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"[
4<!ENTITY % all.entities SYSTEM "all-entities.ent">
5%all.entities;
6]>
7<chapter id="storage">
8
9 <title>Virtual Storage</title>
10
11 <para>
12 As the virtual machine will most probably expect to see a hard disk
13 built into its virtual computer, &product-name; must be able to
14 present real storage to the guest as a virtual hard disk. There are
15 presently three methods by which to achieve this:
16 </para>
17
18 <itemizedlist>
19
20 <listitem>
21 <para>
22 &product-name; can use large image files on a real hard disk and
23 present them to a guest as a virtual hard disk. This is the most
24 common method, described in <xref linkend="vdidetails" />.
25 </para>
26 </listitem>
27
28 <listitem>
29 <para>
30 iSCSI storage servers can be attached to &product-name;. This is
31 described in <xref linkend="storage-iscsi" />.
32 </para>
33 </listitem>
34
35 <listitem>
36 <para>
37 You can allow a virtual machine to access one of your host disks
38 directly. This is an advanced feature, described in
39 <xref linkend="rawdisk" />.
40 </para>
41 </listitem>
42
43 </itemizedlist>
44
45 <para>
46 Each such virtual storage device, such as an image file, iSCSI
47 target, or physical hard disk, needs to be connected to the virtual
48 hard disk controller that &product-name; presents to a virtual
49 machine. This is explained in the next section.
50 </para>
51
52 <sect1 id="harddiskcontrollers">
53
54 <title>Hard Disk Controllers</title>
55
56 <para>
57 In a computing device, hard disks and CD/DVD drives are connected
58 to a device called hard disk controller which drives hard disk
59 operation and data transfers. &product-name; can emulate the most
60 common types of hard disk controllers typically found in computing
61 devices: IDE, SATA (AHCI), SCSI, SAS, USB-based, NVMe and
62 virtio-scsi mass storage devices.
63 </para>
64
65 <itemizedlist>
66
67 <listitem>
68 <para>
69 <emphasis role="bold">IDE (ATA)</emphasis> controllers are a
70 backwards-compatible yet very advanced extension of the disk
71 controller in the IBM PC/AT (1984). Initially, this interface
72 worked only with hard disks, but was later extended to also
73 support CD-ROM drives and other types of removable media. In
74 physical PCs, this standard uses flat ribbon parallel cables
75 with 40 or 80 wires. Each such cable can connect two devices
76 to a controller, which have traditionally been called
77 <emphasis>master</emphasis> and <emphasis>slave</emphasis>.
78 Typical PCs had two connectors for such cables. As a result,
79 support for up to four IDE devices was most common.
80 </para>
81
82 <para>
83 In &product-name;, each virtual machine may have one IDE
84 controller enabled, which gives you up to four virtual storage
85 devices that you can attach to the machine. By default, one of
86 these virtual storage devices, the secondary master, is
87 preconfigured to be the virtual machine's virtual CD/DVD
88 drive. However, you can change the default setting.
89 </para>
90
91 <para>
92 Even if your guest OS has no support for SCSI or SATA devices,
93 it should always be able to see an IDE controller.
94 </para>
95
96 <para>
97 You can also select which exact type of IDE controller
98 hardware &product-name; should present to the virtual machine:
99 PIIX3, PIIX4, or ICH6. This makes no difference in terms of
100 performance, but if you import a virtual machine from another
101 virtualization product, the OS in that machine may expect a
102 particular controller type and crash if it is not found.
103 </para>
104
105 <para>
106 After you have created a new virtual machine with the
107 <emphasis role="bold">New Virtual Machine</emphasis> wizard of
108 the graphical user interface, you will typically see one IDE
109 controller in the machine's
110 <emphasis role="bold">Storage</emphasis> settings. The virtual
111 CD/DVD drive will be attached to one of the four ports of this
112 controller.
113 </para>
114 </listitem>
115
116 <listitem>
117 <para>
118 <emphasis role="bold">Serial ATA (SATA)</emphasis> is a more
119 recent standard than IDE. Compared to IDE, it supports both
120 much higher speeds and more devices per controller. Also, with
121 physical hardware, devices can be added and removed while the
122 system is running. The standard interface for SATA controllers
123 is called Advanced Host Controller Interface (AHCI).
124 </para>
125
126 <para>
127 Like a real SATA controller, &product-name;'s virtual SATA
128 controller operates faster and also consumes fewer CPU
129 resources than the virtual IDE controller. Also, this enables
130 you to connect up to 30 virtual hard disks to one machine
131 instead of just three, when compared to the &product-name; IDE
132 controller with a DVD drive attached.
133 </para>
134
135 <para>
136 For this reason, depending on the selected guest OS,
137 &product-name; uses SATA as the default for newly created
138 virtual machines. One virtual SATA controller is created by
139 default, and the default disk that is created with a new VM is
140 attached to this controller.
141 </para>
142
143 <warning>
144 <para>
145 The entire SATA controller and the virtual disks attached to
146 it, including those in IDE compatibility mode, will not be
147 seen by OSes that do not have device support for AHCI. In
148 particular, <emphasis>there is no support for AHCI in
149 Windows versions before Windows Vista</emphasis>. Legacy
150 Windows versions such as Windows XP, even with SP3
151 installed, will not see such disks unless you install
152 additional drivers. It is possible to switch from IDE to
153 SATA after installation by installing the SATA drivers and
154 changing the controller type in the VM
155 <emphasis role="bold">Settings</emphasis> dialog.
156 </para>
157
158 <para>
159 &product-name; recommends the Intel Matrix Storage drivers,
160 which can be downloaded from
161 <ulink url="http://downloadcenter.intel.com/Product_Filter.aspx?ProductID=2101" />.
162 </para>
163 </warning>
164
165 <para>
166 To add a SATA controller to a machine for which it has not
167 been enabled by default, either because it was created by an
168 earlier version of &product-name;, or because SATA is not
169 supported by default by the selected guest OS, do the
170 following. Go to the <emphasis role="bold">Storage</emphasis>
171 page of the machine's
172 <emphasis role="bold">Settings</emphasis> dialog, click
173 <emphasis role="bold">Add Controller</emphasis> under the
174 Storage Tree box and then select <emphasis role="bold">Add
175 SATA Controller</emphasis>. The new controller appears as a
176 separate PCI device in the virtual machine, and you can add
177 virtual disks to it.
178 </para>
179
180 <para>
181 To change the IDE compatibility mode settings for the SATA
182 controller, see <xref linkend="vboxmanage-storagectl" />.
183 </para>
184 </listitem>
185
186 <listitem>
187 <para>
188 <emphasis role="bold">SCSI</emphasis> is another established
189 industry standard, standing for Small Computer System
190 Interface. SCSI is as a generic interface for data transfer
191 between all kinds of devices, including storage devices. SCSI
192 is still used for connecting some hard disks and tape devices,
193 but it has mostly been displaced in commodity hardware. It is
194 still in common use in high-performance workstations and
195 servers.
196 </para>
197
198 <para>
199 Primarily for compatibility with other virtualization
200 software, &product-name; optionally supports LSI Logic and
201 BusLogic SCSI controllers, to each of which up to fifteen
202 virtual hard disks can be attached.
203 </para>
204
205 <para>
206 To enable a SCSI controller, on the
207 <emphasis role="bold">Storage</emphasis> page of a virtual
208 machine's <emphasis role="bold">Settings</emphasis> dialog,
209 click <emphasis role="bold">Add Controller</emphasis> under
210 the Storage Tree box and then select <emphasis role="bold">Add
211 SCSI Controller</emphasis>. The new controller appears as a
212 separate PCI device in the virtual machine.
213 </para>
214
215 <warning>
216 <para>
217 As with the other controller types, a SCSI controller will
218 only be seen by OSes with device support for it. Windows
219 2003 and later ships with drivers for the LSI Logic
220 controller, while Windows NT 4.0 and Windows 2000 ships with
221 drivers for the BusLogic controller. Windows XP ships with
222 drivers for neither.
223 </para>
224 </warning>
225 </listitem>
226
227 <listitem>
228 <para>
229 <emphasis role="bold">Serial Attached SCSI (SAS)</emphasis> is
230 another bus standard which uses the SCSI command set. As
231 opposed to SCSI physical devices, serial cables are used
232 instead of parallel cables. This simplifies physical device
233 connections. In some ways, therefore, SAS is to SCSI what SATA
234 is to IDE: it enables more reliable and faster connections.
235 </para>
236
237 <para>
238 To support high-end guests which require SAS controllers,
239 &product-name; emulates a LSI Logic SAS controller, which can
240 be enabled much the same way as a SCSI controller. At this
241 time, up to 255 devices can be connected to the SAS
242 controller.
243 </para>
244
245 <warning>
246 <para>
247 As with SATA, the SAS controller will only be seen by OSes
248 with device support for it. In particular, <emphasis>there
249 is no support for SAS in Windows before Windows
250 Vista</emphasis>. So Windows XP, even SP3, will not see such
251 disks unless you install additional drivers.
252 </para>
253 </warning>
254 </listitem>
255
256 <listitem>
257 <para>
258 The <emphasis role="bold">USB mass storage device
259 class</emphasis> is a standard to connect external storage
260 devices like hard disks or flash drives to a host through USB.
261 All major OSes support these devices and ship generic drivers
262 making third-party drivers superfluous. In particular, legacy
263 OSes without support for SATA controllers may benefit from USB
264 mass storage devices.
265 </para>
266
267 <para>
268 The virtual USB storage controller offered by &product-name;
269 works differently to the other storage controller types. While
270 most storage controllers appear as a single PCI device to the
271 guest with multiple disks attached to it, the USB-based
272 storage controller does not appear as virtual storage
273 controller. Each disk attached to the controller appears as a
274 dedicated USB device to the guest.
275 </para>
276
277 <warning>
278 <para>
279 Booting from drives attached using USB is only supported
280 when EFI is used as the BIOS lacks USB support.
281 </para>
282 </warning>
283 </listitem>
284
285 <listitem>
286 <para>
287 <emphasis role="bold">Non volatile memory express
288 (NVMe)</emphasis> is a standard for connecting non volatile
289 memory (NVM) directly over PCI Express to lift the bandwidth
290 limitation of the previously used SATA protocol for
291 solid-state devices. Unlike other standards the command set is
292 very simple in order to achieve maximum throughput and is not
293 compatible with ATA or SCSI. OSes need to support NVMe devices
294 to make use of them. For example, Windows 8.1 added native
295 NVMe support. For Windows 7, native support was added with an
296 update.
297 </para>
298
299 <para>
300 The NVMe controller is part of the extension pack.
301 </para>
302
303 <warning>
304 <para>
305 Booting from drives attached using NVMe is only supported
306 when EFI is used as the BIOS lacks the appropriate driver.
307 </para>
308 </warning>
309 </listitem>
310
311 <listitem>
312 <para>
313 <emphasis role="bold">Virtual I/O Device SCSI</emphasis> is a
314 standard to connect virtual storage devices like hard disks or
315 optical drives to a VM. Recent Linux and Windows versions
316 support these devices (Windows needs additional drivers).
317 Currently the virtio-scsi controller is experimental.
318 </para>
319
320 <warning>
321 <para>
322 The virtio-scsi controller will only be seen by OSes with
323 device support for it. In particular, <emphasis>there is
324 no built-in support in Windows</emphasis>. So Windows will
325 not see such disks unless you install additional drivers.
326 </para>
327 </warning>
328 </listitem>
329
330 </itemizedlist>
331
332 <para>
333 In summary, &product-name; gives you the following categories of
334 virtual storage slots:
335 </para>
336
337 <itemizedlist>
338
339 <listitem>
340 <para>
341 Four slots attached to the traditional IDE controller, which
342 are always present. One of these is typically a virtual CD/DVD
343 drive.
344 </para>
345 </listitem>
346
347 <listitem>
348 <para>
349 30 slots attached to the SATA controller, if enabled and
350 supported by the guest OS.
351 </para>
352 </listitem>
353
354 <listitem>
355 <para>
356 15 slots attached to the SCSI controller, if enabled and
357 supported by the guest OS.
358 </para>
359 </listitem>
360
361 <listitem>
362 <para>
363 Up to 255 slots attached to the SAS controller, if enabled
364 and supported by the guest OS.
365 </para>
366 </listitem>
367
368 <listitem>
369 <para>
370 Eight slots attached to the virtual USB controller, if enabled
371 and supported by the guest OS.
372 </para>
373 </listitem>
374
375 <listitem>
376 <para>
377 Up to 255 slots attached to the NVMe controller, if enabled
378 and supported by the guest OS.
379 </para>
380 </listitem>
381
382 <listitem>
383 <para>
384 Up to 256 slots attached to the virtio-scsi controller, if enabled
385 and supported by the guest OS.
386 </para>
387 </listitem>
388
389 </itemizedlist>
390
391 <para>
392 Given this large choice of storage controllers, you may not know
393 which one to choose. In general, you should avoid IDE unless it is
394 the only controller supported by your guest. Whether you use SATA,
395 SCSI, or SAS does not make any real difference. The variety of
396 controllers is only supplied by &product-name; for compatibility
397 with existing hardware and other hypervisors.
398 </para>
399
400 </sect1>
401
402 <sect1 id="vdidetails">
403
404 <title>Disk Image Files (VDI, VMDK, VHD, HDD)</title>
405
406 <para>
407 Disk image files reside on the host system and are seen by the
408 guest systems as hard disks of a certain geometry. When a guest OS
409 reads from or writes to a hard disk, &product-name; redirects the
410 request to the image file.
411 </para>
412
413 <para>
414 Like a physical disk, a virtual disk has a size, or capacity,
415 which must be specified when the image file is created. As opposed
416 to a physical disk however, &product-name; enables you to expand
417 an image file after creation, even if it has data already. See
418 <xref linkend="vboxmanage-modifymedium" />.
419 </para>
420
421 <para>
422 &product-name; supports the following types of disk image files:
423 </para>
424
425 <itemizedlist>
426
427 <listitem>
428 <para>
429 <emphasis role="bold">VDI.</emphasis> Normally, &product-name;
430 uses its own container format for guest hard disks. This is
431 called a Virtual Disk Image (VDI) file. This format is used
432 when you create a new virtual machine with a new disk.
433 </para>
434 </listitem>
435
436 <listitem>
437 <para>
438 <emphasis role="bold">VMDK.</emphasis> &product-name; also
439 fully supports the popular and open VMDK container format that
440 is used by many other virtualization products, such as VMware.
441 </para>
442 </listitem>
443
444 <listitem>
445 <para>
446 <emphasis role="bold">VHD.</emphasis> &product-name; also
447 fully supports the VHD format used by Microsoft.
448 </para>
449 </listitem>
450
451 <listitem>
452 <para>
453 <emphasis role="bold">HDD.</emphasis> Image files of Parallels
454 version 2 (HDD format) are also supported.
455 </para>
456
457 <para>
458 Due to lack of documentation of the format, newer versions
459 such as 3 and 4 are not supported. You can however convert
460 such image files to version 2 format using tools provided by
461 Parallels.
462 </para>
463 </listitem>
464
465 </itemizedlist>
466
467 <para>
468 Irrespective of the disk capacity and format, as mentioned in
469 <xref linkend="gui-createvm" />, there are two options for
470 creating a disk image: fixed-size or dynamically allocated.
471 </para>
472
473 <itemizedlist>
474
475 <listitem>
476 <para>
477 <emphasis role="bold">Fixed-size.</emphasis> If you create a
478 fixed-size image, an image file will be created on your host
479 system which has roughly the same size as the virtual disk's
480 capacity. So, for a 10 GB disk, you will have a 10 GB file.
481 Note that the creation of a fixed-size image can take a long
482 time depending on the size of the image and the write
483 performance of your hard disk.
484 </para>
485 </listitem>
486
487 <listitem>
488 <para>
489 <emphasis role="bold">Dynamically allocated.</emphasis> For
490 more flexible storage management, use a dynamically allocated
491 image. This will initially be very small and not occupy any
492 space for unused virtual disk sectors, but will grow every
493 time a disk sector is written to for the first time, until the
494 drive reaches the maximum capacity chosen when the drive was
495 created. While this format takes less space initially, the
496 fact that &product-name; needs to expand the image file
497 consumes additional computing resources, so until the disk
498 file size has stabilized, write operations may be slower than
499 with fixed size disks. However, after a time the rate of
500 growth will slow and the average penalty for write operations
501 will be negligible.
502 </para>
503 </listitem>
504
505 </itemizedlist>
506
507 </sect1>
508
509 <sect1 id="vdis">
510
511 <title>The Virtual Media Manager</title>
512
513 <para>
514 &product-name; keeps track of all the hard disk, CD/DVD-ROM, and
515 floppy disk images which are in use by virtual machines. These are
516 often referred to as <emphasis>known media</emphasis> and come
517 from two sources:
518 </para>
519
520 <itemizedlist>
521
522 <listitem>
523 <para>
524 All media currently attached to virtual machines.
525 </para>
526 </listitem>
527
528 <listitem>
529 <para>
530 Registered media, for compatibility with legacy &product-name;
531 versions.
532 </para>
533 </listitem>
534
535 </itemizedlist>
536
537 <para>
538 The known media can be viewed and changed using the
539 <emphasis role="bold">Virtual Media Manager</emphasis>, which you
540 can access from the <emphasis role="bold">File</emphasis> menu in
541 the VirtualBox Manager window.
542 </para>
543
544 <figure id="fig-virtual-media-manager">
545 <title>The Virtual Media Manager</title>
546 <mediaobject>
547 <imageobject>
548 <imagedata align="center" fileref="images/virtual-disk-manager.png"
549 width="12cm" />
550 </imageobject>
551 </mediaobject>
552 </figure>
553
554 <para>
555 The known media are conveniently grouped in separate tabs for the
556 supported formats. These formats are:
557 </para>
558
559 <itemizedlist>
560
561 <listitem>
562 <para>
563 Hard disk images, either in &product-name;'s own Virtual Disk
564 Image (VDI) format, or in the third-party formats listed in
565 <xref linkend="vdidetails"/>.
566 </para>
567 </listitem>
568
569 <listitem>
570 <para>
571 CD/DVD images in standard ISO format.
572 </para>
573 </listitem>
574
575 <listitem>
576 <para>
577 Floppy images in standard RAW format.
578 </para>
579 </listitem>
580
581 </itemizedlist>
582
583 <para>
584 For each image, the Virtual Media Manager shows you the full path
585 of the image file and other information, such as the virtual
586 machine the image is currently attached to.
587 </para>
588
589 <para>
590 The Virtual Media Manager enables you to do the following:
591 </para>
592
593 <itemizedlist>
594
595 <listitem>
596 <para>
597 <emphasis role="bold">Add</emphasis> an image to the known
598 media.
599 </para>
600 </listitem>
601
602 <listitem>
603 <para>
604 <emphasis role="bold">Create</emphasis> a new disk image.
605 </para>
606
607 <itemizedlist>
608
609 <listitem>
610 <para>
611 For virtual hard disks, the <emphasis role="bold">Create
612 Virtual Hard Disk</emphasis> wizard is shown.
613 </para>
614 </listitem>
615
616 <listitem>
617 <para>
618 For optical disks, the <emphasis role="bold">VISO
619 Creator</emphasis> screen is shown. This enables you to
620 create a virtual ISO from selected files on the host.
621 </para>
622 </listitem>
623
624 <listitem>
625 <para>
626 For floppy disks, the <emphasis role="bold">Floppy Disk
627 Creator</emphasis> screen is shown.
628 </para>
629 </listitem>
630
631 </itemizedlist>
632 </listitem>
633
634 <listitem>
635 <para>
636 <emphasis role="bold">Copy</emphasis> an image to create
637 another one.
638 </para>
639
640 <para>
641 For virtual hard disks, you can specify one of the following
642 target types: VDI, VHD, or VMDK.
643 </para>
644 </listitem>
645
646 <listitem>
647 <para>
648 <emphasis role="bold">Move</emphasis> an image to another
649 location.
650 </para>
651
652 <para>
653 A file dialog prompts you for the new image file location.
654 </para>
655
656 <para>
657 When you use the Virtual Media Manager to move a disk image,
658 &product-name; updates all related configuration files
659 automatically.
660 </para>
661
662 <note>
663 <para>
664 Always use the Virtual Media Manager or the
665 <command>VBoxManage modifymedium</command> command to move a
666 disk image.
667 </para>
668
669 <para>
670 If you use a file management feature of the host OS to move
671 a disk image to a new location, run the <command>VBoxManage
672 modifymedium</command> <option>--setlocation</option>
673 command to configure the new path of the disk image on the
674 host file system. This command updates the &product-name;
675 configuration automatically.
676 </para>
677 </note>
678 </listitem>
679
680 <listitem>
681 <para>
682 <emphasis role="bold">Remove</emphasis> an image from the
683 known media. You can optionally delete the image file when
684 removing the image.
685 </para>
686 </listitem>
687
688 <listitem>
689 <para>
690 <emphasis role="bold">Release</emphasis> an image to detach it
691 from a VM. This action only applies if the image is currently
692 attached to a VM as a virtual hard disk.
693 </para>
694 </listitem>
695
696 <listitem>
697 <para>
698 <emphasis role="bold">Search</emphasis> for an image by name
699 or UUID.
700 </para>
701 </listitem>
702
703 <listitem>
704 <para>
705 View and edit the <emphasis role="bold">Properties</emphasis>
706 of a disk image.
707 </para>
708
709 <para>
710 Available properties include the following:
711 </para>
712
713 <itemizedlist>
714
715 <listitem>
716 <para>
717 <emphasis role="bold">Type:</emphasis> Specifies the
718 snapshot behavior of the disk. See
719 <xref linkend="hdimagewrites"/>.
720 </para>
721 </listitem>
722
723 <listitem>
724 <para>
725 <emphasis role="bold">Location:</emphasis> Specifies the
726 location of the disk image file on the host system. You
727 can use a file dialog to browse for the disk image
728 location.
729 </para>
730 </listitem>
731
732 <listitem>
733 <para>
734 <emphasis role="bold">Description:</emphasis> Specifies a
735 short description of the disk image.
736 </para>
737 </listitem>
738
739 <listitem>
740 <para>
741 <emphasis role="bold">Size:</emphasis> Specifies the size
742 of the disk image. You can use the slider to increase or
743 decrease the disk image size.
744 </para>
745 </listitem>
746
747 <listitem>
748 <para>
749 <emphasis role="bold">Information:</emphasis> Specifies
750 detailed information about the disk image.
751 </para>
752 </listitem>
753
754 </itemizedlist>
755 </listitem>
756
757 <listitem>
758 <para>
759 <emphasis role="bold">Refresh</emphasis> the property values
760 of the selected disk image.
761 </para>
762 </listitem>
763
764 </itemizedlist>
765
766 <para>
767 To perform these actions, highlight the medium in the Virtual
768 Media Manager and then do one of the following:
769 </para>
770
771 <itemizedlist>
772
773 <listitem>
774 <para>
775 Click an icon in the Virtual Media Manager task bar.
776 </para>
777 </listitem>
778
779 <listitem>
780 <para>
781 Right-click the medium and select an option.
782 </para>
783 </listitem>
784
785 </itemizedlist>
786
787 <para>
788 Use the <emphasis role="bold">Storage</emphasis> page in a VM's
789 <emphasis role="bold">Settings</emphasis> dialog to create a new
790 disk image. By default, disk images are stored in the VM's folder.
791 </para>
792
793 <para>
794 You can copy hard disk image files to other host systems and then
795 import them in to VMs from the host system. However, some Windows
796 guest OSes may require that you configure the new VM in a similar
797 way to the old one.
798 </para>
799
800 <note>
801 <para>
802 Do not simply make copies of virtual disk images. If you import
803 such a second copy into a VM, &product-name; issues an error
804 because &product-name; assigns a universally unique identifier
805 (UUID) to each disk image to ensure that it is only used one
806 time. See <xref linkend="cloningvdis" />. Also, if you want to
807 copy a VM to another system, use the &product-name; import and
808 export features. See <xref linkend="ovf" />.
809 </para>
810 </note>
811
812 </sect1>
813
814 <sect1 id="hdimagewrites">
815
816 <title>Special Image Write Modes</title>
817
818 <para>
819 For each virtual disk image supported by &product-name;, you can
820 determine separately how it should be affected by write operations
821 from a virtual machine and snapshot operations. This applies to
822 all of the aforementioned image formats (VDI, VMDK, VHD, or HDD)
823 and irrespective of whether an image is fixed-size or dynamically
824 allocated.
825 </para>
826
827 <para>
828 By default, images are in <emphasis>normal</emphasis> mode. To
829 mark an existing image with one of the non-standard modes listed
830 below, use <command>VBoxManage modifymedium</command>. See
831 <xref linkend="vboxmanage-modifymedium" />. Alternatively, use
832 <command>VBoxManage storageattach</command> to attach the image to
833 a VM and specify the <option>--mtype</option> argument. See
834 <xref linkend="vboxmanage-storageattach" />.
835 </para>
836
837 <para>
838 The available virtual disk image modes are as follows:
839 </para>
840
841 <itemizedlist>
842
843 <listitem>
844 <para>
845 <emphasis role="bold">Normal images</emphasis> have no
846 restrictions on how guests can read from and write to the
847 disk. This is the default image mode.
848 </para>
849
850 <para>
851 When you take a snapshot of your virtual machine as described
852 in <xref linkend="snapshots" />, the state of a normal hard
853 disk is recorded together with the snapshot, and when
854 reverting to the snapshot, its state will be fully reset.
855 </para>
856
857 <para>
858 The image file itself is not reset. Instead, when a snapshot
859 is taken, &product-name; <emphasis>freezes</emphasis> the
860 image file and no longer writes to it. For the write
861 operations from the VM, a second,
862 <emphasis>differencing</emphasis> image file is created which
863 receives only the changes to the original image. See
864 <xref linkend="diffimages"/>.
865 </para>
866
867 <para>
868 While you can attach the same normal image to more than one
869 virtual machine, only one of these virtual machines attached
870 to the same image file can be executed simultaneously, as
871 otherwise there would be conflicts if several machines write
872 to the same image file.
873 </para>
874 </listitem>
875
876 <listitem>
877 <para>
878 <emphasis role="bold">Write-through hard disks</emphasis> are
879 completely unaffected by snapshots. Their state is
880 <emphasis>not</emphasis> saved when a snapshot is taken, and
881 not restored when a snapshot is restored.
882 </para>
883 </listitem>
884
885 <listitem>
886 <para>
887 <emphasis role="bold">Shareable hard disks</emphasis> are a
888 variant of write-through hard disks. In principle they behave
889 exactly the same. Their state is <emphasis>not</emphasis>
890 saved when a snapshot is taken, and not restored when a
891 snapshot is restored. The difference only shows if you attach
892 such disks to several VMs. Shareable disks may be attached to
893 several VMs which may run concurrently. This makes them
894 suitable for use by cluster filesystems between VMs and
895 similar applications which are explicitly prepared to access a
896 disk concurrently. Only fixed size images can be used in this
897 way, and dynamically allocated images are rejected.
898 </para>
899
900 <warning>
901 <para>
902 This is an expert feature, and misuse can lead to data loss,
903 as regular filesystems are not prepared to handle
904 simultaneous changes by several parties.
905 </para>
906 </warning>
907 </listitem>
908
909 <listitem>
910 <para>
911 <emphasis role="bold">Immutable images</emphasis> only
912 remember write accesses temporarily while the virtual machine
913 is running. All changes are lost when the virtual machine is
914 powered on the next time. As a result, as opposed to Normal
915 images, the same immutable image can be used with several
916 virtual machines without restrictions.
917 </para>
918
919 <para>
920 Creating an immutable image makes little sense since it would
921 be initially empty and lose its contents with every machine
922 restart. You would have a disk that is always unformatted when
923 the machine starts up. Instead, you can first create a normal
924 image and then later mark it as immutable when you decide that
925 the contents are useful.
926 </para>
927
928 <para>
929 If you take a snapshot of a machine with immutable images,
930 then on every machine power-up, those images are reset to the
931 state of the last (current) snapshot, instead of the state of
932 the original immutable image.
933 </para>
934
935 <note>
936 <para>
937 As a special exception, immutable images are
938 <emphasis>not</emphasis> reset if they are attached to a
939 machine in a saved state or whose last snapshot was taken
940 while the machine was running. This is called an
941 <emphasis>online snapshot</emphasis>. As a result, if the
942 machine's current snapshot is an online snapshot, its
943 immutable images behave exactly like the a normal image. To
944 reenable the automatic resetting of such images, delete the
945 current snapshot of the machine.
946 </para>
947 </note>
948
949 <para>
950 &product-name; never writes to an immutable image directly at
951 all. All write operations from the machine are directed to a
952 differencing image. The next time the VM is powered on, the
953 differencing image is reset so that every time the VM starts,
954 its immutable images have exactly the same content.
955 </para>
956
957 <para>
958 The differencing image is only reset when the machine is
959 powered on from within &product-name;, not when you reboot by
960 requesting a reboot from within the machine. This is also why
961 immutable images behave as described above when snapshots are
962 also present, which use differencing images as well.
963 </para>
964
965 <para>
966 If the automatic discarding of the differencing image on VM
967 startup does not fit your needs, you can turn it off using the
968 <option>autoreset</option> parameter of <command>VBoxManage
969 modifymedium</command>. See
970 <xref linkend="vboxmanage-modifymedium"/>.
971 </para>
972 </listitem>
973
974 <listitem>
975 <para>
976 <emphasis role="bold">Multiattach mode images</emphasis> can
977 be attached to more than one virtual machine at the same time,
978 even if these machines are running simultaneously. For each
979 virtual machine to which such an image is attached, a
980 differencing image is created. As a result, data that is
981 written to such a virtual disk by one machine is not seen by
982 the other machines to which the image is attached. Each
983 machine creates its own write history of the multiattach
984 image.
985 </para>
986
987 <para>
988 Technically, a multiattach image behaves identically to an
989 immutable image except the differencing image is not reset
990 every time the machine starts.
991 </para>
992
993 <para>
994 This mode is useful for sharing files which are almost never
995 written, for instance picture galleries, where every guest
996 changes only a small amount of data and the majority of the
997 disk content remains unchanged. The modified blocks are stored
998 in differencing images which remain relatively small and the
999 shared content is stored only once at the host.
1000 </para>
1001 </listitem>
1002
1003 <listitem>
1004 <para>
1005 <emphasis role="bold">Read-only images</emphasis> are used
1006 automatically for CD/DVD images, since CDs/DVDs can never be
1007 written to.
1008 </para>
1009 </listitem>
1010
1011 </itemizedlist>
1012
1013 <para>
1014 The following scenario illustrates the differences between the
1015 various image modes, with respect to snapshots.
1016 </para>
1017
1018 <para>
1019 Assume you have installed your guest OS in your VM, and you have
1020 taken a snapshot. Later, your VM is infected with a virus and you
1021 would like to go back to the snapshot. With a normal hard disk
1022 image, you simply restore the snapshot, and the earlier state of
1023 your hard disk image will be restored as well and your virus
1024 infection will be undone. With an immutable hard disk, all it
1025 takes is to shut down and power on your VM, and the virus
1026 infection will be discarded. With a write-through image however,
1027 you cannot easily undo the virus infection by means of
1028 virtualization, but will have to disinfect your virtual machine
1029 like a real computer.
1030 </para>
1031
1032 <para>
1033 You might find write-through images useful if you want to preserve
1034 critical data irrespective of snapshots. As you can attach more
1035 than one image to a VM, you may want to have one immutable image
1036 for the OS and one write-through image for your data files.
1037 </para>
1038
1039 </sect1>
1040
1041 <sect1 id="diffimages">
1042
1043 <title>Differencing Images</title>
1044
1045 <para>
1046 The previous section mentioned differencing images and how they
1047 are used with snapshots, immutable images, and multiple disk
1048 attachments. This section describes in more detail how
1049 differencing images work.
1050 </para>
1051
1052 <para>
1053 A differencing image is a special disk image that only holds the
1054 differences to another image. A differencing image by itself is
1055 useless, it must always refer to another image. The differencing
1056 image is then typically referred to as a
1057 <emphasis>child</emphasis>, which holds the differences to its
1058 <emphasis>parent</emphasis>.
1059 </para>
1060
1061 <para>
1062 When a differencing image is active, it receives all write
1063 operations from the virtual machine instead of its parent. The
1064 differencing image only contains the sectors of the virtual hard
1065 disk that have changed since the differencing image was created.
1066 When the machine reads a sector from such a virtual hard disk, it
1067 looks into the differencing image first. If the sector is present,
1068 it is returned from there. If not, &product-name; looks into the
1069 parent. In other words, the parent becomes
1070 <emphasis>read-only</emphasis>. It is never written to again, but
1071 it is read from if a sector has not changed.
1072 </para>
1073
1074 <para>
1075 Differencing images can be chained. If another differencing image
1076 is created for a virtual disk that already has a differencing
1077 image, then it becomes a <emphasis>grandchild</emphasis> of the
1078 original parent. The first differencing image then becomes
1079 read-only as well, and write operations only go to the
1080 second-level differencing image. When reading from the virtual
1081 disk, &product-name; needs to look into the second differencing
1082 image first, then into the first if the sector was not found, and
1083 then into the original image.
1084 </para>
1085
1086 <para>
1087 There can be an unlimited number of differencing images, and each
1088 image can have more than one child. As a result, the differencing
1089 images can form a complex tree with parents, siblings, and
1090 children, depending on how complex your machine configuration is.
1091 Write operations always go to the one <emphasis>active</emphasis>
1092 differencing image that is attached to the machine, and for read
1093 operations, &product-name; may need to look up all the parents in
1094 the chain until the sector in question is found. You can view such
1095 a tree in the Virtual Media Manager.
1096 </para>
1097
1098 <figure id="fig-diff-images">
1099 <title>Differencing Images, Shown in Virtual Media Manager</title>
1100 <mediaobject>
1101 <imageobject>
1102 <imagedata align="center" fileref="images/virtual-disk-manager2.png"
1103 width="12cm" />
1104 </imageobject>
1105 </mediaobject>
1106 </figure>
1107
1108 <para>
1109 In all of these situations, from the point of view of the virtual
1110 machine, the virtual hard disk behaves like any other disk. While
1111 the virtual machine is running, there is a slight run-time I/O
1112 overhead because &product-name; might need to look up sectors
1113 several times. This is not noticeable however since the tables
1114 with sector information are always kept in memory and can be
1115 looked up quickly.
1116 </para>
1117
1118 <para>
1119 Differencing images are used in the following situations:
1120 </para>
1121
1122 <itemizedlist>
1123
1124 <listitem>
1125 <para>
1126 <emphasis role="bold">Snapshots.</emphasis> When you create a
1127 snapshot, as explained in the previous section, &product-name;
1128 <emphasis>freezes</emphasis> the images attached to the
1129 virtual machine and creates differencing images for each image
1130 that is not in <emphasis>write-through</emphasis> mode. From
1131 the point of view of the virtual machine, the virtual disks
1132 continue to operate before, but all write operations go into
1133 the differencing images. Each time you create another
1134 snapshot, for each hard disk attachment, another differencing
1135 image is created and attached, forming a chain or tree.
1136 </para>
1137
1138 <para>
1139 In the above screenshot, you see that the original disk image
1140 is now attached to a snapshot, representing the state of the
1141 disk when the snapshot was taken.
1142 </para>
1143
1144 <para>
1145 If you <emphasis>restore</emphasis> a snapshot, and want to go
1146 back to the exact machine state that was stored in the
1147 snapshot, the following happens:
1148 </para>
1149
1150 <itemizedlist>
1151
1152 <listitem>
1153 <para>
1154 &product-name; copies the virtual machine settings that
1155 were copied into the snapshot back to the virtual machine.
1156 As a result, if you have made changes to the machine
1157 configuration since taking the snapshot, they are undone.
1158 </para>
1159 </listitem>
1160
1161 <listitem>
1162 <para>
1163 If the snapshot was taken while the machine was running,
1164 it contains a saved machine state, and that state is
1165 restored as well. After restoring the snapshot, the
1166 machine will then be in Saved state and resume execution
1167 from there when it is next started. Otherwise the machine
1168 will be in Powered Off state and do a full boot.
1169 </para>
1170 </listitem>
1171
1172 <listitem>
1173 <para>
1174 For each disk image attached to the machine, the
1175 differencing image holding all the write operations since
1176 the current snapshot was taken is thrown away, and the
1177 original parent image is made active again. If you
1178 restored the root snapshot, then this will be the root
1179 disk image for each attachment. Otherwise, some other
1180 differencing image descended from it. This effectively
1181 restores the old machine state.
1182 </para>
1183 </listitem>
1184
1185 </itemizedlist>
1186
1187 <para>
1188 If you later <emphasis>delete</emphasis> a snapshot in order
1189 to free disk space, for each disk attachment, one of the
1190 differencing images becomes obsolete. In this case, the
1191 differencing image of the disk attachment cannot simply be
1192 deleted. Instead, &product-name; needs to look at each sector
1193 of the differencing image and needs to copy it back into its
1194 parent. This is called "merging" images and can be a
1195 potentially lengthy process, depending on how large the
1196 differencing image is. It can also temporarily need a
1197 considerable amount of extra disk space, before the
1198 differencing image obsoleted by the merge operation is
1199 deleted.
1200 </para>
1201 </listitem>
1202
1203 <listitem>
1204 <para>
1205 <emphasis role="bold">Immutable images.</emphasis> When an
1206 image is switched to immutable mode, a differencing image is
1207 created as well. As with snapshots, the parent image then
1208 becomes read-only, and the differencing image receives all the
1209 write operations. Every time the virtual machine is started,
1210 all the immutable images which are attached to it have their
1211 respective differencing image thrown away, effectively
1212 resetting the virtual machine's virtual disk with every
1213 restart.
1214 </para>
1215 </listitem>
1216
1217 </itemizedlist>
1218
1219 </sect1>
1220
1221 <sect1 id="cloningvdis">
1222
1223 <title>Cloning Disk Images</title>
1224
1225 <para>
1226 You can duplicate hard disk image files on the same host to
1227 quickly produce a second virtual machine with the same OS setup.
1228 However, you should <emphasis>only</emphasis> make copies of
1229 virtual disk images using the utility supplied with
1230 &product-name;. See <xref linkend="vboxmanage-clonemedium" />.
1231 This is because &product-name; assigns a UUID to each disk image,
1232 which is also stored inside the image, and &product-name; will
1233 refuse to work with two images that use the same number. If you do
1234 accidentally try to reimport a disk image which you copied
1235 normally, you can make a second copy using the <command>VBoxManage
1236 clonevm</command> command and import that instead.
1237 </para>
1238
1239 <para>
1240 Note that Linux distributions identify the boot hard disk from the
1241 ID of the drive. The ID &product-name; reports for a drive is
1242 determined from the UUID of the virtual disk image. So if you
1243 clone a disk image and try to boot the copied image the guest
1244 might not be able to determine its own boot disk as the UUID
1245 changed. In this case you have to adapt the disk ID in your boot
1246 loader script, for example
1247 <filename>/boot/grub/menu.lst</filename>. The disk ID looks like
1248 the following:
1249 </para>
1250
1251<screen>scsi-SATA_VBOX_HARDDISK_VB5cfdb1e2-c251e503</screen>
1252
1253 <para>
1254 The ID for the copied image can be determined as follows:
1255 </para>
1256
1257<screen>hdparm -i /dev/sda</screen>
1258
1259 </sect1>
1260
1261 <sect1 id="iocaching">
1262
1263 <title>Host Input/Output Caching</title>
1264
1265 <para>
1266 &product-name; can optionally disable the I/O caching that the
1267 host OS would otherwise perform on disk image files.
1268 </para>
1269
1270 <para>
1271 Traditionally, &product-name; has opened disk image files as
1272 normal files, which results in them being cached by the host OS
1273 like any other file. The main advantage of this is speed: when the
1274 guest OS writes to disk and the host OS cache uses delayed
1275 writing, the write operation can be reported as completed to the
1276 guest OS quickly while the host OS can perform the operation
1277 asynchronously. Also, when you start a VM a second time and have
1278 enough memory available for the OS to use for caching, large parts
1279 of the virtual disk may be in system memory, and the VM can access
1280 the data much faster.
1281 </para>
1282
1283 <para>
1284 Note that this applies only to image files. Buffering does not
1285 occur for virtual disks residing on remote iSCSI storage, which is
1286 the more common scenario in enterprise-class setups. See
1287 <xref linkend="storage-iscsi" />.
1288 </para>
1289
1290 <para>
1291 While buffering is a useful default setting for virtualizing a few
1292 machines on a desktop computer, there are some disadvantages to
1293 this approach:
1294 </para>
1295
1296 <itemizedlist>
1297
1298 <listitem>
1299 <para>
1300 Delayed writing through the host OS cache is less secure. When
1301 the guest OS writes data, it considers the data written even
1302 though it has not yet arrived on a physical disk. If for some
1303 reason the write does not happen, such as power failure or
1304 host crash, the likelihood of data loss increases.
1305 </para>
1306 </listitem>
1307
1308 <listitem>
1309 <para>
1310 Disk image files tend to be very large. Caching them can
1311 therefore quickly use up the entire host OS cache. Depending
1312 on the efficiency of the host OS caching, this may slow down
1313 the host immensely, especially if several VMs run at the same
1314 time. For example, on Linux hosts, host caching may result in
1315 Linux delaying all writes until the host cache is nearly full
1316 and then writing out all these changes at once, possibly
1317 stalling VM execution for minutes. This can result in I/O
1318 errors in the guest as I/O requests time out there.
1319 </para>
1320 </listitem>
1321
1322 <listitem>
1323 <para>
1324 Physical memory is often wasted as guest OSes typically have
1325 their own I/O caches, which may result in the data being
1326 cached twice, in both the guest and the host caches, for
1327 little effect.
1328 </para>
1329 </listitem>
1330
1331 </itemizedlist>
1332
1333 <para>
1334 If you decide to disable host I/O caching for the above reasons,
1335 &product-name; uses its own small cache to buffer writes, but no
1336 read caching since this is typically already performed by the
1337 guest OS. In addition, &product-name; fully supports asynchronous
1338 I/O for its virtual SATA, SCSI, and SAS controllers through
1339 multiple I/O threads.
1340 </para>
1341
1342 <para>
1343 Since asynchronous I/O is not supported by IDE controllers, for
1344 performance reasons, you may want to leave host caching enabled
1345 for your VM's virtual IDE controllers.
1346 </para>
1347
1348 <para>
1349 For this reason, &product-name; enables you to configure whether
1350 the host I/O cache is used for each I/O controller separately.
1351 Either select the <emphasis role="bold">Use Host I/O
1352 Cache</emphasis> check box in the
1353 <emphasis role="bold">Storage</emphasis> settings for a given
1354 virtual storage controller, or use the following
1355 <command>VBoxManage</command> command to disable the host I/O
1356 cache for a virtual storage controller:
1357 </para>
1358
1359<screen>VBoxManage storagectl "VM name" --name &lt;controllername&gt; --hostiocache off</screen>
1360
1361 <para>
1362 See <xref linkend="vboxmanage-storagectl" />.
1363 </para>
1364
1365 <para>
1366 For the above reasons, &product-name; uses SATA controllers by
1367 default for new virtual machines.
1368 </para>
1369
1370 </sect1>
1371
1372 <sect1 id="storage-bandwidth-limit">
1373
1374 <title>Limiting Bandwidth for Disk Images</title>
1375
1376 <para>
1377 &product-name; supports limiting of the maximum bandwidth used for
1378 asynchronous I/O. Additionally it supports sharing limits through
1379 bandwidth groups for several images. It is possible to have more
1380 than one such limit.
1381 </para>
1382
1383 <para>
1384 Limits are configured using <command>VBoxManage</command>. The
1385 example below creates a bandwidth group named Limit, sets the
1386 limit to 20 MB per second, and assigns the group to the attached
1387 disks of the VM:
1388 </para>
1389
1390<screen>VBoxManage bandwidthctl "VM name" add Limit --type disk --limit 20M
1391VBoxManage storageattach "VM name" --storagectl "SATA" --port 0 --device 0 --type hdd
1392 --medium disk1.vdi --bandwidthgroup Limit
1393VBoxManage storageattach "VM name" --storagectl "SATA" --port 1 --device 0 --type hdd
1394 --medium disk2.vdi --bandwidthgroup Limit</screen>
1395
1396 <para>
1397 All disks in a group share the bandwidth limit, meaning that in
1398 the example above the bandwidth of both images combined can never
1399 exceed 20 MBps. However, if one disk does not require bandwidth
1400 the other can use the remaining bandwidth of its group.
1401 </para>
1402
1403 <para>
1404 The limits for each group can be changed while the VM is running,
1405 with changes being picked up immediately. The example below
1406 changes the limit for the group created in the example above to 10
1407 MBps:
1408 </para>
1409
1410<screen>VBoxManage bandwidthctl "VM name" set Limit --limit 10M</screen>
1411
1412 </sect1>
1413
1414 <sect1 id="storage-cds">
1415
1416 <title>CD/DVD Support</title>
1417
1418 <para>
1419 Virtual CD/DVD drives by default support only reading. The medium
1420 configuration is changeable at runtime. You can select between the
1421 following options to provide the medium data:
1422 </para>
1423
1424 <itemizedlist>
1425
1426 <listitem>
1427 <para>
1428 <emphasis role="bold">Host Drive</emphasis> defines that the
1429 guest can read from the medium in the host drive.
1430 </para>
1431 </listitem>
1432
1433 <listitem>
1434 <para>
1435 <emphasis role="bold">Image file</emphasis> gives the guest
1436 read-only access to the data in the image. This is typically
1437 an ISO file.
1438 </para>
1439 </listitem>
1440
1441 <listitem>
1442 <para>
1443 <emphasis role="bold">Empty</emphasis> means a drive without
1444 an inserted medium.
1445 </para>
1446 </listitem>
1447
1448 </itemizedlist>
1449
1450 <para>
1451 Changing between the above, or changing a medium in the host drive
1452 that is accessed by a machine, or changing an image file will
1453 signal a medium change to the guest OS. The guest OS can then
1454 react to the change, for example by starting an installation
1455 program.
1456 </para>
1457
1458 <para>
1459 Medium changes can be prevented by the guest, and &product-name;
1460 reflects that by locking the host drive if appropriate. You can
1461 force a medium removal in such situations by using the VirtualBox
1462 Manager or the <command>VBoxManage</command> command line tool.
1463 Effectively this is the equivalent of the emergency eject which
1464 many CD/DVD drives provide, with all associated side effects. The
1465 guest OS can issue error messages, just like on real hardware, and
1466 guest applications may misbehave. Use this with caution.
1467 </para>
1468
1469 <note>
1470 <para>
1471 The identification string of the drive provided to the guest,
1472 displayed by configuration tools such as the Windows Device
1473 Manager, is always VBOX CD-ROM, irrespective of the current
1474 configuration of the virtual drive. This is to prevent hardware
1475 detection from being triggered in the guest OS every time the
1476 configuration is changed.
1477 </para>
1478 </note>
1479
1480 <para>
1481 The standard CD/DVD emulation enables reading of standard data CD
1482 and DVD formats only. As an experimental feature, for additional
1483 capabilities, it is possible to give the guest direct access to
1484 the CD/DVD host drive by enabling <emphasis>passthrough</emphasis>
1485 mode. Depending on the host hardware, this may potentially enable
1486 the following things to work:
1487 </para>
1488
1489 <itemizedlist>
1490
1491 <listitem>
1492 <para>
1493 CD/DVD writing from within the guest, if the host DVD drive is
1494 a CD/DVD writer
1495 </para>
1496 </listitem>
1497
1498 <listitem>
1499 <para>
1500 Playing audio CDs
1501 </para>
1502 </listitem>
1503
1504 <listitem>
1505 <para>
1506 Playing encrypted DVDs
1507 </para>
1508 </listitem>
1509
1510 </itemizedlist>
1511
1512 <para>
1513 To enable host drive passthrough you can use the
1514 <option>--passthrough</option> option of the <command>VBoxManage
1515 storageattach</command> command. See
1516 <xref linkend="vboxmanage-storageattach" />.
1517 </para>
1518
1519 <para>
1520 Even if passthrough is enabled, unsafe commands, such as updating
1521 the drive firmware, will be blocked. Video CD formats are never
1522 supported, not even in passthrough mode, and cannot be played from
1523 a virtual machine.
1524 </para>
1525
1526 <para>
1527 On Oracle Solaris hosts, passthrough requires running
1528 &product-name; with real root permissions due to security measures
1529 enforced by the host.
1530 </para>
1531
1532 </sect1>
1533
1534 <sect1 id="storage-iscsi">
1535
1536 <title>iSCSI Servers</title>
1537
1538 <para>
1539 iSCSI stands for <emphasis>Internet SCSI</emphasis> and is a
1540 standard that supports use of the SCSI protocol over Internet
1541 (TCP/IP) connections. Especially with the advent of Gigabit
1542 Ethernet, it has become affordable to attach iSCSI storage servers
1543 simply as remote hard disks to a computer network. In iSCSI
1544 terminology, the server providing storage resources is called an
1545 <emphasis>iSCSI target</emphasis>, while the client connecting to
1546 the server and accessing its resources is called an
1547 <emphasis>iSCSI initiator</emphasis>.
1548 </para>
1549
1550 <para>
1551 &product-name; can transparently present iSCSI remote storage to a
1552 virtual machine as a virtual hard disk. The guest OS will not see
1553 any difference between a virtual disk image (VDI file) and an
1554 iSCSI target. To achieve this, &product-name; has an integrated
1555 iSCSI initiator.
1556 </para>
1557
1558 <para>
1559 &product-name;'s iSCSI support has been developed according to the
1560 iSCSI standard and should work with all standard-conforming iSCSI
1561 targets. To use an iSCSI target with &product-name;, you must use
1562 the command line. See <xref linkend="vboxmanage-storageattach" />.
1563 </para>
1564
1565 </sect1>
1566
1567 <sect1 id="vboximg-mount">
1568
1569 <title>vboximg-mount: A Utility for FUSE Mounting a Virtual Disk Image</title>
1570
1571 <para>
1572 <command>vboximg-mount</command> is a command line utility for Mac
1573 OS and Linux hosts that provides raw access to an &product-name;
1574 virtual disk image on the host system. Use this utility to mount,
1575 view, and optionally modify the disk image contents.
1576 </para>
1577
1578 <para>
1579 The utility is based on Filesystem in Userspace (FUSE) technology
1580 and uses the VirtualBox runtime engine. Ensure that &product-name;
1581 is running on the host system.
1582 </para>
1583
1584 <note>
1585 <para>
1586 When using <command>vboximg-mount</command>, ensure that the
1587 following conditions apply:
1588 </para>
1589
1590 <itemizedlist>
1591
1592 <listitem>
1593 <para>
1594 The disk image is not being used by any other systems, such
1595 as by guest VMs.
1596 </para>
1597 </listitem>
1598
1599 <listitem>
1600 <para>
1601 No VMs are running on the host system.
1602 </para>
1603 </listitem>
1604
1605 </itemizedlist>
1606 </note>
1607
1608 <para>
1609 Raw access using FUSE is preferred over direct loopback mounting
1610 of virtual disk images, because it is snapshot aware. It can
1611 selectively merge disk differencing images in an exposed virtual
1612 hard disk, providing historical or up-to-date representations of
1613 the virtual disk contents.
1614 </para>
1615
1616 <para>
1617 <command>vboximg-mount</command> enables you to view information
1618 about registered VMs, their attached disk media, and any
1619 snapshots. Also, you can view partition information for a disk
1620 image.
1621 </para>
1622
1623 <para>
1624 The <command>vboximg-mount </command>command includes experimental
1625 read-only access to file systems inside a VM disk image. This
1626 feature enables you to extract some files from the disk image
1627 without starting the VM and without requiring third-party file
1628 system drivers on the host system. FAT, NTFS, ext2, ext3, and ext4
1629 file systems are supported.
1630 </para>
1631
1632 <para>
1633 Use the <option>--help</option> option to view information about
1634 the <command>vboximg-mount</command> command usage. The complete
1635 command reference is described in
1636 <xref linkend="man_vboximg-mount" />.
1637 </para>
1638
1639 <para>
1640 When <command>vboximg-mount</command> mounts an &product-name;
1641 disk image, it creates a one level deep file system at a mount
1642 point that you specify. The file system includes a device node
1643 that represents the synthesized disk image as a readable or
1644 readable-writeable bytestream. This bytestream can be mounted
1645 either by using the host OS or by using other FUSE-based file
1646 systems.
1647 </para>
1648
1649 <sect2 id="vboximg-mount-display">
1650
1651 <title>Viewing Detailed Information About a Virtual Disk Image</title>
1652
1653 <para>
1654 The following examples show how to use the
1655 <command>vboximg-mount</command> command to view information
1656 about virtual disk images.
1657 </para>
1658
1659 <para>
1660 The following command outputs detailed information about all
1661 registered VMs and associated snapshots:
1662 </para>
1663
1664<screen>$ vboximg-mount --list --verbose
1665
1666 ------------------------------------------------------
1667 VM Name: "macOS High Sierra 10.13"
1668 UUID: 3887d96d-831c-4187-a55a-567c504ff0e1
1669 Location: /Volumes/work/vm_guests/macOS High Sierra 10.13/macOS High Sierra 10.13.vbox
1670 -----------------------
1671 HDD base: "macOS High Sierra 10.13.vdi"
1672 UUID: f9ea7173-6869-4aa9-b487-68023a655980
1673 Location: /Volumes/work/vm_guests/macOS High Sierra 10.13/macOS High Sierra 10.13.vdi
1674
1675 Diff 1:
1676 UUID: 98c2bac9-cf37-443d-a935-4e879b70166d
1677 Location: /Volumes/work/vm_guests/macOS High Sierra 10.13/
1678 Snapshots/{98c2bac9-cf37-443d-a935-4e879b70166d}.vdi
1679 Diff 2:
1680 UUID: f401f381-7377-40b3-948e-3c61241b1a42
1681 Location: /Volumes/work/vm_guests/macOS High Sierra 10.13/
1682 Snapshots/{f401f381-7377-40b3-948e-3c61241b1a42}.vdi
1683 -----------------------
1684 HDD base: "simple_fixed_disk.vdi"
1685 UUID: ffba4d7e-1277-489d-8173-22ca7660773d
1686 Location: /Volumes/work/vm_guests/macOS High Sierra 10.13/simple_fixed_disk.vdi
1687
1688 Diff 1:
1689 UUID: aecab681-0d2d-468b-8682-93f79dc97a48
1690 Location: /Volumes/work/vm_guests/macOS High Sierra 10.13/
1691 Snapshots/{aecab681-0d2d-468b-8682-93f79dc97a48}.vdi
1692 Diff 2:
1693 UUID: 70d6b34d-8422-47fa-8521-3b6929a1971c
1694 Location: /Volumes/work/vm_guests/macOS High Sierra 10.13/
1695 Snapshots/{70d6b34d-8422-47fa-8521-3b6929a1971c}.vdi
1696 ------------------------------------------------------
1697 VM Name: "debian"
1698 UUID: 5365ab5f-470d-44c0-9863-dad532ee5905
1699 Location: /Volumes/work/vm_guests/debian/debian.vbox
1700 -----------------------
1701 HDD base: "debian.vdi"
1702 UUID: 96d2e92e-0d4e-46ab-a0f1-008fdbf997e7
1703 Location: /Volumes/work/vm_guests/debian/ol7.vdi
1704
1705 Diff 1:
1706 UUID: f9cc866a-9166-42e9-a503-bbfe9b7312e8
1707 Location: /Volumes/work/vm_guests/debian/Snapshots/
1708 {f9cc866a-9166-42e9-a503-bbfe9b7312e8}.vdi</screen>
1709
1710 <para>
1711 The following command outputs partition information about the
1712 specified disk image:
1713 </para>
1714
1715<screen>$ vboximg-mount --image=f9ea7173-6869-4aa9-b487-68023a655980 --list
1716
1717 Virtual disk image:
1718
1719 Path: /Volumes/work/vm_guests/macOS High Sierra 10.13/macOS High Sierra 10.13.vdi
1720 UUID: f9ea7173-6869-4aa9-b487-68023a655980
1721
1722 # Start Sectors Size Offset Type
1723 1 40 409599 199.9M 20480 EFI System
1724 2 409640 67453071 32.1G 209735680 Hierarchical File System Plus (HFS+)
1725 3 67862712 1269535 107.8M 34745708544 Apple Boot (Recovery HD)</screen>
1726
1727 </sect2>
1728
1729 <sect2 id="vboximg-mount-steps">
1730
1731 <title>Mounting a Virtual Disk Image</title>
1732
1733 <para>
1734 The following steps show how to use the
1735 <command>vboximg-mount</command> command to mount a partition of
1736 a virtual disk image on the host OS.
1737 </para>
1738
1739 <orderedlist>
1740
1741 <listitem>
1742 <para>
1743 Create a mount point on the host OS. For example:
1744 </para>
1745
1746<screen>$ mkdir macos_sysdisk</screen>
1747 </listitem>
1748
1749 <listitem>
1750 <para>
1751 Show partition information about the virtual disk image.
1752 </para>
1753
1754<screen>$ vboximg-mount --image=<replaceable>uuid</replaceable> --list</screen>
1755
1756 <para>
1757 where <replaceable>uuid</replaceable> is the UUID of the
1758 disk image.
1759 </para>
1760 </listitem>
1761
1762 <listitem>
1763 <para>
1764 Use <command>vboximg-mount</command> to perform a FUSE mount
1765 of a partition on the virtual disk image. For example:
1766 </para>
1767
1768<screen>$ vboximg-mount --image=<replaceable>uuid</replaceable> -p 2 macos_sysdisk</screen>
1769
1770 <para>
1771 where <replaceable>uuid</replaceable> is the UUID for the
1772 disk image.
1773 </para>
1774
1775 <para>
1776 In this example, partition 2 is mounted on the
1777 <filename>macos_sysdisk</filename> mount point. The mount
1778 includes all snapshots for the disk image.
1779 </para>
1780 </listitem>
1781
1782 <listitem>
1783 <para>
1784 Use the host OS to mount the <literal>vhdd</literal> device
1785 node. The FUSE-mounted device node represents the virtual
1786 disk image.
1787 </para>
1788
1789<screen>$ ls macos_sysdisk
1790 macOS High Sierra 10.13.vdi vhdd
1791$ sudo mount macos_sysdisk/vhdd /mnt</screen>
1792 </listitem>
1793
1794 </orderedlist>
1795
1796 </sect2>
1797
1798 </sect1>
1799
1800</chapter>
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette