“No Network” is appearing, VMWare Optimization Tool the root cause

When we migrated users to Windows 10 I had initially used the VMWare Optimization tool to apply settings to  VDI and PVS based images. We have had many issues with Networks, MS Store Apps. In short the tool breaks more items then it’s benefit. Since then we have stopped using the tool and now applying the Citrix Optimizer tool as it has proven to be more effective and less intrusive.

Clearing the Settings

The issue thta prompted helpdesk tickets the most was losing network connectivity, usually internet or Outlook connections. The first sign was the Globe in the system tray.

image

What we had to do on many of our images is revert the settings to correct most of the issues. Fixing Store apps is a separate item but most of the fixes or to revert the settings configured by the VMWare optimization tool can be done by:

Log into the VDI in question, you will notice the issue is happening if you see the Globe in the system Tray as above. Launch the local group policy mmc….

image

Sort by All Settings….
image

The settings configured by the VMTool is displayed… you can go through them all to disable all or a few….

image

If you want to quickly rid them all, navigate to c:\windows\system32\GroupPolicy…..you may need to deselect “Hide Protected folders..”

image

image

Under the GroupPolicy folder, delete all items….

image

Perform a GPUpdate….

image

You should see the Globe icon replaced with the Computer icon…

image

If you go back into the local GPEdit msc, all the settings should be gone.

image

.\trevor

What is Remote PC?

Remember when one wanted to access their physical Windows desktop from off site or another location within the building we generally used Remote Desktop Protocol a.k.a RDP. You may be familiar with the icon:

AppVError2017-12-28 11_32_09-Citrix Receiver - Internet Explorer

RDP is a Microsoft connection protocol that has been around for quite a few years. However, as popular as it is there are also limitations with using RDP.

  • users cannot use multiple monitors
  • resizing the screen is a painful experience
  • multimedia capabilities are limited
  • graphics are limited

In order to give the user the best experience possible let us introduce Citrix RemotePC. RemotePC is based on Citrix’s ICA HDX protocol which is far superior than RDP and gives us the capabilities of the features that I listed above.

What are some of the differences?

When a user traditionally launches RDP to access their physical desktop from outside of the office, users generally log into the Citrix Storefront and launch the published application RDP as noted from the icon above.

In the diagram below we see that we actually initiate a “two step” process by launching the application RDP that is hosted on a server, then we make a 2nd connection to our physical PC

remotePC1

By using RDP we are adding a 2nd hop to our connection. RemotePC is different in that we are connecting directly to our physical PC without having to launch an application.

remotePC2

Connecting to the Console of the physical PC

RemotePC enables the best user experience as the connection is to the PC’s console vs RDP which actually connections to something called “session 1”.

remotePC3

This is significant to the user experience as RemotePC is just like sitting down at the physical desktop to work. Being able to connect to the PC’s console session allows us to use Multi-monitor support and resizing of the screen dynamically.

In order to use Citrix RemotePC the Citrix team simply has to install the agent onto your physical desktop.

Scripts to Monitor XenDesktop

 

To ensure our XenDesktops are up and functional for the day I have created a morning check script perform this task. The check will look for:

  • UNREGISTERED MACHINES
  • REGISTERED MACHINES
  • MACHINES IN MAINTENANCE MODE
     

Ideally we will only see machines that in the REGISTERED category. Here is the PowerShell script that was created and run from the Desktop Delivery Controller

Reference

XenDesktop Monitoring: Desktop Availability

http://blogs.citrix.com/2012/10/27/xendesktop-monitoring-desktop-availability/

 

#
# XenDesktop Monitoring: Desktop Availability
# Created March 1 2013 – Trevor Svienson
# Written by – Miguel Contreras Citrix
# Load Citrix PowerShell modules
#

# Set-ExecutionPolicy RemoteSigned

#
# Load the XenDesktop Snapins
#

Asnp Citrix.*

#
# Check VMs that failed to reboot
#

$badVMs = Get-BrokerDesktop -PowerActionPending $false -PowerState On -SummaryState Available -WillShutdownAfterUse $true -MaxRecordCount 5000
If ($badVMs)
{
   foreach($vm in $badVMs)
   {
      New-BrokerHostingPowerAction -MachineName $vm.HostedMachineName -Action ‘Reset’
   }
}

#
#Check for VMs in maint mode and unregistered, and send email report
#

$recipients = "alert.citrix@svi-virtualsolutions.com"
$fromEmail = "XenDesktopProd@svi-virtualsolutions.com"
$server = "mail.svi-virtualsolutions.com"
$time = Get-Date ?format d

[string]$unregisteredVMs = (Get-BrokerDesktop -MaxRecordCount 5000 | ? {($_.RegistrationState -eq ‘Unregistered’) -and ($_.PowerState -eq ‘On’)} | select HostedMachineName,DesktopGroupName,LastDeregistrationReason | ft -wrap -autosize | Out-String)

[string]$registeredVMs = (Get-BrokerDesktop -MaxRecordCount 5000 | ? {($_.RegistrationState -eq ‘Registered’) -and ($_.PowerState -eq ‘On’)} | select HostedMachineName,DesktopGroupName,LastDeregistrationReason | ft -wrap -autosize | Out-String)

[string]$maintenanceModeVMs = (Get-BrokerDesktop -MaxRecordCount 5000 | ? {$_.InMaintenanceMode -eq ‘True’} | select HostedMachineName,DesktopGroupName,LastDeregistrationReason | ft -wrap -autosize | Out-String)

[string]$emailBody = "UNREGISTERED MACHINES `n`n`n $unregisteredVMs" + "REGISTERED MACHINES `n $registeredVMs" + "`n" + "MACHINES IN MAINTENANCE MODE `n $maintenanceModeVMs"

#
#Send it off
#

send-mailmessage -from $fromEmail -to $recipients -subject "XenDesktop Prod Daily Check $currentTime" -body $emailBody

Here is the end result via email:

UNREGISTERED MACHINES
REGISTERED MACHINES
HostedMachineName DesktopGroupName LastDeregistrationR
eason
—————– —————- ——————-
WINDOWS764MCS01 MCS – Pooled  Windows 7 x64 AgentShutdown
WINDOWS764MCS02 MCS – Pooled  Windows 7 x64 AgentShutdown
WINDOWS764MCS03 MCS – Pooled  Windows 7 x64 AgentShutdown
WINDOWS764MCS04 MCS – Pooled  Windows 7 x64 AgentShutdown
WINDOWS764MCS05 MCS – Pooled  Windows 7 x64 AgentShutdown
WINDOWS764MCS06 MCS – Pooled  Windows 7 x64 AgentShutdown
WINDOWS7UAT999 MCS – Windows 7 x64 – Master AgentShutdown
WINDOWS764NPX001 VDI – Windows 7 x64 – AssetGen Prod AgentShutdown
WINDOWS764NPX002 VDI – Windows 7 x64 – AssetGen Dev AgentShutdown
WINDOWSMCS101 MCS – Pooled  Windows XP x86 AgentShutdown
WINDOWSMCS103 MCS – Pooled  Windows XP x86 AgentShutdown
WINDOWSMCS104 MCS – Pooled  Windows XP x86 AgentShutdown
WINDOWSMCS105 MCS – Pooled  Windows XP x86 AgentShutdown
WINDOWSMCS107 MCS – Pooled  Windows XP x86 AgentShutdown
WINDOWSMCS108 MCS – Pooled  Windows XP x86 AgentShutdown
WINDOWSMCS998 MCS – Windows XP x86 – Master ContactLost
WINDOWSVDIPRD001 VDI – Windows XP x86 – Image Now AgentShutdown
WINDOWSVDIPRD002 VDI – Windows XP x86  ContactLost
MACHINES IN MAINTENANCE MODE
HostedMachineName DesktopGroupName LastDeregistrationR
eason
—————– —————- ——————-
WINDOWSMCS107 MCS – Pooled  Windows XP x86 AgentShutdown
WINDOWSMCS108 MCS – Pooled  Windows XP x86 AgentShutdown

 

The script calls CheckForVMsInMTCMode.ps1 is located on the DDC in C:\tools folder. The script is run as a scheduled task which launches at 7 am daily.

Here is how the task is configured on the DDC:

Inside the daily task this is the Action. Simply launches PowerShell and then a command argument for launching the file:

SNAG-0059

Here is a more closer look at the argument:

SNAG-0060

Also remember to add the "rights" to run the file.

image

Testing the Script

In order to get this to work I ran some tests to see if this would work. A good references to do this is

Weekend Scripter: Use the Windows Task Scheduler to Run a Windows PowerShell Script
http://blogs.technet.com/b/heyscriptingguy/archive/2012/08/11/weekend-scripter-use-the-windows-task-scheduler-to-run-a-windows-powershell-script.aspx

SNAG-0064

From the DDC I opened a run command and typed this

SNAG-0065

As you can see from the screen cap above I was receiving an "Insufficient administrative privilege" message which simply meant I did not have enough privileges to run the XenDesktop cmdlet. I had to elevate my privileges in order for this to complete from the run command. I also had to do the same in the daily task:

image

Another reference to run PowerShell from a daily task.

Run PowerShell Scripts from Task Scheduler
http://community.spiceworks.com/how_to/show/17736-run-powershell-scripts-from-task-scheduler

BSOD, PVS, XenServer and Pooled Desktop

 

I was investigating as to why I had a VM that was not registering with the DDC during a morning check. When I checked the XenCenter console I observed this message:

XenCenter_2013-11-01_08-46-43

After some investigation I found I was not the only one having this issue:

http://forums.citrix.com/thread.jspa?threadID=305300

Based on the advice given in the forum I found that in  DHCP the IP was being assigned but eventually the BSOD was happening.

Remote%20Desktops_2013-11-01_08-36-33

I could not locate another VM with the same IP. So to correct issue I:

  • Deleted the above IP assigned in DHCP
  • I then created a reservation for the VM by doing a standard reservation in DHCP:

image

 

image

  • Once I did this I restarted the VM and the Desktop resumed normal operation.
  • As well based on the user forum I also changed the DHCP scope to an Unlimited lease time.

 

image