Start the VM from the command line under Centos

 Note: It is best to use the root user to execute the following command

View running virtual machines

vmrun list 

virtual machine start

  • Start the virtual machine without a graphical interface (-T is to distinguish the type of host machine, ws|server|server1|fusion|esx|vc|player, which may be more commonly used are ws, esx and player, but I did not add -T in Workstation It can run normally, maybe esx and server are needed)
vmrun -T ws start "/opt/VMware/win2k8r2.vmx" nogui
  • Start a virtual machine with a GUI
vmrun start "/opt/VMware/win2k8r2.vmx" gui

virtual machine shutdown

Forcibly shut down the virtual machine (equivalent to directly turning off the power) 

vmrun stop "/opt/VMware/win2k8r2.vmx" hard

 Shut down a virtual machine gracefully

vmrun stop "/opt/VMware/win2k8r2.vmx" soft

Other common commands

vmrun reset "/opt/VMware/win2k8r2.vmx" hard | soft冷重启虚拟机 | 热重启虚拟机

vmrun suspend  "/opt/VMware/win2k8r2.vmx" hard | soft挂起虚拟机(可能相当于休眠)

vmrun pause  "/opt/VMware/win2k8r2.vmx"暂停虚拟机

vmrun unpause  "/opt/VMware/win2k8r2.vmx"停止暂停虚拟机

Problems encountered during use:

sudo vmrun stop "/data/vmware_workstation/vmware_host_online_npc/vmware_host_online_npc.vmx" soft.

Error: The virtual machine is not powered on: /data/vmware_workstation/vmware_host_online_npc/vmware_host_online_npc.vmx

solution:

sudo vmrun stop "/data/vmware_workstation/vmware_host_online_npc/vmware_host_online_npc.vmx" soft

 

Guess you like

Origin blog.csdn.net/anonymous_me/article/details/107833991