Troubleshoot app attach in Azure Virtual Desktop

If you're having issues when using app attach, use the information in this article to help troubleshoot.

Check file share access

To validate that your session hosts have the necessary access to a file share containing your MSIX images, you can use PsExec.

  1. Download and install PsExec from Microsoft Sysinternals on a session host in your host pool.

  2. Open PowerShell as an administrator and run the following command, which will start a new PowerShell session as the system account:

    PsExec.exe -s -i powershell.exe
    
  3. Verify that the context of the PowerShell session is the system account by running the following command:

    whoami
    

    The output should be the following:

    nt authority\system
    
  4. Mount an MSIX image from the file share manually by using one of the following examples, changing the UNC paths to your own values.

    • To mount an MSIX image in .vhdx format, run the following command:

      Mount-DiskImage -ImagePath \\fileshare\msix\MyApp.vhdx
      
    • To mount an MSIX image in .cim format, run the following commands. The CimDiskImage PowerShell module from the PowerShell Gallery will be installed, if it's not already.

      # Install the CimDiskImage PowerShell module, if it's not already installed.
      If (!(Get-Module -ListAvailable | ? Name -eq CimDiskImage)) {
           Install-Module CimDiskImage -WhatIf
      }
      
      # Import the CimDiskImage PowerShell module.
      Import-Module CimDiskImage
      
      # Mount the MSIX image
      Mount-CimDiskImage -ImagePath \\fileshare\msix\MyApp.cim -DriveLetter Z:
      

    If the MSIX image mounts successfully, your session hosts have the correct necessary access to the file share containing your MSIX images.

  5. Dismount the MSIX image by using one of the following examples.

    • To dismount an MSIX image in .vhdx format, run the following command:

      Dismount-DiskImage -ImagePath \\fileshare\msix\MyApp.vhdx
      
    • To dismount an MSIX image in .cim format, run the following commands:

      Get-CimDiskImage | Dismount-CimDiskImage
      

Next steps

Test MSIX packages with app attach or MSIX app attach.