12.0

Table Of Contents
n From the host, set a guest environment variable on a Linux virtual machine and verify by
writing the environment variables into a temporary file.
vmrun writeVariable Ubuntu16.vmwarevm/Ubuntu16.vmx guestEnv LD_LIBRARY_PATH /usr/local/lib
Guest user: root
Guest password:
vmrun runScriptInGuest Ubuntu16.vmwarevm/Ubuntu16.vmx /bin/bash "/usr/bin/env > /tmp/env.out"
Guest user: root
Guest password:
Note No output is sent to the host when you use the runScriptInGuest option with the vmrun
command. Find the output of the command in the /tmp/env.out file on the guest.
n On a Linux guest, determine the IP address and set it in a guest variable.
$ ipaddr=`ifconfig eth0 | grep inet.addr`
$ vmware-rpctool "info-set guestinfo.theip $ipaddr"
n From the host, retrieve the IP address that was just set to the guest.
vmrun readVariable Ubuntu10/Ubuntu10.vmx guestVar theip
General Commands
n List running virtual machines.
vmrun list
Total running VMs: 2
Absolute-path-to-virtual-machine
.vmx
Absolute-path-to-virtual-machine
.vmx
n Prepare to install VMware Tools.
vmrun installTools Ubuntu16.vmwarevm/Ubuntu16.vmx
The Template Virtual Machine Commands
n Download a VMware Project Photon operating system virtual machine.
vmrun downloadPhotonVM ~
Using VMware Fusion
VMware, Inc. 204