Common Tasks :Installing VMware Tools in a Virtual Machine

来源:互联网 发布:手机淘宝取消退款流程 编辑:程序博客网 时间:2024/05/16 05:08

Installing VMware Tools in a Virtual Machine

VMware Tools is a suite of utilities and drivers that enhances the performance and functionality of your guest operating system. For instance, VMware Tools provides a mouse driver and an SVGA driver for the virtual machine.

VMware Tools also implements some of the functionality required for doing Vix functions that affect the guest operating system, such as VixVM_RunProgramInGuest(). You need to install the VMware Tools before calling guest functions in the VIX API.

You can install VMware Tools manually by following the procedure described in the documentation for your VMware platform product. Or you can use the VIX API to do some or all of the installation steps from the host.

To begin the Tools installation process, you call the Vix function VixVM_InstallTools(). This function mounts a CD image containing the VMware Tools installer.

If the guest operating system has the autorun feature enabled, the installer starts automatically. Many guest operating systems require manual intervention to complete the Tools installation. You can connect a console window to the virtual machine and use the mouse or keyboard to complete the procedure as described in the documentation for your VMware platform product.

The VixVM_InstallTools() function is also useful for updating the version of VMware Tools installed in a virtual machine. When a newer version of the API is available, VMware recommends that you run the Tools installation on your virtual machines to make sure you are working with the latest version.

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

To install VMware Tools:

  1. Connect to the host on which the virtual machine is located. See Connecting to a Host.
  2. Get a handle to the virtual machine. See Getting a Handle to a Virtual Machine.
  3. Power on the virtual machine. See Starting or Resuming a Virtual Machine.
  4. Use the virtual machine handle to call VixVM_InstallTools(), which mounts the VMware Tools CD image.
  5.  Using a console connected to the virtual machine, perform any remaining steps in the installation procedure documented for your VMware platform product.
    Example 3-9.
    C code below. Click here for Perl. Click here for COM.
VixError err = VIX_OK;VixHandle jobHandle = VIX_INVALID_HANDLE; // Mount virtual CD-ROM with VMware Tools installer.jobHandle = VixVM_InstallTools(vmHandle,                               0, // options                               NULL, // commandLineArgs                               NULL, // callbackProc                               NULL); // clientDataerr = VixJob_Wait(jobHandle, VIX_PROPERTY_NONE);if (VIX_OK != err) {   // Handle the error...   goto abort;}Vix_ReleaseHandle(jobHandle);jobHandle = VIX_INVALID_HANDLE;
原创粉丝点击