MED-V builds on top of the RAIL (Remote Applications Installed locally) model that is also in Virtual PC for Windows 7 and Windows XP Mode for Windows 7.

Unlike XP Mode or Virtual PC (which put the applications in a specific Start menu Folder) MED-V V2 will scan the All Users Start Menu in the guest operating system to determine what should be published and where it will place it (in its equivalent location) in the Host’s Start Menu. The basic process of application publishing will basically be:

1. Application installed before MED-V Image is deployed must create a shortcut in the All User’s Start Menu folder of the guest. Applications installed on a MED-V image after it is deployed must also create a shortcut in the start menu to also be discovered.

2. MED-V will continually monitor any changes to shortcuts in the start menu of the deployed MED-V image.

3. MED-V will publish changes in the shortcuts to the start menu of the host workstation as they are discovered.

The MED-V Client is responsible for monitoring the folder in the host where Virtual PC publishes its shortcuts for additions or deletions. When an application shortcut is added to this monitored folder, the shortcut watcher will copy the published shortcut to the same location in the host Start menu as it occupies in the VM’s Start menu. Likewise, when an application shortcut is deleted from the monitored folder, the shortcut watcher will delete the published shortcut from its corresponding location in the host Start menu.

When application publishing in Virtual PC has been enabled, the Remote Desktop Services WMI Provider in conjunction with the Win32_TSPublishedApplication class is used to add the application information to the Virtual PC’s  registry. The published application is given a unique published application identifier (PAI) that is used to reference it from both the host and the VM. The PAI value is stored as command line parameter in the shortcut file in the host.

 

For example: "C:\Program Files\Microsoft Enterprise Desktop Virtualization\MedvHost.exe" /LaunchApp %SystemRoot%\system32\vmsal.exe "Windows XP Compatibility (Shared)" "||a93686d" "Pre-Auto Published Command Line"

It is also stored as a registry key in the Virtual PC Guest OS:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\Current version\Virtual machine\AppAllowList\<PAI>

These same PAI’s are also stored in the user’s registry on the host in:

HKEY_CURRENT_USER\Software\Microsoft\MEDV\Application Publishing\<Workspace name>\<PAI>

Without MED-V, Virtual PC publishes remote applications to host folder location “%APPDATA%\Microsoft\Windows\Start Menu\Programs\Windows Virtual PC\<VM Name> Applications”.

If for some reason, either an application that was installed prior to deployment does not appear where expected or it was added post-deployment and it does not get published. In the event that application shortcuts that are copied into the VM Start menu are not being published to the host Start menu, the following items should be checked:

  1. Ensure that the Integration Components are installed on the VPC
  2. Ensure that Auto Publish is enabled on the VPC
  3. Verify that the Virtual PC RemoteApp patch update is installed in the VM.
  4. Run the MED-V Host toolkit using the following command:

    MEDVHOST /toolkit

    Click “View Published Applications



    You can also leverage the following VBScript to query the applications

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\Microsoft\Medv")
    Set colItems = objWMIService.ExecQuery("SELECT * FROM PublishedApplication",,48)
    For Each objItem in colItems
    Wscript.Echo "-----------------------------------"
    Wscript.Echo "PublishedApplication instance"
    Wscript.Echo "-----------------------------------"
    Wscript.Echo "Arguments: " & objItem.Arguments
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo "PAI: " & objItem.PAI
    Wscript.Echo "Path: " & objItem.Path
    Next
  5. Verify that the AppPublishingEnabled value is set to 1 in the following registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Medv\v2\UserExperience
  6. Make sure the shortcut to the application is using an .EXE file as its destination.
  7. Check for shortcut extraction objects in %LOCALAPPDATA%\Microsoft\Windows Virtual PC\Virtual Applications\<VPCNAME>
  8. If no shortcuts appear, you can look for the PAI identifier. Look in:

    HKEY_CURRENT_USER\Software\Microsoft\MEDV\Application Publishing

    Subkey will be WWorkspace Name. AppPubIds will be below it. i.e. - HKEY_CURRENT_USER\Software\Microsoft\MEDV\Application Publishing\Windows XP Compatibility (Shared)\2b719975
  9. If you see the PAI, test the application using the MEDVHost.exe /launchapp command. This option allows you to launch a MED-V v2 published application from the command line. Use the following syntax:

    "C:\Program Files\Microsoft Enterprise Desktop Virtualization\MedvHost.exe" /LaunchApp %SystemRoot%\system32\vmsal.exe "WorkspaceName" "||AppID" "AppName"

    For example, the following command line launches a pre-published application called " "Pre-Auto Published Command Line" from the workspace called "Windows XP Compatibility (Shared):"

    C:\Program Files\Microsoft Enterprise Desktop Virtualization\MedvHost.exe" /LaunchApp %SystemRoot%\system32\vmsal.exe "Windows XP Compatibility (Shared)" "||a93686d" "Pre-Auto Published Command Line"
  10. Ensure an entry exists for the application under the AppAllowList and TSAppAllowList registry keys.
  11. Ensure the executable for the application is not listed under the HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtual Machine\VPCVAppExcludeList.
  12. Copy an application shortcut into the VPC All Users folder and check to see if the application was published to the host by looking in the VPC7 Host Publication folder. If it was not then check the following items:

    Copy an application shortcut into the VM Current User folder and check to see if the application was published by checking the registry key HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TsAppAllowList\Applications. If no key was created for that application, then an error is occurring with the MED-V Host Agent.
  13. Copy a VPC application shortcut to VPC Host Publication folder. This shortcut target must be formatted properly with the VMSAL command line parameters. Check to see if the shortcut was copied to the “%APPDATA%\Microsoft\Windows NT\CurrentVersion\Start Menu\Programs” folder.
  14. If the application shows up with a PAI in the Guest OS under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\Current Version\Virtual machine\AppAllowList\<PAI>. Check for a value called IgnoreForPublishing and remove it if it is set to 1.
  15. Does the application start from a mapped drive? If so, change it to use a UNC path instead in the shortcut?
  16. The Windows Event Log should also be checked to validate that no errors have occurred during the publication process.