To use MSIX App Attach you need to extract an MSIX package to a VHD or a VHDx format to then mount the drive to the Virtual Machine. But there’s a third format that can be used, namely Composite Image Files System or .CIM in short. This is a new file system introduced by Microsoft to use in combination with MSIX App Attach. Why need a new file system? CIM provides better performance when compared to VHD(x). Microsoft preformed a comparison test between VHDX and CIM where they mounted 500 files in each format, each file being 300 MB. With the following results:
|Average mount time||356 ms||255 ms|
|Average unmount time||1615 ms||36 ms|
|Memory consumptions||6% (of 8 GB)||2% (of 8 GB)|
|CPU (count spike)||Maxed out multiple times||No impact|
As you can see the load on the machine with CIMFS is significantly lower than when compared to the mounting of VHD’s. This information was shared during the Windows Virtual Desktop masterclass. Microsoft host these sessions every few month and are free to follow, so make sure to sign up for the next one! The sessions are always packed with information and new announcements. That begin said let see how to create a CIM file.
- Download the new MSIXMGR from https://aka.ms/msixmgr. Extract the (x64) contents to c:\temp\msixmgr
- An MSIX application. If you don’t have one view this article on how to get started
- A WVD host pool with MSIX App Attach enabled. View this article on how to set it up.
- The WVD host pool should have the Windows 10 20H2 multi session as OS
Creating CIM file
The MSIXMGR tool has some handy functionalities backed in. Extracting a MSIX to a VHDx there were many steps involved like creating a VHDx file, mounting and extracting the MSIX and dismounting the disk again. The MSIXMGR tool automates these steps. Now we are going to generate the CIM files but the same steps can be used for the creation of VHD(x) files.
- Open Command prompt in elevated mode
- Navigate to the MSIXMGR location (c:\temp\msixmgr)
- Run the following command
msixmgr.exe -Unpack -packagePath "C:\Users\Stephan\Desktop\ CitrixReceiver_184.108.40.206_x64__v1hrd262mcs5e.msix" -destination c:\temp\output\CitrixReceiver_220.127.116.11_x64.cim -applyacls -create -vhdSize 100 -filetype “CIM” -rootDirectory apps
In c:\temp\output you will find all the different .cim files. You will need all the files for in order to make this work.
If you don’t want to use CIM and just a VHDx file you can use the same command but simply replace cim with VHD(x).
msixmgr.exe -Unpack -packagePath "C:\Users\Stephan\Desktop\ CitrixReceiver_18.104.22.168_x64__v1hrd262mcs5e.msix" -destination c:\temp\output\CitrixReceiver_22.214.171.124_x64.vhdx -applyacls -create -vhdSize 100 -filetype “VHDX” -rootDirectory apps
MSIX App Attach
Copy all the .cim files you created to the file share that have been set up for MSIX App Attach.
In the Azure Portal go to your host pool and select MSIX Packages. Choose Add and provide the UNC path to the cim file. In my case this is \\man-0\appattach\CitrixReceiver_126.96.36.199_x64.cim. Make sure to put the State on Active.
Go to your Application Group settings. Here you have two options. The first option is to include the application in the Default Desktop application group. The application will be available to the users when he signs in. Or you can create a remote application group which will only provide the remote app. In my case I will be using the default desktop group. So select the group, choose Applications and choose Add. From the dropdown you can select the newly added application. In my case this is Citrix Workspace. Make sure the assign the application group to you users.
To test sign in on the host pool where you should now see the newly added application based!