October 13, 2012

Running VMware Player virtual machine from the terminal

Recently I was setting up a Ubuntu server in VMware Player for testing purposes. As I was setting it up, I started to wonder if it would be possible to start the Virtual Machine from the terminal. This way I would be able to start it over SSH if I wasn't in my office. After some quick looking I found a quick and easy way to accomplish this with Xfvb.

Install Xfvb

The steps to install Xfvb will depend on what distribution you are running. In Arch Linux it is as simple as running:

$ sudo pacman -S xvfb-xorg

Run Virtual Machine from Terminal

Once you've installed Xfvb you can start the Virtual Machine from the terminal using:

$ xvfb-run vmplayer LOCATION_OF_VMX_FILE

Create a Bash Script to Simplify the Process

You can make this much simpler by making a simple bash script like this:

xvfb-run vmplayer 'LOCATION_OF_VMX_FILE'

If you put the bash script in your path you will be able to start the Virtual Machine from the terminal just by typing in the name of the bash script. I'm not able to start my Virtual Machines over SSH or even set them to start when my computer starts.

Tags: Terminal VMware Linux