Using Variables to Manage the Naming of your Persistent MED-V Workspaces

Using Variables to Manage the Naming of your Persistent MED-V Workspaces

Many organizations want to use variables to simplify the naming and manageability of MED-V workspaces. While regular operating system environment variables cannot be used inside the workspace policy, MED-V has variables that can be used for persistent workspaces. The workspace policy must use the VM Setup script to implement these variables.

These variables can be selected when configuring the MED-V workspace policy inside the MED-V management console (run from the client.)

To view and select these variables, do the following:

1.) Log into the MED-V Management Server (policy server) using the MED-V Management utility.

2.) When the policy loads, navigate to the Policy node.

3.) Select your desired workspace, then click on the VM Setup Tab. (Be advised that this option is only available for persistent workspaces which is defined in the Virtual Machine tab.)

4.) In the VM Setup tab you will see an option for "VM Computer Name Pattern" near the bottom of the page.


The default pattern for the machine image name is: MED-V%workspace########## where %workspace represents the name of the workspace used by this image on the client computer. The remaining # characters denote a random generated character. It is here where you have the option to insert different variables and where you can define your own computer name pattern. The variables that can be used are:

%Workspace: The name of the MED-V workspace being used by this image during the VM setup.

%User: The name of the user logged on to MED-V during the VM setup.

%Domain: The domain name (short name) of the authenticating MED-V Active Directory domain.

%Hostname: The hostname of the physical machine running the MED-V Client using this workspace.

%VMName: The name of the Virtual Machine name (Name of the virtual machine image file used by the workspace.)


If a user named Ernie from the domain CORPORATE logged on to a machine named CLIENT234 using the workspace called IE_7 leveraging the image XP01 will have the following name translations after generation:


VM Computer Name Pattern

Actual Name












NOTE: The maximum limit for a name is 15 characters. Any pattern that generates a result that exceeds this limit will be truncated to the first 15 characters.


5.) Once this is determined, you will need to include the action within the VM setup script. This will require you to click the "Script Editor" option under Persistent VM Setup. Click on this button. The "Rename Computer" Action is required to generate the computer name. Also note, this will need to be followed by a "Restart Computer" action.

Note: This information was originally contributed by Steve Thomas, Senior Support Escalation Engineer, on the MED-V Team blog:

Leave a Comment
  • Please add 8 and 8 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Page 1 of 1 (1 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Page 1 of 1 (1 items)