11.0

Table Of Contents
n To share a folder on a Mac host with a particular Linux guest.
Note Before sharing folders, you must enable them with the enabledSharedFolders option, or by
selecting Enable Shared Folders in the Sharing Settings panel of the virtual machine. On Linux
guests, the /mnt/hgfs directory is available for sharing, but you can use a different directory for
shared folders.
vmrun addSharedFolder Ubuntu16.vmwarevm/Ubuntu16.vmx sharedFolderName ~/Share
n To make a shared folder readonly or to delete the shared folder.
Note Shared folders are writable by default.
vmrun setSharedFolderState Ubuntu16.vmwarevm/Ubuntu16.vmx sharedFolderName ~/Share
readonly
vmrun removeSharedFolder Ubuntu16.vmwarevm/Ubuntu16.vmx sharedFolderName
Note On Windows Vista and Windows 7 or later guests, only the Administrator account can use
copyFileFromHostToGuest and deleteFileInGuest options to write and delete files in the C:\ and
system folders, or use the createDirectoryInGuest and deleteDirectoryInGuest options to modify
system directories. Regular users, even those with administrator privilege, cannot perform these
operations.
Guest Variables and Environment
n From the host, set a guest variable on the virtual machines.
vmrun writeVariable Win10.vmwarevm/Win10.vmx guestVar vmstartdate 21April2017
n On the guest operating systems, read the guest variable that you just set.
> rpctool.exe "info-get guestinfo.vmstartdate"
$ vmware-rpctool "info-get guestinfo.vmstartdate"
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.
Using VMware Fusion
VMware, Inc. 196