如何使用 VMware vmrun 控制可移动 USB 设备 [英] How to control removable usb devices with VMware vmrun

查看:54
本文介绍了如何使用 VMware vmrun 控制可移动 USB 设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 VMware 工作站 9 和 10,我想用它来运行一些集成测试.

I have VMware workstation 9 and 10, and I am wanting to use that to run some integration tests.

使用 vmrun 实用程序,我可以将脚本复制到来宾虚拟机并在其上运行.但是,某些集成测试需要与 USB 设备连接.

Using the vmrun utility, I can copy scripts to and run them on the virtual machine guests. However, some of the integration tests will require interfacing with USB devices.

有什么方法可以使用 vmrun 或任何 vmware API 以编程方式控制可移动设备"以连接和断开 USB 设备与虚拟机的连接?

Is there any way using vmrun, or any of the vmware API's to programmatically control the "Removable Devices" to connect and disconnect USB devices to virtual machines?

我曾尝试查看 readVariable 和 writeVariable 命令,但是我找不到有关该主题的任何有用信息.

I have tried looking at the readVariable and writeVariable commands, however I cannot find any useful information on that subject.

推荐答案

vmrun 无法将 USB 设备从主机传递到客户机,反之亦然 (来源,VMware 员工).有两种选择可以实现这种行为

vmrun has no facility to passthrough USB devices from the host to the guest and vice versa (source, VMware employee). There are though 2 options to achieve this behavir

A) 使用自动连接:查看此处此处 了解如何修改 .VMX 文件以自动将 USB 设备连接到来宾 VM.基本上你需要添加 usb.autoConnect.device0 = "vid:XXXX pid:XXXX" 到它.

A) Use autoconnect: look here and here on how to modify the .VMX file to auto connect the USB device to the guest VM. Basically you need to add usb.autoConnect.device0 = "vid:XXXX pid:XXXX" to it.

B) 使用 askConnection:当您将设备插入主机,并且 VM 已启动时,您可以选择将设备连接到 VM 并记住选择.然后下次再次插入设备时,设备将自动连接到记住的虚拟机.此外,您可以在 Edit > 中进行配置.首选项USB 用于其他选择.目前,此功能仅在您插入设备时有效.

B) Use askConnection: When you plugged in the device to the host, and the VM is powered on, you can select to connect the device to the VM and remember the choice. Then the next time when you pluggin the device again, the device will be automatically connected to the remembered VM. Also, you can configure in Edit > Preferences > USB for other choices. Currently, this feature only works when you plug in the device.

这篇关于如何使用 VMware vmrun 控制可移动 USB 设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆