I've managed to get something working with this script:
$vmxPath = "Path to .vmx file"
$vmx = Get-Content $vmxPath
# Add a new CD-ROM device
$cdromConfig = @(
'ide1:0.present = "TRUE"',
'ide1:0.deviceType = "cdrom-raw"',
'ide1:0.fileName = "auto"',
'ide1:0.startConnected = "TRUE"'
)
$vmx += $cdromConfig
$vmx | Set-Content $vmxPath
Write-Host "CD-ROM device added to VMX file."
It's not perfect, but it might help you build your own version.
The script edits the .vmx file by adding those four lines to define a new, empty CD-ROM device.
If you run the script multiple times on the same VM, the .vmx file may get corrupted. It happened to me when I was curious if I could add more than two CD-ROM devices, but it works correctly if you run it once.
Original Message:
Sent: Jul 01, 2025 12:26 PM
From: Fred.S
Subject: vmcli - create empty CD-rom drive
Get-VM fails for Workstation..
Pretty sure I went down this road only to find it's been deprecated.
Original Message:
Sent: Jul 01, 2025 03:20 AM
From: Alexandru Capras
Subject: vmcli - create empty CD-rom drive
Hi,
Check this post and script from @LucD
Original Message:
Sent: Jun 30, 2025 07:54 AM
From: Soren Schimkat
Subject: vmcli - create empty CD-rom drive
Hi all
I'm struggling with creating an empty CD-ROM drive. I found this single example on how to create drive with a disk, but I cannot find actual documenation om vmcli (which btw is missing version information within the Windows binary).
echo "----create sata disk for iso mounting-----"vmcli Sata SetPresent sata0 1 ~/Desktop/test/windowstest.vmxvmcli Disk SetBackingInfo sata0:0 cdrom_image ~/Documents/iso/22621.1.220506-1250.ni_release_CLIENT_ENTERPRISES_OEM_x64FRE_en-us.iso 1 ~/Desktop/test/windowstest.vmx vmcli Disk SetPresent sata0:0 1 ~/Desktop/test/windowstest.vmx
Any hints on how to add an empty CD-rom drive?
Br. Stickybit