Cannot access or use the CD-ROM drive/device on an ESX host
search cancel

Cannot access or use the CD-ROM drive/device on an ESX host

book

Article ID: 340483

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

  • You needed to boot the ESX host in the troubleshooting mode and the CD-ROM does not automatically mount.
  • When the host is in the troubleshooting mode, there is no entry for the CD-ROM in /dev.
  • You unintentionally or accidentally detached the local CD-ROM device
  • In the Configuration Tab > Storage pane > Device section, the CD-ROM device is greyed out and is in the unmounted state.
  • When the host is running normally, there is no /dev/cdrom entry or the existing /dev/cdrom entry is pointing to the wrong device on the host.
  • Attempting to connect a virtual machine CD-ROM to the CD-ROM of the host fails with the error:

    /dev/cdrom device unavailable


Environment

VMware ESX Server 3.0.x
VMware ESX 4.0.x
VMware ESX 4.1.x
VMware ESX Server 3.5.x

Resolution

This issue may occur due to one of these reasons:
  • When booting the ESX host in troubleshooting mode, the CD-ROM device entry ( /dev/cdrom) is not created automatically on the ESX host Service Console. This is an expected behavior as minimal services are loaded for troubleshooting purposes.
  • If the host is running normally, the device entry for the CD-ROM ( /dev/cdrom) may be pointing to the wrong device.

Accessing the host CD-ROM when the host in troubleshooting mode

Notes:

  • /dev/hdc is a device located on the IDE controller.
  • /dev/sr0 is a device located on the SCSI controller
  • /dev/cdrom is a symlink to either /dev/hdc or /dev/sr0. ESX hosts run a script that automatically sets up /dev/cdrom to be the correct device, thus using /dev/cdrom is appropriate.

To access the local host CD-ROM device when the host is in troubleshooting mode (also known as single user mode or runlevel 1):
  1. Ensure that a CD-ROM has been inserted in the CD-ROM drive.
  2. Run these commands to create the block device entry for the CDROM in /dev before attempting to mount the CD-ROM:

    # cd /dev
    # mknod -m660 sr0 b 11 0

  3. Run these commands to create a temporary mount point for the CD-ROM and mount the CD-ROM on the host:

    # mkdir /mnt/cd
    # mount /dev/sr0 /mnt/cd
    # cd /mnt/cd

    You should now be in the CD-ROM directory and should be able to access the media in it.

Accessing the host CD-ROM when the ESX host has booted normally

When the host has booted normally, it creates a device entry for the CD-ROM at /dev/cdrom. This should automatically mount the CD-ROM on the host when a disc is inserted into the drive.
In some cases, the /dev/cdrom entry may point to the incorrect device entry or have multiple device entries.

To manually mount the CD-ROM on the ESX host Service Console:
  1. Log in to the local Tech Support Mode console of the ESX host. For more information, see Unable to connect to an ESX host using Secure Shell (SSH) (1003807).
  2. Verify if the /dev/cdrom entry is pointing to a single entry or multiple entries.

    To check where the /dev/cdrom entry points to, run this command as root on the ESX console:

    # ls -l /dev/cdrom

    The output appears similar to:

    lrwxrwxrwx 1 root root 4 Mar 15 12:03 /dev/cdrom -> /dev/scd0

  3. Run this command to see the device entry that was assigned to the CD-ROM drive when the host booted:

    # dmesg |grep -i cdrom

    The output appears to be similar to:

    sr0: IDE CDROM Drive, ATAPI CD/DVD-ROM drive
    sr0: attached ide-cdrom driver.

    This output indicates that the correct device entry for the CD-ROM device is /dev/sr0.

  4. Run these commands to create a temporary mount point and mount the CD-ROM on the host:

    # mkdir /mnt/cd
    # mount /dev/sr0 /mnt/cd
    # cd /mnt/cd

    You should now be in the CD-ROM directory and should be able to access the media in it.

  5. After using the CD-ROM, you can unmount using these commands:

    # cd /
    # umount /mnt/cd

Additional Information

For translated versions of this article, see: