VMware Communities
apraman
Contributor
Contributor
Jump to solution

Vix and USB

Hello,

I am using VMWare 6.0 evaluation edition and VixCom SDK from C# Environment.For the VM, I need a USB audio device connected. For this, I went to VM->Removable devices->USB and selected my audio device. This makes the USB available whenever the VM is Powered On. (It asked for a cofirmation of plugging out device from Host and connecting it to VM with an option of not to show this message again, which I selected.) This works fine from the Workstation.

Now, I need to Power On from using the SDK. What happens is, when the USB device is not selected (using the above procedure) then the VM gets powered on without any problem. If the USB device is selected, then i think, that the VM requires focus to get Powered On as from the SDK it is not getting powered on unless I click on the VMWare icon and make it active.

I am using NORMAL option and I am not using the Launch GUI option. Is this the way it is expected or is there something I am doing wrong ?

Thanks and Regards,

Ram

0 Kudos
1 Solution

Accepted Solutions
admin
Immortal
Immortal
Jump to solution

Hello Ram,

At issue is that only the Workstation UI knows about your having requested not to see the message about changing the USB device, but the virtual machine itself does not.

When you start the virtual machine with VixCOM, the dialog still gets generated and the virtual machine waits for an answer. Once you open the virtual machine in the UI, the UI knows you've requested never to see the dialog, and answers it.

There are two ways to get around this, but neither is perfect.

1) Use the launch GUI option. Since the virtual machine gets opened in the UI, the UI will take care of the dialog. For extra hackiness, you could try killing the UI process after some amount of time has passed, if you really need to have the VM running in the background, but there many obvious problems with this.

2) Add

msg.autoAnswer = "TRUE"

to the virtual machine's config file (the .vmx file). This will stop the virtual machine from generating any messages. Obviously, this turns off many potentially useful messages too, but you'll can be sure that the virtual machine won't get stuck in this kind of situation when you are trying to automate it.

Also, check out the "Virtual Machine Automation APIs" forum under the Developer Community section, which is the central discussion for VIX-related matters.

View solution in original post

0 Kudos
2 Replies
admin
Immortal
Immortal
Jump to solution

Hello Ram,

At issue is that only the Workstation UI knows about your having requested not to see the message about changing the USB device, but the virtual machine itself does not.

When you start the virtual machine with VixCOM, the dialog still gets generated and the virtual machine waits for an answer. Once you open the virtual machine in the UI, the UI knows you've requested never to see the dialog, and answers it.

There are two ways to get around this, but neither is perfect.

1) Use the launch GUI option. Since the virtual machine gets opened in the UI, the UI will take care of the dialog. For extra hackiness, you could try killing the UI process after some amount of time has passed, if you really need to have the VM running in the background, but there many obvious problems with this.

2) Add

msg.autoAnswer = "TRUE"

to the virtual machine's config file (the .vmx file). This will stop the virtual machine from generating any messages. Obviously, this turns off many potentially useful messages too, but you'll can be sure that the virtual machine won't get stuck in this kind of situation when you are trying to automate it.

Also, check out the "Virtual Machine Automation APIs" forum under the Developer Community section, which is the central discussion for VIX-related matters.

0 Kudos
apraman
Contributor
Contributor
Jump to solution

Thank you very much.

Regards

Ram

0 Kudos