读书人

VMware Workstation提供的可编程接口(

发布时间: 2012-08-30 09:55:54 作者: rapoo

VMware Workstation提供的可编程接口(2)

vmrun version 1.11.0 build-471780Usage: vmrun [AUTHENTICATION-FLAGS] COMMAND [PARAMETERS]AUTHENTICATION-FLAGS--------------------These must appear before the command and any command parameters.   -h <hostName>  (not needed for Workstation)   -P <hostPort>  (not needed for Workstation)   -T <hostType> (ws|server|server1|fusion|esx|vc|player)     for example, use '-T server' for VMware Server 2.0                  use '-T server1' for VMware Server 1.0                  use '-T ws' for VMware Workstation                  use '-T ws-shared' for VMware Workstation (shared mode)                  use '-T esx' for VMware ESX                  use '-T vc' for VMware vCenter Server   -u <userName in host OS>  (not needed for Workstation)   -p <password in host OS>  (not needed for Workstation)   -vp <password for encrypted virtual machine>   -gu <userName in guest OS>   -gp <password in guest OS>POWER COMMANDS           PARAMETERS           DESCRIPTION--------------           ----------           -----------start                    Path to vmx file     Start a VM or Team                         [gui|nogui]stop                     Path to vmx file     Stop a VM or Team                         [hard|soft]reset                    Path to vmx file     Reset a VM or Team                         [hard|soft]suspend                  Path to vmx file     Suspend a VM or Team                         [hard|soft]pause                    Path to vmx file     Pause a VMunpause                  Path to vmx file     Unpause a VMSNAPSHOT COMMANDS        PARAMETERS           DESCRIPTION-----------------        ----------           -----------listSnapshots            Path to vmx file     List all snapshots in a VM                         [showTree]snapshot                 Path to vmx file     Create a snapshot of a VM                         Snapshot namedeleteSnapshot           Path to vmx file     Remove a snapshot from a VM                         Snapshot name                         [andDeleteChildren]revertToSnapshot         Path to vmx file     Set VM state to a snapshot                         Snapshot nameGUEST OS COMMANDS        PARAMETERS           DESCRIPTION-----------------        ----------           -----------runProgramInGuest        Path to vmx file     Run a program in Guest OS                         [-noWait]                         [-activeWindow]                         [-interactive]                         Complete-Path-To-Program                         [Program arguments]fileExistsInGuest        Path to vmx file     Check if a file exists in Guest OS                         Path to file in guestdirectoryExistsInGuest   Path to vmx file     Check if a directory exists in Guest OS                         Path to directory in guestsetSharedFolderState     Path to vmx file     Modify a Host-Guest shared folder                         Share name                         Host path                         writable | readonlyaddSharedFolder          Path to vmx file     Add a Host-Guest shared folder                         Share name                         New host pathremoveSharedFolder       Path to vmx file     Remove a Host-Guest shared folder                         Share nameenableSharedFolders      Path to vmx file     Enable shared folders in Guest                         [runtime]disableSharedFolders     Path to vmx file     Disable shared folders in Guest                         [runtime]listProcessesInGuest     Path to vmx file     List running processes in Guest OSkillProcessInGuest       Path to vmx file     Kill a process in Guest OS                         process idrunScriptInGuest         Path to vmx file     Run a script in Guest OS                         [-noWait]                         [-activeWindow]                         [-interactive]                         Interpreter path                         Script textdeleteFileInGuest        Path to vmx file     Delete a file in Guest OSPath in guestcreateDirectoryInGuest   Path to vmx file     Create a directory in Guest OSDirectory path in guestdeleteDirectoryInGuest   Path to vmx file     Delete a directory in Guest OSDirectory path in guestlistDirectoryInGuest     Path to vmx file     List a directory in Guest OS                         Directory path in guestCopyFileFromHostToGuest  Path to vmx file     Copy a file from host OS to guestOSPath on host             Path in guestCopyFileFromGuestToHost  Path to vmx file     Copy a file from guest OS to hostOSPath in guest            Path on hostrenameFileInGuest        Path to vmx file     Rename a file in Guest OS                         Original name                         New namecaptureScreen            Path to vmx file     Capture the screen of the VM to alocal filePath on hostwriteVariable            Path to vmx file     Write a variable in the VM state                         [runtimeConfig|guestEnv|guestVar]                         variable name                         variable valuereadVariable             Path to vmx file     Read a variable in the VM state                         [runtimeConfig|guestEnv|guestVar]                         variable nameVPROBE COMMANDS          PARAMETERS           DESCRIPTION---------------          ----------           -----------vprobeVersion            Path to vmx file     List VP versionvprobeLoad               Path to vmx file     Load VP script                         'VP script text'vprobeLoadFile           Path to vmx file     Load VP file                         Path to VP filevprobeReset              Path to vmx file     Disable all vprobesvprobeListProbes         Path to vmx file     List probesvprobeListGlobals        Path to vmx file     List global variablesGENERAL COMMANDS         PARAMETERS           DESCRIPTION----------------         ----------           -----------list                                          List all running VMsupgradevm                Path to vmx file     Upgrade VM file format, virtual hwinstallTools             Path to vmx file     Install Tools in Guestregister                 Path to vmx file     Register a VMunregister               Path to vmx file     Unregister a VMlistRegisteredVM                              List registered VMsdeleteVM                 Path to vmx file     Delete a VMclone                    Path to vmx file     Create a copy of the VM                         Path to destination vmx file                         full|linked                         [Snapshot name]Examples:Starting a virtual machine with Workstation on a Windows host   vmrun -T ws start "c:\my VMs\myVM.vmx"Stopping a virtual machine on an ESX host   vmrun -T esx -h https://myHost.com/sdk -u hostUser -p hostPassword stop "[storage1] vm/myVM.vmx"Running a program in a virtual machine with Workstation on a Windows host with Windows guest   vmrun -T ws -gu guestUser -gp guestPassword runProgramInGuest "c:\my VMs\myVM.vmx" "c:\Program Files\myProgram.exe"Running a program in a virtual machine with Server on a Linux host with Linux guest   vmrun -T server -h https://myHost.com:8333/sdk -u hostUser -p hostPassword -gu guestUser -gp guestPassword runProgramInGuest "[standard] vm/myVM.vmx" /usr/bin/X11/xclock -display :0Creating a snapshot of a virtual machine with Workstation on a Windows host   vmrun -T ws snapshot "c:\my VMs\myVM.vmx" mySnapshotReverting to a snapshot with Workstation on a Windows host   vmrun -T ws revertToSnapshot "c:\my VMs\myVM.vmx" mySnapshotDeleting a snapshot with Workstation on a Windows host   vmrun -T ws deleteSnapshot "c:\my VMs\myVM.vmx" mySnapshotEnabling Shared Folders with Workstation on a Windows host   vmrun -T ws enableSharedFolders "c:\my VMs\myVM.vmx"C:\Program Files\VMware\VMware Workstation>^A

读书人网 >编程

热点推荐