VirtualBox

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

最後變更 在這個檔案從96301是 96301,由 vboxsync 提交於 3 年 前

doc: comment fixes

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

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