Take the 2-minute tour ×

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
add comment

1 Answer

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
add comment

Your Answer


