我正在尝试使用 VMWareTasks (http://vmwaretasks.codeplex.com) 连接到 VMWare Player 机器但抛出错误..
// declare a virtual host
using (VMWareVirtualHost virtualHost = new VMWareVirtualHost())
{
string vmfile = @"D:\SIRETIH-Releases\SIRETIH_Virtual\pc-virtual\siretih.vmx";
// connect to the host
virtualHost.ConnectToVMWarePlayer(); // <<-- this line throws an error...
using (VMWareVirtualMachine virtualMachine = virtualHost.Open(vmfile))
{
virtualMachine.WaitForToolsInGuest();
virtualMachine.LoginInGuest("siretih", "");
}
}
我正在使用 Visual Studio 2010 (C#)、VMWareTasks、VmWare Player 4.0.2 build-591240 (Windows OS)、Windows 7 ...
虚拟机有vmware工具...
我需要再安装 dll 或 api 吗?
No se controló System.Exception
Message=Failed to connect: serviceProviderType="Player" hostName="" hostPort=0 username="" timeout=60
Source=Vestris.VMWareLib
StackTrace:
en Vestris.VMWareLib.VMWareVirtualHost.Connect(ServiceProviderType serviceProviderType, String hostName, Int32 hostPort, String username, String password, Int32 timeout)
en Vestris.VMWareLib.VMWareVirtualHost.ConnectToVMWarePlayer(Int32 timeoutInSeconds)
en Vestris.VMWareLib.VMWareVirtualHost.ConnectToVMWarePlayer()utionContext, ContextCallback callback, Object state)
ConnectToVMWarePlayer() 方法只有一个参数...有一种方法“ConnectToVMWareVIServer”但我没有使用 vmware 服务器只是播放器...
public void ConnectToVMWarePlayer(
int timeoutInSeconds
)