vmrun命令使用详解(2)

GENERAL COMMANDS        PARAMETERS          DESCRIPTION
 list                                          List all running VMs
 upgradevm                Path to vmx file    Upgrade VM file format, virtual hw
 installtools            Path to vmx file    Install Tools in Guest OS

3、示例

1)开启虚拟机

vmrun start "/opt/VM_OS/RH_OS_B/Red Hat Enterprise Linux 5 64-bit.vmx" nogui|gui

2)停止虚拟机

vmrun stop "/opt/VM_OS/RH_OS_B/Red Hat Enterprise Linux 5 64-bit.vmx" nogui|gui

3)重启虚拟机
        vmrun restart "/opt/VM_OS/RH_OS_B/Red Hat Enterprise Linux 5 64-bit.vmx" nogui|gui

4)列出正在运行的虚拟机
        vmrun list

下面整理了一发命令:

vmrun -T ws start "/vmware/lvs1/lvs.vmx" nogui #无图形界面启动虚拟机(-T是区分宿主机的类型,ws|server|server1|fusion|esx|vc|player,常用的是ws|esx|player)

vmrun start "/vmware/lvs1/lvs.vmx" gui #带图形界面启动虚拟机

vmrun stop "/vmware/lvs1/lvs.vmx" #可跟参数hard强制关闭虚拟机(相当于直接关电源)|soft正常关闭虚拟机

vmrun reset "/vmware/lvs1/lvs.vmx" #可跟参数hard冷重启虚拟机|soft热重启虚拟机

vmrun suspend  "/vmware/lvs1/lvs.vmx" #可分参数hard|soft挂起虚拟机

vmrun pause  "/vmware/lvs1/lvs.vmx" #暂停虚拟机

vmrun unpause  "/vmware/lvs1/lvs.vmx" #停止暂停虚拟机   

vmrun list #列出正在运行的虚拟机

vmrun -T ws snapshot "/vmware/lvs1/lvs.vmx" snapshotName #创建一个快照

vmrun -T ws reverToSnapshot "/vmware/lvs1/lvs.vmx" snapshotName #从一个快照中恢复虚拟机

vmrun -T ws listSnapshots "/vmware/lvs1/lvs.vmx" #列出快照

vmrun -T ws deleteSnapshot "/vmware/lvs1/lvs.vmx" snapshotName #删除一个快照

vmrun命令帮助

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/12305.html