VMware Communities
icnocop2
Contributor
Contributor

Feature Request: Ability to programmatically mount an iso file in guest

Windows 7 Home Premium 64-bit SP1

VMware Workstation 9.0.2 build-1031769

VMware VIX API 1.12.2.35902

I'd like to request the ability to programmatically mount an iso file in the guest.

I can do this using the vSphere API, but not with the VIX API.

I also tried to do the following:

1. Suspend virtual machine

2. Edit vmx as follows:

ide1:0.present = "TRUE"

ide1:0.fileName = "C:\Users\Public\Documents\Shared Virtual Machines\private.iso"

ide1:0.deviceType = "cdrom-image"

3. Resume virtual machine

But the virtual machine does not refresh the attached devices; it still tries to access the cache of the previous configuration:

ide1:0.present = "TRUE"

ide1:0.fileName = "M:"

ide1:0.deviceType = "cdrom-raw"

In a previous version (before v8), the guest tools had the ability to disconnect and reconnect the cd\dvd device and that worked ok, but with Workstation 9, the guest tools no longer has the Device tab.

Any ideas?

I'd rather not have to create a virtual drive in the guest itself using SlySoft Virtual CloneDrive for example.

Thank you.

0 Kudos
6 Replies
icnocop2
Contributor
Contributor

For example, how does vmware mount the tools iso?

It seems to be able to modify the vmx file like this:

ide1:0.fileName = "C:\Program Files (x86)\VMware\VMware Workstation\windows.iso"

ide1:0.deviceType = "cdrom-image"

And doesn't need to reboot the guest.

I want to mimic this behavior in the vix api or vmrun.exe, etc.

But when I try to use the VIX API and call WriteVariable with VIX_VM_CONFIG_RUNTIME_ONLY to write "cdrom-image" to the "ide1:0.deviceType" variable, I get the error VIX_E_NOT_SUPPORTED.

Any work arounds?

Thank you.

0 Kudos
icnocop2
Contributor
Contributor

I can't create shared folders for a shared virtual machine because that feature disappears in the virtual machine settings (options) once I share a virtual machine.

0 Kudos
lakshya32
Enthusiast
Enthusiast

Hi

Welcome to the communities.

Could you please check if you have sufficient right with the user ID you are using to login.

0 Kudos
c4milo
Contributor
Contributor

I'm currently in need of this feature too. I did some research and it seems like VDDK is what one would normally use to mount disk images in VMware Fusion/Workstation/Player/Server. The problem for me is that it does not have SDK for OSX. 😕

0 Kudos
Anaeli
Contributor
Contributor

Could you please share me how do you do this with VSPhere API?, I am looking this information ...thanks

0 Kudos
wila
Immortal
Immortal

Hi,

Sorry replying to the old TS, but maybe the one who kicked this topic also benefits.

In a previous version (before v8), the guest tools had the ability to disconnect and reconnect the cd\dvd device and that worked ok, but with Workstation 9, the guest tools no longer has the Device tab.

There's vmware tools commandline version that at least allows you to connect/disconnect CD/DVD drives.

C:\Program Files\VMware\VMware Tools>VMwareToolboxCmd.exe help

Usage: VMwareToolboxCmd.exe <command> [options] [subcommand]

Type 'VMwareToolboxCmd.exe help <command>' for help on a specific command.

Type 'VMwareToolboxCmd.exe -v' to see the VMware Tools version.

Use '-q' option to suppress stdout output.

Most commands take a subcommand.

Available commands:

   device

   disk

   script

   stat

   timesync

   upgrade (not available on all operating systems)

C:\Program Files\VMware\VMware Tools>VMwareToolboxCmd.exe help device

device: functions related to the virtual machine's hardware devices

Usage: VMwareToolboxCmd.exe device <subcommand> [args]

dev is the name of the device.

Subcommands:

   enable <dev>: enable the device dev

   disable <dev>: disable the device dev

   list: list all available devices

   status <dev>: print the status of a device

--

Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
0 Kudos