FSLogix 2.0 - Simplicity Still Wins

Posted by Thomas Krampe on Aug 20, 2015 11:46:00 AM

FSLogix added a new feature in version 2.0 which dramatically simplifies the administration and the management of user profiles on Windows machines. Instead of configuring local or roaming profiles the old way and managing them through various more or less complex tools, FSLogix is moving the entire user profile to a virtual hard disk (VHD or VHDX) which will be saved on a network share. In the following blog post I try to show how to configure this feature.

The first step is the installation of the FSLogix Agent into your virtual desktop or session host base image. The installation is self-explanatory and needs only a valid license key. As soon as the installation is completed the agent can be found under %Program Files%\FSLogix. To activate the profile disk we must use the registry editor and create some additional registry keys.

fslogix20_01

First we have to create a new key named Profiles under HKLM\SOFTWARE\FSLogix. Inside this key we have to add the following values ​​:

Key

Type

Value

Description

VHDLocations

REG_MULTI_SZ

\\server\share\Profiles c:\folder\Profiles

Network and/or local paths to search for profile VHDs. (required)

VolumeType

REG_SZ

VHD or VHDX

Default is “VHD”. Note that VHDX format is only supported on Windows 8 or Server 2012 (or later). (optional)

VHDXSectorSize

REG_DWORD

0 or 4096 (0x1000)

Default is “0” which just triggers VHD default. (optional)

SizeInMBs

REG_DWORD

30000

Number of MBs for new VHDs – Default is 30000 (30 GBs). Pay attention to Decimal vs Hex when specifying the value. (optional)

IsDynamic

REG_DWORD

0 or 1

“0” means Full Allocation and “1” means Dynamic.
(optional)

 

After these values are created, the FSLogix user profile is active. During the installation of the FSLogix Agents two local user groups were created . With these groups we can control the behaviour of the profile disks.

fslogix20_02

The group FSLogix Profiles Include List contains all users which are Profile Disk enabled. Per default the group Everyone is included in the FSLogix Profiles Include List group. Users which should be excluded from the profile disks must be added to the group FSLogix Profiles Exclude List. The following matrix will show the behaviour of group memberships:

 

Member of Exclude Group

Not a Member of Exclude Group

Member of Include Group

Profile System Inactive

Profile System Active

Not a Member of Include Group

 

Profile System Inactive

Profile System Inactive

 

At this point it is important that FSLogix doesn't migrate any existing profiles automatically. If the user already has a local or roaming profile, FSLogix won’t generate a profile disk for that user, even when he is a member of the group FSLogix Profiles Include List. We can verify this in the Profile.log file at %ProgramData%\FSLogix\Logs\.

[1300] [2015-06-18 09:17:01.468]--- LoadProfile ---

[1300] [2015-06-18 09:17:01.468]User: administrator. SID: S-1-5-21-2181934080-2295135136-1857495712-500.

[1300] [2015-06-18 09:17:01.468]User is a member of the include group

[1300] [2015-06-18 09:17:01.468]Profile already exists

[1300] [2015-06-18 09:17:01.468]All handles closed

[1300] [2015-06-18 09:17:01.468]LoadProfile successful. User: administrator. SID: S-1-5-21-2181934080-2295135136-1857495712-500.

The log file shows that the user Administrator is a member of the group FSLogix Profiles Include List  (because of the Everyone group membership) but already have an existing profile on that machine. 

If a user without an existing user profile logs on to the machine, a virtual disk will be created immediately  based on the registry settings (Volume Type, SizeInMBs, IsDynamic). This is also visible in the log file.

[1300] [2015-06-18 08:46:28.620]---  LoadProfile  ---

[1300] [2015-06-18 08:46:28.620]User: thomas. SID: S-1-5-21-2181934080-2295135136-1857495712-1106.

[1300] [2015-06-18 08:46:28.620]User is a member of the include group

[1300] [2015-06-18 08:46:28.729]Profile VHD not found.  Creating new VHD.

[1300] [2015-06-18 08:46:29.854]VirtualDiskAPI::CreateDisk success

[1300] [2015-06-18 08:46:29.964]AttachVirtualDisk success

[1300] [2015-06-18 08:46:31.167]Volume attach event

[1300] [2015-06-18 08:46:31.214]Formatting volume \\?\Volume{0b8d32f0-521f-474d-856a-968624c7e857}\

[1300] [2015-06-18 08:46:32.824]All handles closed

[1300] [2015-06-18 08:46:32.824]LoadProfile successful.  User: thomas. SID: S-1-5-21-2181934080-2295135136-1857495712-1106.

If we look to the folder C:\Users we can see the mounted virtual disk associated with the username.

fslogix20_03

We are able to check the profile directory (Registry Key VHDLocations) as well. A folder was created that contains the SID and the user name.

fslogix20_04

The folder mentioned above contains the VHD or VHDX file for this particular user.

fslogix20_05

It is important that the user has full control for the VHD or VHDX file.

fslogix20_06

The first time a user logs on to this machine the corresponding profile disk will be created and the user profile will be copied to the virtual disk. It is important to know which disk type (IsDynamic) we use. A fixed disk is created and formatted in full size (SizeInMBs). This means that the creation of the profile can take a little bit longer at first log in, but the performance during operation is much better. A dynamic disk only creates a small part of the disk. The result is a shorter creation period at first login. The performance during operation however is a little bit worse compared with fixed discs, because the disc has to be dynamically extended with every rewrite (up to the maximum size of SizeInMBs).

To obtain the optimum ratio between first creation and performance during operation, it makes a lot of sense to create the virtual disks previously. The VHD or VHDX files can be created with any tool. However, they must fit to the naming conventions and has to be formatted. The virtual disks can be created with the command line tool frx.exe.

C:\Program Files\FSLogix\Apps>frx help create-vhd

create-vhd

  Creates and formats a VHD or VHDX.

  By default the VHD or VHDX will be 30 GBs and sized dynamically.

 Parameters:

  -filename          Specifies the path to the VHD or VHDX file

  -size-mbs          *Size in number of MBs for new VHD(X)

  -vhdx-sector-size  *VHDX sector size

  -dynamic           *Set to 1 if VHD should be dynamic, 0 for full allocation

  -src-parent        *Path to the parent VHD(X) file for differencing disks

  -label             *Disk volume label (default is FSLogix)

  * Optional parameters

Example:

  frx create-vhd -filename C:\Profile.vhd

Existing user profiles must not be re-created, you can migrate them with the command line tool frx.exe as well.

C:\Program Files\FSLogix\Apps>frx help copy-profile

copy-profile

  Copies the specified user profile into a VHD or VHDX.

  If the VHD or VHDX file does not exist, it will be created.

  By default the VHD or VHDX will be 30 GBs and sized dynamically.

 

Parameters:

  -filename          Specifies the path to the VHD or VHDX file

  -username          'username' or 'domain\username'

  -sid               Can be used instead of username to identify the profile

  -size-mbs          *Size in number of MBs for new VHD/VHDX

  -vhdx-sector-size  *VHDX sector size

  -dynamic           *Set to 1 if VHD should be dynamic, 0 for full allocation

  -src-parent        *Path to the parent VHD(X) file for differencing disks

  -verbose           *Enables verbose output

  -profile-path      *Specify the profile path

  * Optional parameters

Example:

  frx copy-profile -filename C:\Profile.vhd -username DOMAIN\USERNAME

C:\Program Files\FSLogix\Apps>frx copy-profile -filename \\prod-nas-03\profiles\vhdx\S-1-5-21-2181934080-2295135136-1857495712-500_administrator\Profile_administrator.vhdx -username administrator

.

Formatting volume: \\?\Volume{387f2592-deda-4b94-b215-fdd8d4a442f4}\

Copying profile for user S-1-5-21-1153888268-1969050066-1261342092-500 to volume

 \\?\Volume{387f2592-deda-4b94-b215-fdd8d4a442f4}\

CopyDirectory: Command: robocopy.exe "C:\Users\Administrator" "C:\Users\ADMINI~1

.MYC\AppData\Local\Temp\2\FrxMount" /B /MIR /MT /R:0 /W:0 /XJD /COPYALL /IS /IT

Operation completed successfully!

Trust me, you can’t do profile management on Windows easier than with FSLogix 2.0. Keep in mind, simplicity still wins.

Topics: profile containers, profile management, VHD, User Profiles

Subscribe to Email Updates

Recent Posts

Posts by Topic

see all

Follow Me