Windows Virtual Desktop Custom Image and Session Management Walkthrough

Windows Virtual Desktop Custom Image and Session Management Walkthrough

in this video I’m going to show you how
to use custom images in the new Windows virtual desktop service Hello everyone
this is another video and as series I’m doing on Windows virtual desktop in this
video I’m gonna go over creating a custom multi-user Windows 10 image and
using it as a template for Windows virtual desktop deployments before that
please take a minute to subscribe and click the bell icon to be notified of
new videos and to show my appreciation for subscribing here’s a picture of an
adorable Cavapoo. let’s move on there area couple ways to create images with
Windows virtual desktop the process falls under two basic categories a clean
image managed by some type of software deployment service or a pre created
image the first method would be to deploy a standard image like I’ve done
in the last two videos and then use a service like SCCM chef puppet or DSC to
push software and settings to the OS for Windows virtual desktop
this would include creating deployment and pushing software to the workstation
once they’re deployed this is not much different from a standard workstation
deployment and not what this video is gonna cover I’m going to cover the
process of creating a pre-configured custom image to use as the basis of
deployments this could be done by creating an image locally on hyper-v and
prep it for Azure Microsoft has some documentation on how to do just this
here’s one on converting the virtual disk to hyper-v version 1 and resizing
it here’s information on installing office 365 be sure to follow the steps
for the multi-user version this is not the click to run version this is the
traditional MSI install and here’s information on uploading the image to
Azure storage or you could do it the easy way and the way I’m gonna do it in
this demonstration as I was hunting for a multi-user Windows 10 image and
reviewing the process of deploying office in a multi-user environment I
checked what was available on the user market I was happy to find a multi-user
version of Windows 10 with office 365 pre-installed this is a great time saver
it’s the exact multi-user version needed with all the required Azure settings
and office installed and ready to go with that as a starting point here are
the steps I’m going to take to create the custom image first I’m going to
deploy the Windows 10 multi-user with 365 preview image on an azure VM with
non-managed disks although I think manager would work just fine for this as
well once that’s deployed I’ll log in and add
any additional software and make any other customizations needed such as
modifying the Start menu with the image ready I’ll run sysprep and shut down the
OS the OS disc from the template VM is then used as the base for deploying
Windows virtual desktop keep in mind that my goal is not to do a deep dive on
configuring custom images but to show how you can use a custom image in a
Windows virtual desktop deployment I’m gonna take some steps to customize the
image but not going to too much detail on that so enough of me yammering on
let’s get into the demo buckle up everyone it’s time for demos so this
demo I’m gonna go over four things first I’m going to deploy a Windows 10 1809
template with office 365 already installed then I’m gonna customize that
template by adding some software and making changes to the Start menu after
that I’m gonna sysprep the template image and to get it ready for deployment
and then I’m gonna use that as the base to deploy Windows virtual desktop so as
I stated before you could get yourself a copy of Windows 10 Enterprise 1809
multi-user and then go through all the steps of installing office 365 but that
has to be the version that can run in a multi-user environment then you would
need to prep that OS on a Windows hyper-v server version 1 and do all the
steps outlined in the documentation to get it ready for Azure or you could go in
and just do it in Azure I’m gonna search for Windows 10 and here we go it’s
window Microsoft Windows 10 plus office 365 ProPlus so I’m gonna click on this
version and here you can see it just says Microsoft Windows 10 office 365
ProPlus the last time I did this there’s some language in here that indicated it
was the multi-user version if I click on crate we can see here it’s showing the
image is the virtual desktop preview 1809
with the Office ProPlus so this is the one we need now I’m gonna leave that as
pay-as-you-go I’ll create my new resource group and I’ll just name this
template and I’ll add that to central that’s my preferred region I’m not gonna
have any infrastructure redundancy you can change size as you see fit
I like using the b-series they’re a little bit less expensive but I will
note if you’re planning on adding software don’t skimp too much on this
that can lead to a lot of waiting so I add your username and password this is
the same as deploying any other virtual machine in Azure you can see license is
all greyed out you do need the Windows 365 license I think it’s an e3 or e5 Cal
definitely consult your licensing expert I’m just gonna use a standard hard drive
and under advanced I’m gonna select the option for not to use manage disk
there’s lots of good reasons why to use managed disks but for this I don’t want
to pay for this machine just in the off state there’s no real reason to have
managed disk for this so I’m gonna use unmanaging that way I’ve got a storage
account that I can reference when I actually do the deployment here I’m
gonna add it to an existing v-net that I have I don’t need a public IP well I
guess there we go no accelerated networking pretty much
basic all I’m doing is logging in and installing some software on this so I
don’t need a whole lot well this skin by that should do tags
but I’m not going to and review and create so validation passed so now you
just hit crate and let it deploy and then login once it’s done all right
through the miracle of editing I jumped ahead a little bit
I already had this deployed and I’ve got some applications on here I’ve got
Chrome I’ve got notepad++ I installed
Visual Studio code and that’s the system version not the user version system will
be available for all users obviously this is multi-user desktop that’s what
you want all I did here I wanted to give some examples of just random
applications that somebody might use in a real environment so on the Start menu
one thing I’m going to do is just delete this or unpin it so I don’t want people
to see you the store let’s see if I can just add these from here pin to start
there we go now we can move these around here it is all finished I don’t intend
this to be a deep dive into customizing Start menus and application deployments
I just want to give an example of how somebody might customize make some
customization changes on the template that they’re going to use to deploy
within Windows virtual desktop now that I have that Start menu set up the way I
want it the next thing I’m going to do is run PowerShell let me go to the
desktop directory I’m going to export the start layout with the export start
layout command okay so that puts it on the desktop now
I’m going to import it and what by importing it it’s going to set it as the
default for every new profile there’s a whole art and science behind this as far
as setting mandatory Start menu layouts versus default and how they’re applied
you can do the sort of GPOs and a whole bunch of stuff but for this I’m just
going to keep it simple and that’s all there is to it now the
next thing I’m going to do is go into file explorer because one of the
problems that I’ve seen is when a user logs in they are not going to have the
option to shut down they’ll just have disconnect they can’t restart because
they’re not going to be local admin so they don’t have that right the only
thing they can do is disconnect and you really don’t want people disconnecting
in the terminal session because the session will just kind of hang out there
eating up resources so if they’re done you want to encourage them to actually
log off so what I’m gonna do is go okay here’s shutdown dot exe undersea
windows system32 and I’m going to create a shortcut and I’ll just cut it we’re
gonna go to see users public desktop there it is you can see the shortcuts
that are on the desktop are already there any shortcut in this folder will
be available to all users because it’s public I’m gonna paste it and then we’re
going to go into the properties and what I’m going to do is add shutdown – L so
the target will be the – L which means logoff and I’m going to change icon to
this one you can set up for whatever you want we have to name this logoff okay
now the users have a log off button on their desktop and let’s double click
that and it worked and I’m back so now that that’s done we have our image ready
to go the desktops looking the way I want it I’ve got the Start menu which if
everything goes well is going to be replicated for every new user that logs
into this image the next step is to run sysprep so what’s sysprep does it
removes unique settings within the OS
kind of turns it back into like an out of box experience like if you just had
installed this fresh but we’re leaving some of these remnants behind that we
made modifications to so what we’re going to do is run sysprep so what we’re
going to do is go into Explorer and go to c windows system32 sysprep will run
this now we’ve got a couple options here so the system cleanup action we’re gonna
leave it at out of box experience and then we’re gonna generalize generalizes
what’s gonna strip away all those unique IDs and have them recreated the next
time it restarts we’re gonna set this to shutdown so when it’s done it’s just
gonna shut down and after it shuts down I won’t turn this back on because the
next time we turn this on it’s going to run through a setup process that’s going
to ask for a name local admin account passwords all that stuff just like we
did the first time we don’t want that on the template we’re gonna use that image
or that state for the actual deployment so we’re just going to shut it down the
only time I’ll turn this back on is if I want to make adjustments to the base
image and use that for another deployment so let’s say I wanted to add
a couple pieces of software I could turn this back on add it make my changes run
this sysprep again with the generalise and use that updated version as a new as
a new template for another deployment and one thing to note because after I
hit after this shuts down I’m just gonna leave this template sit I’m not gonna
reference it again make sure you go into the VM settings in Azure and deallocate
the VM is just by shutting down here you’re still paying for it but if you go
into Azure deallocate this VM then you’re not paying for it anymore
so I’ll hit OK and that’s just gonna take a couple seconds to run and it will
shut down okay there we go to shut down that took a little bit longer than I
wanted but anyway here I’m gonna hit stop
remember I said we have to hit stop otherwise we’re paying for it now what
I’m going to do is go into disks and here it is I’m going to click to copy so
we have the virtual hard drive URI now and what I’m going to do I’ve got that
stored local I’m going to go in and do a new Windows virtual desktop deployment and provision a host pool so I’m gonna select
pooled it’s gonna ask for default users and I have to go back and copy that
because I’ve got multiple users this time so I’m just gonna paste that URL
into a different at window and then I’ll come up we’ll paste those users in
resource group I’m going to create a new one we’ll call this something clever
we’ll keep it in central us and I’m going to do a total of 5 and I’ll do a
b-2s see I want to do – this time there so if I change it to 10 it’ll give me
the option for 2 ok so now so now we have the option of blob storage or
managed image I’m going to select blob and the image URI that is that URL that
I copied from the storage account I’ll keep it a standard disc and the UPN to
join the domain I’ll add that I’m gonna specify the domain and oh you I’ve heard
a lot of people have problems with this so some advice I’d have is make sure
that the v-net you are adding these to can
connect to your domain controller for whatever domain you’re entering be sure
to change this from contoso to your actual domain and if you still have
problems deploy a single server into connected to that same v net and subnet
that you’re using for a deploying Windows virtual desktop and try adding
it to the domain with the same account that you’re using just to make sure
everything’s set up because if that doesn’t work then this definitely won’t
work I won’t use manage disks I think this is a new since the last time I did
a video so I’m selecting VNets and subnets I already have in place and what’s this saying okay so I can’t use
that because it’s already taking storage account names have to believe be
globally unique here we’ve got the tenant group and then we’ve got the
tenant name and I’m gonna add a UPN I’m not using a service principle I’ll go
over that in another video and there’s all the details it’s gonna validate and
once it’s passed I’m gonna click OK and create alright I’m gonna pause here this
should take about 20-30 minutes to deploy and once it’s done we’ll come
back and try logging in and see if those new desktop settings held and I’m back
that took a little bit longer than expected and full disclosure it actually
failed the first time I had to rerun the same deployment but this time with
managed disks instead of using the standard or unmanaged disks and it went
through ok so if you’re wondering why in the demo before I showed setting up
unmanaged disks and you’re seeing manager that’s why so I’ll
dig into that issue later but for now let’s move on I’ve got three windows
here we’ll start with this one so I logged into the workstation with
one of the three accounts and as you can see I’ve got my icons here a little bit
different order but that’s okay and you can see I’ve got the log off and also if
I go into my start I do have the icons in the Start menu there could be a
little bit of work done to improve the layout but for now that just shows that
I am using the same image so let’s go in here and sign on with the other two
accounts so that’s a user 2 and here I’m going to log in with user 3 I’ve got
three accounts now logged in to Windows virtual desktop – in to the Rd website
I’m using the web client for this one and I’m actually using each window as an
in private session so I can log in three times with different accounts so I’m
gonna click here and will log in to the actual Windows virtual desktop as before
I’m first logging in with the azure ad account and then when I try to log into
the workstation I’m actually using Active Directory authentication for that
second login although in this case the username and password is the same
because I’m using ad sync or ad Connect and I’ll log in with the third user so
here’s the second user and you can see it’s the same thing I’ve got the same
icons and the same Start menu and the third should be the same way give it a
second to login same menu are same icons on the desktop and the same Start menu
so there’s consistency in how users are logging in and viewing the desktops the
reason I did three users is because I only deployed two virtual machines so
you can see here’s 0 or the first one and one the second one you
in order to get three users to log into 2 Windows 10 virtual machines I had to
use the image with the multi user experience and just to show that I’m
gonna go over here and I’ve got some new RDS commands for PowerShell I did
connect already to my tenant and if you don’t have these commands you can
download them I gave the link in the last video so the first thing I’m gonna
do is run this command that gets all the session hosts so here you can see I have
two what I’m gonna do though is I’m going to just I’ve got a little bit of a
better format on this so here we can see the name of the service host and then
it’s allowing sessions and the number of sessions each and its status one of the
management tasks I had to frequently do in an RDS environment was identified
who’s logged into what server and sometimes I had to take that server out
of the pool or not allow new connections so I could bleed off the existing
connections and maybe do maintenance on it shut it down restart at whatever so
what I’m gonna do here is I’m gonna keep working through I have user sessions
here so we can see what users are actually logged in and again I just
changed the format a little bit modifying the output so I can see we’ve
got three session house so we have two users and we have test user two and
three are on zero whereas test user one is on dash one so what I’m going to do next
is I’m going to simulate bleeding off users and what we’re gonna do is set the
RDS session host to allow sessions false so this is going to not allow any more
sessions but before I do that I’m gonna hop over to let’s see here we’re gonna
do this to virtual machine 0 so these bottom two so yours is 2 & 3 I’m first
going to kick off or actually log off so I go here I’ve got the log off button now if I run this get RDS user session
command again we can see we only have one user attached to session host – one
I’m going to run this command to disable new logins and I’m just going to get the
session host servers one more time and here we can see zero the first one on
the list here is not allowing any new sessions so I’m going to come back here
and just log in again as the same two and three user now I’ll do user 3 so there we are now let’s go back into
vs code and I’m gonna run this command again and good to be honest I have not
actually done this so this is the first time I’m doing it I’m glad it
worked as I expected so we’ve got a number of sessions on – 0 is 0 and – 1
is 3 so all three users are logged into that same server now and again we can
see same desktop settings and the same Start menu and next I’m going to get RDS
user session and I can expect what that’s going to tell us yep all three
users user 1 user 2 user 3 are all on the same session host I’m gonna run this
again and set it to true so now I’m going to allow sessions on that session
host and let’s view the session host one more time just to make sure that set
there we go now this time I’m going to log out user
1 and log back in and we should see a go to the other available server now in
this instance I’m using the default breadth-first load-balancing type if I
had used depth-first if I had changed it from the default we would have seen all
the users go to the first session host until that max count or max limit is
reached and then the users would start going over to the other the desktop is looking the same but if I
come over here and get the user sessions we can see now user one is on CirVM-0 well the other two are still on the – one session host that’s all there
is to this demo so that is how you create a custom image use that for a
Windows virtual desktop deployment and manage user sessions fun of course all
environments are different and this process might not work for everyone
you may be required to deploy and manage all software from a service like SCCM
in reality the steps to setup Windows 10 multi-user environments is not much
different from configuring a session host in an RDS environment the Windows
10 multi-user with office pre-installed available in the Azure marketplace is a
great option for people testing the new service or as a starting point for
production deployments once this product is GA I hope you found this informative
thanks again for watching please subscribe and click the bell icon to get
notified when new videos come out thanks again

7 thoughts on “Windows Virtual Desktop Custom Image and Session Management Walkthrough”

  1. Travis, thanks for the video. What is the process for updating applications/adding applications? Do you need to go back to the base image, update it, then re-deploy?

  2. Why do you use the shutdown executable instead of the logoff exe? Wouldnt shutdown, SHUTDOWN the pc thus kicking off everyone on that shared windows virtual desktop?

  3. I think the Azure UI has changed for making the image. I could not find the VHF URI. 
    To get around this I had to "Capture" the VM to create a template I could then use during the Windows Virtual Desktop deployment.

  4. Hi Travis, thx for the amazing videos for WVD. Would be great if you make some videos about RemoteApp Groups in WVD ,assign the users and access permissions and publish the Apps.

  5. 1) What to do if you have to update the OD and Application?
    2) Did you install FSLogix or was it in the image?
    3) If you have a LOB server, we have to install on the same subnet, yes?
    4) How long was the first logon time for each user?

Leave a Reply

Your email address will not be published. Required fields are marked *