|
| 1 | +--- |
| 2 | +title: Create an MSIX image for Azure Virtual Desktop - Azure |
| 3 | +description: To use MSIX app attach with Azure Virtual Desktop, you need to expand an MSIX-packaged application into an MSIX image. This article shows you how to create an MSIX image. |
| 4 | +author: dknappettmsft |
| 5 | +ms.topic: how-to |
| 6 | +ms.date: 05/12/2023 |
| 7 | +ms.author: daknappe |
| 8 | +--- |
| 9 | + |
| 10 | +# Create an MSIX image for Azure Virtual Desktop |
| 11 | + |
| 12 | +To use MSIX app attach with Azure Virtual Desktop, you need to expand an MSIX-packaged application into an MSIX image. This article shows you how to create an MSIX image, which you then need to upload to a file share and publish in Azure Virtual Desktop. |
| 13 | + |
| 14 | +## Prerequisites |
| 15 | + |
| 16 | +Before you can create an MSIX image, you need to meet the following prerequisites: |
| 17 | + |
| 18 | +- Download the [MSIXMGR tool](https://aka.ms/msixmgr) and extract it to a folder. |
| 19 | + |
| 20 | +- Administrative permissions on a Windows 10 or Windows 11 device to create the MSIX image. |
| 21 | + |
| 22 | +- An MSIX-packaged application (`.msix` file) you want to use with Azure Virtual Desktop. To learn how to convert a desktop installer to an MSIX package, see [Create an MSIX package from any desktop installer (MSI, EXE, ClickOnce, or App-V)](/windows/msix/packaging-tool/create-app-package). |
| 23 | + |
| 24 | + > [!NOTE] |
| 25 | + > If you're using packages from the Microsoft Store for Business or Education on your network or on devices not connected to the internet, you'll need to download and install package licenses from the Microsoft Store to run the apps. To get the licenses, see [Use packages offline](app-attach.md#use-packages-offline). |
| 26 | +
|
| 27 | +## Create an MSIX image |
| 28 | + |
| 29 | +When creating an MSIX image, you convert an MSIX package to a *VHD*, *VHDX*, or *CIM* disk image using the MSIXMGR tool. We recommend using CIM for best performance, particularly with Windows 11, as it consumes less CPU and memory, with improved mounting and unmounting times. We don't recommend using VHD; use VHDX instead. |
| 30 | + |
| 31 | +Select the relevant tab for your scenario. |
| 32 | + |
| 33 | +# [CIM](#tab/cim) |
| 34 | + |
| 35 | +Here are example commands to create an MSIX image as a CIM disk image. You'll need to change the example values for your own. |
| 36 | + |
| 37 | +You should create a new folder for the destination because a CIM disk image is made up of multiple files and this helps differentiate between the images. |
| 38 | + |
| 39 | +> [!IMPORTANT] |
| 40 | +> To guarantee compatibility, make sure the CIM files storing your MSIX images are generated on a version of Windows that is lower than or equal to the version of Windows where you are planning to run the MSIX packages. For example, CIM files generated on Windows 11 may not work on Windows 10. |
| 41 | +
|
| 42 | +1. Open command prompt as an administrator and change to the directory you extracted the MSIXMGR tool. |
| 43 | + |
| 44 | +1. Create a new folder for the destination. |
| 45 | + |
| 46 | +1. To create the CIM disk image, run the following command: |
| 47 | + |
| 48 | + ```cmd |
| 49 | + msixmgr.exe -Unpack -packagePath "C:\msix\myapp.msix" -destination "C:\msix\myapp\myapp.cim" -applyACLs -create -fileType cim -rootDirectory apps |
| 50 | + ``` |
| 51 | + |
| 52 | + The output should be as follows: |
| 53 | + |
| 54 | + ```Output |
| 55 | + Successfully created the CIM file: C:\msix\myapp\myapp.cim |
| 56 | + ``` |
| 57 | + |
| 58 | +# [VHDX](#tab/vhdx) |
| 59 | + |
| 60 | +Here's an example command to create an MSIX image as a VHDX disk image. A single VHDX file is created. |
| 61 | + |
| 62 | +1. Open command prompt as an administrator and change to the directory you extracted the MSIXMGR tool. |
| 63 | + |
| 64 | +1. To create the VHDX disk image, run the following command: |
| 65 | + |
| 66 | + ```cmd |
| 67 | + msixmgr.exe -Unpack -packagePath "C:\msix\myapp.msix" -destination "C:\msix\myapp.vhdx" -applyACLs -create -fileType vhdx -rootDirectory apps |
| 68 | + ``` |
| 69 | + |
| 70 | + The output should be as follows: |
| 71 | + |
| 72 | + ```Output |
| 73 | + Successfully created virtual disk |
| 74 | + Stopping the Shell Hardware Detection service |
| 75 | + Stopping dependent services if necessary. |
| 76 | + Successfully initialized and partitioned the disk. |
| 77 | + Formatting the disk. |
| 78 | + Successfully formatted disk |
| 79 | + Starting the Shell Hardware Detection service |
| 80 | + Successfully started the Shell Hardware Detection Service |
| 81 | + Finished unpacking packages to: C:\msix\myapp.vhdx |
| 82 | + ``` |
| 83 | +--- |
| 84 | + |
| 85 | +## Next steps |
| 86 | + |
| 87 | +After you've created the MSIX package, you'll still need to do the following tasks: |
| 88 | + |
| 89 | +1. Copy the resulting VHD, VHDX, or CIM file to a share where your session hosts can access it. To learn about the requirements, see [File share requirements for MSIX app attach](app-attach-file-share.md). |
| 90 | + |
| 91 | +1. [Publish MSIX applications in Azure Virtual Desktop](app-attach-azure-portal.md). |
| 92 | + |
| 93 | +Here are some other articles you might find helpful: |
| 94 | + |
| 95 | +- Learn more about the available [MSIXMGR tool parameters](msixmgr-tool-syntax-description.md). |
| 96 | +- [MSIX app attach glossary](app-attach-glossary.md) |
| 97 | +- [MSIX app attach FAQ](app-attach-faq.yml) |
0 commit comments