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

Article ID: 2848278 - View products that this article applies to.
Expand all | Collapse all

Summary

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:

cmd.exe /appvve:<PACKAGEGUID_VERSIONGUID>

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:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppV\Client\RunVirtual

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
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppV\Client\RunVirtual]
@=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppV\Client\RunVirtual\MyApp.exe]
@="aaaaaaaa-bbbb-cccc-dddd-eeeeeeee_11111111-2222-3333-4444-55555555"

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. If there is more than one version of the EXE installed on the machine, you will need to create a new REG_SZ value beneath the subkey and specify the value name by using the full path to the EXE.

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" ?>
<appv:AppConnectionGroup
xmlns="http://schemas.microsoft.com/appv/2010/virtualapplicationconnectiongroup"
xmlns:appv="http://schemas.microsoft.com/appv/2010/virtualapplicationconnectiongroup"
AppConnectionGroupId="CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCC"
VersionId="33333333-3333-3333-3333-3333333333"
Priority="0"
DisplayName="MyApp Connection Group">
 
then you would add a registry key like this:
 
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppV\Client\RunVirtual]
@=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppV\Client\RunVirtual\MyApp.exe]
@="aaaaaaaa-bbbb-cccc-dddd-eeeeeeee_11111111-2222-3333-4444-555555555
Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Properties

Article ID: 2848278 - Last Review: September 16, 2013 - Revision: 4.0
Applies to
  • Microsoft Application Virtualization 5.0 for Remote Desktop Services
  • Microsoft Application Virtualization 5.0 for Windows Desktops
  • Microsoft Application Virtualization 5.0 for Windows Desktops Service Pack 1
Keywords: 
KB2848278

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com