VMware Workstation

 View Only
  • 1.  vmcli - create empty CD-rom drive

    Posted Jun 30, 2025 07:55 AM

    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.vmx
    vmcli 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



  • 2.  RE: vmcli - create empty CD-rom drive

    Posted Jul 01, 2025 06:49 AM

    Hi,

    Check this post and script from @LucD




  • 3.  RE: vmcli - create empty CD-rom drive

    Posted Jul 01, 2025 12:59 PM

    Get-VM fails for Workstation.. 

    Pretty sure I went down this road only to find it's been deprecated.




  • 4.  RE: vmcli - create empty CD-rom drive

    Posted Jul 02, 2025 08:40 AM

    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.




  • 5.  RE: vmcli - create empty CD-rom drive

    Posted Jul 02, 2025 06:55 AM

    To my best knowledge - PowerCLI is not for Workstation.




  • 6.  RE: vmcli - create empty CD-rom drive

    Posted Jul 02, 2025 05:08 AM

    I think the only way is to "share" the host CD-ROM device with the host. How to do that with vmcli I have no idea.




  • 7.  RE: vmcli - create empty CD-rom drive

    Posted Jul 02, 2025 05:27 AM

    Solved it by doing these vmcli commands. Not to proud of the "configparams SetEntry" though - but I don't think there is any way around.

    Sata SetPresent sata0 1 
    Disk SetBackingInfo sata0:0 cdrom_raw "auto detect" 1
    configparams SetEntry sata0:0.autodetect TRUE 
    configparams SetEntry sata0:0.present TRUE