Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I connect/disconnect a CDROM drive from a virtual machine from the command-line? I don't see anything in the VIX reference.

share|improve this question

You can do this with the vmware-vim-cmd line tool. For example, if your VM is vmid 112, and the CDROM deviceKey is 3002, the command will be:

vmware-vim-cmd vmsvc/device.connection 112 3002 true

You can discover the vmid with the command:

vmware-vim-cmd vmsvc/getallvms

Then you can find the device ID with the command:

vmware-vim-cmd vmsvc/device.getdevices <vmid>
share|improve this answer
On my VMWare Server 2.0 installation on a Windows Server 2003 machine, I can't find vmware-vim-cmd. Which directory is it installed in by default? – ristonj Sep 27 '11 at 21:23
I'm not sure, I don't have a Windows machine with Server installed on it to look around. Maybe something in c:\program Files\VMware? You could also look for vimsh.exe or any vmware-*.exe to find possible locations. – Jed Daniels Sep 27 '11 at 21:52
I searched the entire hard drive and didn't find vmware-vim-cmd. I don't think it comes with the Windows version of VMWare Server. – ristonj Sep 28 '11 at 15:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.