Wednesday, February 15, 2017

Launching vmware clients on Linux host using VMware VIX libraries



How to launch VMware Player VMs without GUI

If you are a user of VMware Player, you may have wondered whether it's possible to run VMware player without GUI. For example, when you are accessing VMware hosts via SSH remotely, you may want to run VMware Player from the command line.

 While you can use X11 forwarding over SSH to launch VMware player's GUI from remote locations, it will be rather inconvenient if the SSH connection is slow. Furthermore, the VM launched inside VMware Player's GUI window will automatically be stopped when you close the VMware Player window.

If you would like to start or stop VMware Player VMs without GUI, you can use vmrun which is a command-line utility which one can use to automate operations on VMware virtual machines (VMs). vmrun is contained in VMware VIX API libraries which are freely downloadable from VMware website. You can follow the instructions below to manage VMware Player VMs remotely.

It is assumed that you have already created a VM using VMware Player, and so have *.vmx files ready somewhere. Now you want to start/stop the VM using vmrun. You don't need root permission to use vmrun command.

First, download VMware VIX for Linux, and then install it on the VMware host as follows.
$ chmod 755 ./VMware-VIX-1.11.0-471780.x86_64
$ sudo ./VMware-VIX-1.11.0-471780.x86_64
 
To start VM:
$ vmrun -T player start /path/to/vm/my.vmx nogui
 
To reboot VM:
$ vmrun -T player reset /path/to/vm/my.vmx soft
 
To power off VM:
$ vmrun -T player stop /path/to/vm/my.vmx soft
 
 
 

No comments:

Post a Comment