How to launch processes inside the App-V 5.0 virtualized environment


A common troubleshooting task for the Microsoft Application Virtualization 5.0 client (App-V 5.0) is to investigate or modify a local package by opening a process inside the context of an App-V application.  This is also known as opening a process "in the App-V bubble".  App-V 5.0 offers several alternative methods to perform this task that differ significantly from techniques available in previous versions of the product.  Each method detailed below accomplishes essentially the same task, but some methods may be better suited for some applications than others depending on whether the virtualized application is already running.

More Information

Get-AppvClientPackage PowerShell Cmdlet

You can use the Start-AppVVirtualProcess cmdlet to retrieve the package name and then start a process within the specified package's virtual environment (substitute the name of your package for "<Package>"):

$AppVName = Get-AppvClientPackage <Package>
Start-AppvVirtualProcess -AppvClientObject $AppVName cmd.exe

Hint: If you do not know the exact name of your package, you can use the command line Get-AppvClientPackage *executable*, substituting the name of the application for "executable"; for example: Get-AppvClientPackage *Word*.

This method allows you launch any command within the context of an App-V package whether the package is currently running or not.  This is similar to using the sfttray /exe cmd.exe /launch "App-V Application" syntax in App-V 4.6.

The Command Line Switch “/appvpid:<PID>”

This allows you to apply the /appvpid switch to any command which will allow the command to run within the virtual process of the virtual process you selected by its PID (Process ID) as in the example below:

cmd.exe /appvpid:8108

To obtain the process ID (PID) of your App-V process, use the command tasklist.exe from an elevated command prompt and obtain the PID of your process.  This method has the advantage of launching the new executable in the same App-V environment as an already-running executable.

The Command Line Hook Switch “/appvve:<GUID>”

Where the /appvpid switch requires the virtual process to already be running, this switch allows you to start a local command and allow it to run within the virtual environment of an App-V package and will initialize it. The syntax is as follows:


For example:

cmd.exe /appvve:aaaaaaaa-bbbb-cccc-dddd-eeeeeeee_11111111-2222-3333-4444-55555555 

To obtain the package GUID and version GUID, of your application, run the Get-AppvClientPackage cmdlet, then concatenate the package GUID and version GUIDs with an underscore between them.  For example: 

PS C:\> Get-AppvClientPackage
PackageId            : aaaaaaaa-bbbb-cccc-dddd-eeeeeeee
VersionId            : 11111111-2222-3333-4444-55555555
Name                 : MyApp 1.10

would yield the command line:

cmd.exe /appvve:aaaaaaaa-bbbb-cccc-dddd-eeeeeeee_11111111-2222-3333-4444-55555555

Run Virtual

If you are working within RDS environments, and have a package that is published globally, you can also take advantage of the “Run Virtual” feature. To do this, the add process executable names as subkeys of the following key:


For example, if you have a locally installed application named MyApp.exe and would like this application to run within the virtual environment, create a subkey called MyApp.exe.  Edit the (Default) REG_SZ value that contains the package GUID and the version GUID separated by an underscore (i.e. <GUID>_<GUID>.

For example, the application listed in the previous example would yield a registry export (.reg file) like the following:

Windows Registry Editor Version 5.00

Each native process that needs to run locally will require its own subkey beneath the Run Virtual key. As long as there is one version of the EXE on the system, placing the package\version GUID combination in the default key value will suffice.

Note: You may also specify the AppConnectionGroupID and VersionID of a globally published connection group in a similar format.  Specify the main executable name in the connection group.  For example, if your Connection Group XML looked like the following:
<?xml version="1.0" ?>
DisplayName="MyApp Connection Group">
then you would add a registry key like this:
Windows Registry Editor Version 5.00