1. Create a new Azure VM
Now let’s create a virtual machine. I will go to “virtual machines” and add a virtual machine. So this is the place where we can create it. I will create a new resource group. I will call this one the WVDVM Image Resource Group. Okay, let’s give it a name. WVD image. So this is the name of the virtual machine. And for the region, I will need to select the same one as everything else. So I have them in East Texas. I will have no availability options because it’s only an image. And for the image itself, what is the preconfigured image I want to use from Microsoft so I can then install what I want? So, let’s look for Windows 10 and go with a multi-language version.
And so I can take advantage of the FSLogix technology with the user profiles. When we use a multi-session Windows Ten Enterprise multi-session, it means it supports that scenario. It is the only image that will support that scenario. So if you want to use the pooled option and have more than one user be able to connect to one virtual machine and have a full desktop experience, then the Windows 10 enterprise multi-selection is the one for you. And this is the reason I’m looking for this one. So I will look for another one with all the Microsoft 365 applications installed so I don’t have to do the installation myself from scratch. So I will go with this one. So I have selected the image, and okay, let’s see the size. I’ll leave it on this one. This is good the admin.
Let me select a demo user. There is a password for why this is red. No, it’s okay. D two S. I want it to be premium because it will be faster, which means it will have an SSD 2 and a good 8 GB of storage. Yes, I will continue with that. And, yes, the demo user. I have said that for the ports I will need the RDP, so I will keep it. And for licensing, you confirm if you have the licenses. I will need to confirm that I have the illegible Windows 10 licenses. Please review our previous lectures on licenses, and let’s review and create the validation passed, and we’re ready to go and create the virtual machine. So, in the next lecture, we will run a virtual machine and begin preparing it to be our custom image.
2. Prepare the VM Image & Configure FSLogix for the VM
The virtual machine has been created. So now let’s RDB so we can prepare the virtual machine. Now I’ll connect and download the RDB file, and this is my Windows Ten multisession desktop. So here we go. You can do many things to prepare your virtual machines. The most important thing, of course, is to install your line of business applications or prepare any type of application required. This Windows multisession has already installed the required Microsoft applications. I selected this one so we can have them installed. One of the most important things to do is to go to settings, then update and security, and of course check for updates; if there are any, make sure it’s up to date, especially for security updates, and perform any necessary restarts. Now, one of the topics I’d like to discuss with you is FSLogix, which is very important to us and is related to the course content. So you remember that we created the containers with the Azure File Share.
Now we need to configure FSLogix on this image, a custom image, so that it understands it needs to use the FSLogix technology. So the way to do that is I will need to go to Internet Explorer or any other browser you have on the VM image, and I will just go to this link, which I will make sure to provide to you in the resources section of this lecture, and I will save the file. So this is the download file for the FSLogix. There’s no need for this browser. And let me just go to the downloads section. So this is the downloads folder. I will extract the downloaded file so I can run the installation. So up to this point, we just wanted to install the FSLogix client. We have 132, and we have 64.
I will go with the 64, and this is the file for the FSLogix app setup. I double-clicked on that so we could install the FSLogix. So yeah, this is the installation dialogue. You read the terms and conditions, and you agree. You can see the options if you want to install them. I will keep it as it is, or I will install them. It’s a small client that will not take that much time. So once it is installed, we will make sure to properly configure the FSLogix. The setup is successful; let’s close it. Let’s just go verify that we can find it under the C programmer files. And here is FSLogix. So everything is fine. Now, what we need to do at this point after the installation is done is go to the start menu and type in Reg Edit. As a result, there are three editors. From here, you go to the locker machine software and FSLogix. We want to create a new key and name it “profiles.” Now onto those new key profiles. We want to right-click and add a new D or type value. This one needs to be enabled, and the value needs to be set to one.
So it means “enabled.” True. Another new value is going to be a multi-string value. Can you guess what this is going to be? So let’s see. It needs to have the name “VHD locations,” which is going to be the location of the user profiles, which means that whenever a new user signs into this machine, the VHD location of that user profile for that user is going to be the location we will specify in this value. So let’s specify the value. And of course, as you have expected, right now it’s going to be the value for our file share and for the profiles folder that we have created for the FSLogix. So this is what all that section was about. Creating the Azure file share, making sure we have good permissions (file share permissions, NTFS permissions), and creating the folders needed for the structure of SFS logic And the profiles folder is the one we need to configure this virtual machine to use FSLogix. and we click OK.
Can it contain empty strings? You click OK, and then it has it. That’s it. It was created, and we have the values. Everything is fine. We’ve now enabled FSLogix for this virtual machine, and the multi-session virtual machine is ready to use FSLogix. Now of course, you can still do alot of things to prepare your custom image from installing applications to playing with the settings. along with playing with the Microsoft applications. Microsoft has a great deal of documentation for how to install everything for a multi-session image. As an example, consider Microsoft Teams. You can feel free to go and look for that. But for now, we have prepared our image for this project demonstration so we can use it later. We can do the generalization, and we can create the Azure image so we can use it in our hostels. Bye.
3. Generalize the VM using Sysprep
Once your custom virtual machine is prepared and ready, you should install any necessary security updates. You have installed your application. You have done your settings, installed the FSLogix client, and configured FSLogix properly.
It’s time for you to generalize the image so you can use it later. So how do we go through this generalization process? We will use a tool called Capri, or system preparation, and we will need a command prompt for that. I will run it as an administrator, and what I will do is navigate to where I can find the tool and enter. So right now I’m in the proper directory, and the command to be used is this one.
And you ask it to do a generalization and then to shut down the virtual machine. Once everything is done and ready and you click “enter,” it’s going to do its work right now, and then it’s going to shut down the virtual machine for me. Once it’s done, we are going to go to the next step, which is making an image, an AzureVM image, out of this virtual machine. I’ll see you at the next lecture.
4. Create a managed Azure VM image from the VM
So now it’s time for us to create an Azure image using our custom virtual machine. Let’s navigate to the virtual machine, and we need to make sure it is indeed assigned status. So we need to click on Stop, and okay, now it’s stopping the virtual machine, and once it’s stopped, we can continue this process.
The virtual machine is now marked as “stopped and allocated,” indicating that it is ready to use. I will go and use the capture tool. Click on Capture, and it says, “Before creating an image, use the sysprep to prepare the Windows guest operating system on the virtual machine.” So let’s do that. And we did just that in the previous lecture. Now, this is the name it suggests for the image. Let’s keep it as it is; the WVD image and so on provide it, and actually this is something we will need to keep a record of so we can use it at a later point. Then the resource group I will keep it in the same resource group where I created the virtual machine. Before creating the image, this virtual machine will be de-allocated in an automated fashion. I have already de-allocated it to save time, and it says you can actually delete this virtual machine after creating the image. Yes, I want to delete it now.
If you want to take a snapshot of this virtual machine or of this image, you can select this option to be on for zone resilience. And it says capturing a virtual machine will make the virtual machine unusable. This action cannot be undone. I know that. And then, for confirmation, it asks for the name of the virtual machine. The name of the virtual machine is the WVD image. So this is it, and I will click on Create. Now, as you can see, it says, “generalizing the virtual machine creating the image.” So the image is being created for me at the moment. So the creation of the image was successful. The virtual machine was successfully deleted after the image was created. So let me go on, and if I go to the search bar and look for images, this is where I shall find my own image. As a result, here is the WVD image. And this is the image I have created, and now it is ready to be used whenever I want to create a virtual machine for the WVD.
5. *NEW* – Shared Image Galleries
Making your own custom image helps you manage the VM version, specifications, and applications installed. You can then use that image to provision host pools then. However, in real-life scenarios, maintaining several images could be a tedious process if not organised properly. For example, an image created in region A cannot be used in region B, and this is where the Shared Image Gallery comes in. So what is shared? Image gallery. Custom image sharing within your organisation is made easier with Shared Image Gallery. It lets you share your custom VM images with others in your organisation within or across regions.
Within an Active Directory tenant, shared images can be replicated to multiple regions for quicker scaling of your deployments. This has and continues to provide numerous advantages. So the benefits of the shared image gallery are that it gives you global replication of images. It gives you versioning and grouping of images for easier management. Images that are highly available thanks to dawn redundant storage and premium storage support Premium LRS. also sharing across subscriptions and Active Directory tenants using Azure RBAC or role-based access control, and scaling your deployments with image replicas in each region. The Shared Image Gallery has these resource types, as you can see in the diagram before you. You can see the Shared Image Gallery is the main thing where you can have image definitions inside it for more than one image, and each image definition can have many versions. So what are those resource types? The Image Gallery is basically a repository for managing and sharing images.
You can control who has access to these shared image galleries. An image definition, which can be created inside the Shared Image Gallery as we will see soon, is created within a gallery and carries information about the image and requirements for using it internally. This includes whether the image is Windows or Linux, as well as the minimum and maximum memory requirements specified in the release notes. So it is a definition of the type of image that the versions inside the image definitions will share. So this takes us to the image version. So an image version is something you use to create a virtual machine. When using a gallery, you can have multiple versions of an image as needed for your environment. And like a managed image, when you use an image version to create a VM, the image version is used to create new discs for the VM. Image versions can be used multiple times. So now that you know what the Shared Image Gallery is and what the resource types are in a Shared Image Gallery, it’s time to see how you can deploy and create a Shared Image Gallery. So first you go to the search bar and you search for “Shared Image Galleries.” Then you can click on Create, and you can provide the information needed there. So you’ll need to specify the subscription, a resource group, and I gave it the name “images,” the name of the Shared Image Gallery, and the region. I will go with West Europe in this demonstration and then review and create.
As a result, it is reviewed, validated, and created. Once the image gallery is created you can go to the shared image galleries and from there you can see the image gallery you have created and you have the possibility to add a new image definition. You can add more than one definition inside that shared gallery. So this is how you create the shared image gallery. As for the image definition, you cannot ignore three important steps: the basics, the version, and the publishing options. As for the tags and Review and Create, these are things that you are familiar with at this point, but the important ones are the basic version and publishing options, which I will discuss with you in the next few slides. Let’s start with the basics. So when you want to create a new image definition in the Basics tab, you will have to provide some of the basic information, such as the region, the type of operating system (Windows or Linux), and the system state. You can give it a publisher, offer, or sq name. This could be your own name, such as “My publisher,” “My,” “Offer,” “Mysq,” or something else. So basically, you are providing some basic information.
However, in the version tab, you provide some information related to the version of the image. So you give the version a name. As you can see, you give it a name, and it has to be in a specific form. This is why it gave me the red highlight, and you give it the source image, which is your custom image that you have created, and then you have the option to provide the replication details so you can have that image that you have selected replicated to more than one region. So your users can use this custom image in those different regions, and it can be replicated in case of any failure as well. And this is what is important in the Version tab, because the last tab is the publishing options, where you can provide some optional publishing metadata and, of course, the VM deployment information. This is important if you want to specify recommended VM virtual CPU numbers and recommended VM memory as well. This is where you can specify all that. Once you are done with these, you can just proceed to tag, review, and create. And this is how you create an image definition with an image version in it. So you can use the shared image gallery.