Sun Microsystems VERSION 3.1.0_BETA2 user manual Cloning disk images

Models: VERSION 3.1.0_BETA2

1 283
Download 283 pages 42.34 Kb
Page 85
Image 85

5Virtual storage

5.6Cloning disk images

You can duplicate hard disk image files on the same host to quickly produce a second virtual machine with the same operating system setup. However, you should only make copies of virtual disk images using the utility supplied with VirtualBox; see chapter 8.17, VBoxManage clonehd, page 127. This is because VirtualBox assigns a unique identity number (UUID) to each disk image, which is also stored inside the image, and VirtualBox will refuse to work with two images that use the same number. If you do accidentally try to reimport a disk image which you copied normally, you can make a second copy using VirtualBox’s utility and import that instead.

Note that newer Linux distributions identify the boot hard disk from the ID of the drive. The ID VirtualBox reports for a drive is determined from the UUID of the virtual disk image. So if you clone a disk image and try to boot the copied image the guest might not be able to determine its own boot disk as the UUID changed. In this case you have to adapt the disk ID in your boot loader script (for example /boot/grub/menu.lst). The disk ID looks like this:

scsi-SATA_VBOX_HARDDISK_VB5cfdb1e2-c251e503

The ID for the copied image can be determined with

hdparm -i /dev/sda

5.7 Writing CDs and DVDs using the host drive

When you attach your host’s CD/DVD drive to a virtual machine (see chapter 3.6, Storage settings, page 51), this normally gives the machine read-only access to the host drive. This prevents the guest from writing to the host drive. In particular, you cannot burn CDs and DVDs from the guest this way.

As an experimental feature (which currently works for data only, audio is not sup- ported), it is possible to give the guest access to the CD/DVD writing features of the host drive (if available):

VBoxManage storageattach <uuidvmname> --storagectl <name> --port <number> --device <number>

[--type <dvddrivehddfdd>

--medium <noneemptydriveuuidfilenamehost:<drive>>] [--passthrough <onoff>]

[--forceunmount]

See also chapter 8.13, VBoxManage storagectl / storageattach, page 123.

Even if pass-through is enabled, unsafe commands, such as updating the drive firmware, will be blocked.

85

Page 85
Image 85
Sun Microsystems VERSION 3.1.0_BETA2 user manual Cloning disk images, Writing CDs and DVDs using the host drive