Common Tasks :Connecting to a Host

Connecting to a Host


To work with a virtual machine, you must first connect to the host where the virtual machine is stored. If the virtual machine is on a host running VMware Workstation, you can connect to it only from a client on the same host. If the virtual machine is on a host running VMware Server, you can connect to that host whether it is a local or remote host. VMware Workstation currently allows you to manipulate virtual machines only from the local host.

In all cases, you connect to a host using the VixHost_Connect() function. You specify whether the host is using VMware Workstation or VMware Server with the hostType parameter for VixHost_Connect(). Pass one of the following values:

  • VIX_SERVICEPROVIDER_VMWARE_SERVER – if the host runs VMware Server 1.0
  • VIX_SERVICEPROVIDER_VMWARE_WORKSTATION – if the host runs VMware Workstation
  • VIX_SERVICEPROVIDER_VMWARE_PLAYER – if the host runs VMware Player
  • VIX_SERVICEPROVIDER_VI_SERVER – if the host runs VMware vCenter, ESX/ESXi, or VMware Server 2.0

The hostType parameter describes the VMware software running on the host where the virtual machine is located, regardless of where the client is running. If you are using VMware Server to connect to a remote host, it does not matter which VMware product (if any) is running on the local host.

If you do not know in advance which VMware product will be running on the host, you can pass the valueVIX_SERVICEPROVIDER_DEFAULT for the hostType parameter. When you pass VIX_SERVICEPROVIDER_DEFAULT, the Vix library determines which VMware product is installed on the host. This lets you write a single program that can work with any VMware product on a local host.

You can use the VixHost_Connect() function in three different ways, subject to the restrictions described above:

  • You can connect to an arbitrary host using the name of the host machine, along with a user name and password identifying a valid user account on the machine. This kind of connection is not supported by VMware Workstation. SeeConnecting to a Specified Host.
  • You can connect as a specified user on the local host (the host on which your client runs) when you provide a NULL value in the hostName argument, but you do specify the user name and password of a valid user account on the local host. This kind of connection is not supported by VMware Workstation. See Connecting to the Local Host as a Specified User.
  • You can connect to the local host as the current user by passing NULL to all three identifying parameters: hostName,userName, and password. This kind of connection is supported by VMware Workstation. See Connecting to the Local Host as the Current User.

VixHost_Connect() is an asynchronous function, so the function call must be completed with a callback function or a call toVixJob_Wait().

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值