vmware命令行

来源:互联网 发布:caffe训练mnist 编辑:程序博客网 时间:2024/05/22 02:14

本篇讲解几个简单的vmware的命令。


vmrun start "d:\\centos\\qs.vmx" nogui 无界面启动vmrun start "d:\\centos\\qs.vmx" gui 图形化界面启动vmrun list 列出正在运行的虚拟机vmrun stop "d:\\centos\\qs.vmx" soft 正常关闭虚拟机vmrun stop "d:\\centos\\qs.vmx" hard 强制关闭虚拟机vmrun reset "d:\\centos\\qs.vmx" soft 热重启虚拟机vmrun reset "d:\\centos\\qs.vmx" hard 冷重启虚拟机vmrun sudpend "d:\\centos\\qs.vmx" soft 热挂起(休眠)vmrun sudpend "d:\\centos\\qs.vmx" hard 冷挂起(休眠)vmrun pause "d:\\centos\\qs.vmx" 暂停虚拟机vmrun listsnapshots "d:\\centos\\qs.vmx" 查看某虚拟机有多少快照vmrun snapshot "d:\\centos\\qs.vmx" snapshotcmdtest 创建快照vmrun deleteSnapshot "d:\\centos\\qs.vmx" snapshotcmdtest 删除一个快照vmrun revertToSnapshot "d:\\centos\\qs.vmx" snapshotcmdtest 从快照中恢复

Invalid argument: --helpvmrun version 1.15.0 build-2985596Usage: 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 Server 2.0                  use '-T server1' for 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 (vmrun start "d:\\centos\\qs.vmx" nogui 无界面启动)                         [gui|nogui]                             (vmrun start "d:\\centos\\qs.vmx" gui 图形化界面启动)stop                     Path to vmx file     Stop a VM or Team (vmrun stop "d:\\centos\\qs.vmx" soft 正常关闭虚拟机)                         [hard|soft]                            (vmrun stop "d:\\centos\\qs.vmx" hard 强制关闭虚拟机)reset                    Path to vmx file     Reset a VM or Team (vmrun reset "d:\\centos\\qs.vmx" soft 热重启虚拟机)                         [hard|soft]                             (vmrun reset "d:\\centos\\qs.vmx" hard 冷重启虚拟机)suspend                  Path to vmx file     Suspend a VM or Team (vmrun sudpend "d:\\centos\\qs.vmx" soft 热挂起)                         [hard|soft]                               (vmrun sudpend "d:\\centos\\qs.vmx" hard 冷挂起)pause                    Path to vmx file     Pause a VM (vmrun pause "d:\\centos\\qs.vmx" 暂停虚拟机)unpause                  Path to vmx file     Unpause a VM (vmrun unpause "d:\\centos\\qs.vmx" 从暂停中恢复虚拟机)// 关于快照的命令SNAPSHOT COMMANDS        PARAMETERS           DESCRIPTION-----------------        ----------           -----------listSnapshots            Path to vmx file     List all snapshots in a VM                          [showTree]           (vmrun listSnapshots "d:\\centos\\qs.vmx" 查看某虚拟机有多少快照)snapshot                 Path to vmx file     Create a snapshot of a VM                         Snapshot name        (vmrun snapshot "d:\\centos\\qs.vmx" snapshotcmdtest 创建一个快照)deleteSnapshot           Path to vmx file     Remove a snapshot from a VM                         Snapshot name        (vmrun deleteSnapshot "d:\\centos\\qs.vmx" snapshotcmdtest 删除一个快照)                         [andDeleteChildren]revertToSnapshot         Path to vmx file     Set VM state to a snapshot                         Snapshot name        (vmrun revertToSnapshot "d:\\centos\\qs.vmx" snapshotcmdtest 从快照中恢复)GUEST 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 guest            createDirectoryInGuest   Path to vmx file     Create a directory in Guest OSDirectory path in guest  deleteDirectoryInGuest   Path to vmx file     Delete a directory in Guest OSDirectory path in guest  CreateTempfileInGuest    Path to vmx file     Create a temporary file in Guest OSlistDirectoryInGuest     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 guest OSPath on host             Path in guestCopyFileFromGuestToHost  Path to vmx file     Copy a file from guest OS to host OSPath 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 a local filePath on host             writeVariable            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 namegetGuestIPAddress        Path to vmx file     Gets the IP address of the guest                         [-wait]GENERAL COMMANDS         PARAMETERS           DESCRIPTION----------------         ----------           -----------list                                          List all running VMs (vmrun list 列出所有正在运行的虚拟机)upgradevm                Path to vmx file     Upgrade VM file format, virtual hwinstallTools             Path to vmx file     Install Tools in GuestcheckToolsState          Path to vmx file     Check the current Tools stateregister                 Path to vmx file     Register a VMunregister               Path to vmx file     Unregister a VMlistRegisteredVM                              List registered VMsdeleteVM                 Path to vmx file     Delete a VM (vmrun deleteVM vmname 删除名为vmname的虚拟机) clone                    Path to vmx file     Create a copy of the VM (克隆一个虚拟机:完全克隆/链接克隆)                         Path to destination vmx file                         full|linked                         [-snapshot=Snapshot Name]                         [-cloneName=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"
0 0