# IDVDDrive Interface Reference

The IDVDDrive interface represents the virtual CD/DVD drive of the virtual machine. More...

List of all members.

## Public Member Functions
void | mountImage (in wstring imageId)
| Mounts a CD/DVD image with the specified UUID.
void | captureHostDrive (in IHostDVDDrive drive)
| Captures the specified host CD/DVD drive.
void | unmount ()
| Unmounts the currently mounted image or host drive.
void | getImage ([retval] out IDVDImage image)
| Returns the currently mounted CD/DVD image.
void | getHostDrive ([retval] out IHostDVDDrive drive)
| Returns the currently mounted host CD/DVD drive.
## Public Attributes
readonly attribute DriveState | state
| Current drive state.
attribute boolean | passthrough
| When a host drive is mounted and passthrough is enabled the guest OS will be able to directly send SCSI commands to the host drive.

## Detailed Description

The IDVDDrive interface represents the virtual CD/DVD drive of the virtual machine.

An object of this type is returned by IMachine::DVDDrive.

Interface ID:
  `{156944D1-4C6D-4812-8F12-AB3890767AB4}`

## Member Function Documentation

void IDVDDrive::mountImage | ( | in wstring | imageId | ) |

Mounts a CD/DVD image with the specified UUID.

Expected result codes:

  VBOX_E_FILE_ERROR | Invalid image file location.
  VBOX_E_OBJECT_NOT_FOUND | Could not find a CD/DVD image matching imageId.
  VBOX_E_INVALID_OBJECT_STATE | Invalid media state.

void IDVDDrive::captureHostDrive | ( | in IHostDVDDrive | drive | ) |

Captures the specified host CD/DVD drive.

void IDVDDrive::unmount | ( |  | ) |

Unmounts the currently mounted image or host drive.

void IDVDDrive::getImage | ( | [retval] out IDVDImage | image | ) |

Returns the currently mounted CD/DVD image.

void IDVDDrive::getHostDrive | ( | [retval] out IHostDVDDrive | drive | ) |

Returns the currently mounted host CD/DVD drive.

## Member Data Documentation

readonly attribute DriveState IDVDDrive::state

Current drive state.

attribute boolean IDVDDrive::passthrough

When a host drive is mounted and passthrough is enabled the guest OS will be able to directly send SCSI commands to the host drive.

This enables the guest OS to use CD/DVD writers but is potentially dangerous.