Create a simple stateless desktop for testing using VMware Workstation
A couple of days a week I am pretty active in the VMware UEM VMTN forum trying to help out other people and learn from it as well. More than once I try to test (new) config files, profile archives and user environment settings and report back about the findings or solutions. For this I normally use a VMware Horizon View environment in my home lab with Windows 10 VDI desktops and an optimized local profile. But for simple off-site testing of user environment settings and the persistence of settings in a stateless desktop environment and creating a “sort of” mechanism that is used with VMware Horizon View (reset/recreate the machine), I now use a Windows 10 virtual machine in VMware Workstation that automagically reverts back to the last snapshot at logoff. The setup for this configuration is what I want to share in this blog post. Sure, there are other ways. But just trying to show other (simple) possibilities 🙂
- VMware Workstation
- OS installation (ISO)
- Active Directory
- Script (CMD)
Step 1 – Create the virtual machine and install the OS
Start by creating the VM and install the OS you want to use. I’m using Windows 10 in this case.
Step 2 – Join the machine to the domain
Join the virtual machine to the Active Directory domain.
Step 3 – Install required software/services
Install your required software and/or services. For instance, Microsoft Office, VMware UEM FlexEngine, etc.
Step 4 – Customize the default user profile (Optional)
You can customize the default user profile using the following source:
Step 5 – Create a snapshot
Shutdown the virtual machine and once it’s powered down create a snapshot using VMware Workstation.
Step 6 – Configure the virtual machine to revert to the last snapshot
Go to the settings of the virtual machine and on the Options tab click Snapshots and select Revert to snapshot for When powering off.
Step 7 – Configure the GPO
Configure a GPO that applies to the virtual machine in Active Directory and use the following settings:
I use the Disable machine account password changes setting to prevent the virtual machine from reporting there is an issue with the trust relation between the virtual machine and the domain after one or more snapshot reverts.
If you are using VMware UEM, off course also configure the GPO (VMware UEM ADMX) that configures the VMware UEM FlexEngine and apply it to the user(s).
Step 8 – Create the logoff script
For the logoff.cmd script that you use in the GPO that was created in the previous step, use the following content.
:: Save settings using VMware UEM FlexEngine (optional) "%programfiles%\Immidio\Flex Profiles\FlexEngine.exe" -s :: Shutdown the machine and let the Revert to snapshot virtual machine setting do the rest shutdown /s /t 2 /f
Step 9 – Good to go!
You can now start the virtual machine, test your settings and logoff or shutdown. The virtual machine will be reverted to the last snapshot. Power on the virtual machine to start with a clean machine again.