Menu Close

Creating VHD for MSIX app attach

Note: This article reflects functional and UI changes introduced in MSIX Hero 0.3.32.0.

Starting from version 0.3.0.0, MSIX Hero has a handy feature which makes it easy to create a VHD image and scripts for staging, registering, unregistering and unstaging. This is a foundation for a new cool concept, named MSIX app attach (casing sic!).

Introduction

MSIX is just a modern Windows app package format. MSIX app attach on the other hand takes the packages in this new format, and dynamically attaches them to Windows Virtual Desktop Session. Since the attached packages are expanded on read-only virtual disks, attaching and using an app is really fast and unnoticable to the user. And yet it still provides all benefits of maintaining minimal number of images, which are dynamically enhanced by the apps the user needs and can access. This all is possible without installing anything, with just only a minimal registration step that takes place. MSIX app attach is still in preview and will be available in upcoming version of Windows 10.

Now back to MSIX Hero. The app has an ability to create attachable VHD disks + necessary scripts to test app attach out. This just eliminates a few manual steps that the user otherwise must do before getting any app attached. The automation built into the tool closely follows the steps from the following website:

https://docs.microsoft.com/en-us/azure/virtual-desktop/app-attach

Here is a UI for it. The dialog can be found in the EDIT > MSIX app attach VHD generator accessible from the main ribbon.

MSIX app attach dialog

Prerequisites

The official cookbook from Microsoft uses PowerShell script which relies on the presence of Hyper-V module. MSIX Hero does this a little different (using system diskutils) and as such does not require Hyper-V modules at all.

Selecting the maximum VHD size

There are two options. If you let MSIX Hero select a size for you, it will automatically check how big the uncompressed files are, add an extra buffer for safety (currently double the original size) and round it to next 10MB. So for the package of 15MB size (compressed) and 27 MB after extraction, MSIX Hero will use a dynamic container with maximum limit of 60MB. Since a dynamic container is used, the actual size will be lower.

If you select the maximum size on your own, the value will be used as-is. In this case make sure that the whole uncompressed package content fits into this new size, otherwise the following may be shown:

Generating the scripts

This page https://docs.microsoft.com/en-us/azure/virtual-desktop/app-attach contains four PowerShell scripts with placeholders to replace. The scripts can be used to test attaching of apps. MSIX Hero uses these scripts in unchanged form, and upon creation of VHD reads necessary details (like disk identifier, folder names etc.) and puts them in the right place. The only thing to be adjusted is a UNC path informing the target OS where the actual image is stored. This must be changed manually.

If you disable the checkbox, the scripts will not be created, and it is completely up to you how you stage and register the app. Once app attach is officially available, there will be most-likely a better way of managing this, right now it is still for an early testing and preview.

Extracting the certificate

Optionally, MSIX Hero can also extract the certificate and put it next to the disk image. You should consider enabling this option if the MSIX package expanded to a VHD is only self-signed, so that all necessary files (VHD, scripts and a certificate) are in one folder.

All extra files share the name/prefix of the VHD file, making it easy to understand the relations between them:

Files created from a single MSIX.

After the VHD, scripts and/or a certificate file are created, you can follow the instructions from MSDN (see links a few paragraphs lower) which explain when and how to call them to get app attach up and running.

Permissions

In order to create VHD and expand MSIX package to it, you must be a local administrator. MSIX Hero will self elevate itself if it is not started as administrator.

More information and links

More information about MSIX app attach: