VMware Horizon View: Fix “Server’s Certificate Cannot Be Checked”

Symptoms

In VMware Horizon View 5.3, the View Administration dashboard reports Server’s certificate cannot be checked, and:

  • The Connection Server shows a red status.
  • The Security Server shows a red status.
  • Clicking the Connection Server shows: Connection Server certificate is not trusted.
  • Clicking the Security Server shows: Server’s certificate cannot be checked.
  • External connections through the Security Server still work, and the certificates on the servers are valid.

Cause

The certificate’s Certificate Revocation List (CRL) includes a URL that the Connection Server paired with the Security Server can’t reach.

Resolution

Make sure the Connection Servers paired with Security Servers can reach the CRL URL. This usually means allowing it through the proxy server, if your environment uses one to control Internet access.

Workaround: CertificateRevocationCheckType

If you can’t open access to the CRL, create a CertificateRevocationCheckType registry string. Before changing the registry, make sure you have a current backup of the registry and the virtual machine (see Microsoft article 136393). If you run multiple Connection Servers, make this change on all of them.

  1. On the View Connection Server, open HKEY_LOCAL_MACHINE\Software\VMware, Inc.\VMware VDM\Security. Make the change on the Connection Server, not the Security Server.
  2. Create a string value (REG_SZ) named CertificateRevocationCheckType and set it to 1.
CertificateRevocationCheckType string in the VMware VDM Security registry key

How to Configure Kiosk Mode on Windows XP (Auto-Logon and Custom Shell)

I know this one is really, really old, but I was asked about it the other day and wanted to keep it here for future reference.

The Problem

When a Windows XP computer boots, you want it to always log into a specific user account, and you want that account to run an executable other than Windows Explorer (explorer.exe), such as a LabVIEW application. This is known as kiosk mode.

Kiosk mode is useful for a dedicated computer or user account that should boot straight into one program. It also restricts the user’s access to the rest of the computer. Setting it up takes two registry changes: automatic logon, and a custom shell for the account.

Step 1: Log In Automatically to a Specific Account

This change is made in the Windows Registry, so work carefully.

  1. Click Start » Run, type regedit, and click OK.
  2. Browse to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon.
  3. Double-click DefaultUserName, enter the name of the account to log into automatically, and click OK.
  4. Double-click DefaultPassword, enter that account’s password, and click OK. If there is no DefaultPassword entry, create it: go to Edit » New » String Value, name it DefaultPassword, press Enter, then double-click it and enter the password.
  5. Double-click AutoAdminLogon, set its value data to 1, and click OK. If there is no AutoAdminLogon entry, create it the same way as a String Value named AutoAdminLogon with the value 1.
  6. Close the Registry Editor and restart the computer (Start » Shut Down » Restart).

Note: If no DefaultPassword string is specified, Windows XP automatically changes AutoAdminLogon from 1 (true) to 0 (false), which turns automatic logon off.

Step 2: Replace Explorer with Your Own Executable

  1. Log into the user account that should boot into kiosk mode.
  2. Click Start » Run, type regedit, and click OK.
  3. Browse to HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon.
  4. Go to Edit » New » String Value and name it Shell.
  5. Double-click the new value and enter the path to the executable to run instead of explorer.exe, for example C:\LV Startup\MyLabVIEWVI.exe.
  6. Log out of the account and log back in.

Together, these two settings make the machine skip the logon screen, sign into the chosen account, and run your executable instead of Windows Explorer. For a LabVIEW executable, you can also tune its VI Properties: set Position to Maximized in the Window Run-Time Position category so it fills the screen, and adjust the Window Appearance category so users can’t close or resize it.

Tip: Getting Back to the Registry Editor

Once the shell is replaced there’s no Start menu. To change the executable later, press Ctrl+Alt+Delete and open Task Manager, choose File » New Task (Run…), type regedit, and click OK.

Related: autologin for Windows Server.

SuiteCRM: Fix “Undefined index” Notices in colourSelector.php

While setting up a new SuiteCRM service, I found these PHP notices repeating in my Apache error log:

PHP Notice: Undefined index: custom in /var/www/html/themes/Suite7/css/colourSelector.php on line 95, referer:
PHP Notice: Undefined index: modlink in /var/www/html/themes/Suite7/css/colourSelector.php on line 70, referer:

I’m fairly sure they started because I changed the colors in the Suite7 theme (the color selector is a really neat way to customize the theme), though they probably appear with the standard theme colors too.

The Fix

Add these two lines to /var/www/html/config_override.php:

$sugar_config['colourselector']['modlink'] = 'EEEEEE';
$sugar_config['colourselector']['custom'] = 'EEEEEE';

With both keys defined, the notices stop appearing in the log.

Why Doesn’t Storage vMotion Rename VM Files? (And How to Enable It)

By default, Storage vMotion does not rename a virtual machine’s files when it moves them. If you’ve renamed a VM and expect a Storage vMotion to bring the folder and file names into line, you need to add an advanced setting in vCenter first.

Enable File Renaming in vCenter

  1. Go to Administration.
  2. Click vCenter Server Settings.
  3. Click Advanced Settings.
  4. Add the key provisioning.relocate.enableRename with the value true, then click Add.
  5. Restart the vCenter service or the vCenter Server.

Storage vMotion will now rename the files during the move again. If your team relies on this behavior, make sure the setting is added on every vCenter you manage.

Fix “Wipe a Flex-SE Virtual Disk” Errors in VMware View Daily Maintenance

Today my vCenter task bar started filling up with errors from VMware View’s daily maintenance, complaining that it couldn’t wipe a Flex-SE virtual disk:

Wipe a Flex-SE virtual disk  vmPC-019  A general system error occurred:
Wipe Disk failed: Failed to complete wipe operation.

The Cause: Changed Block Tracking

It turned out that our vRanger backup solution had enabled Changed Block Tracking (CBT) on these virtual machines, and View’s Flex-SE disk wipe doesn’t work with CBT turned on.

The Fix

Right-click each View desktop VM and disable Changed Block Tracking. Once CBT is off, the wipe errors stop.

This VMware Knowledge Base article helped me work out what was going on: VMware KB 2039907 (archived copy).

Automatically Push Proxy Settings to Clients with WPAD and PAC Files (Astaro/Sophos UTM)

When an Astaro (Sophos UTM) Security Gateway runs its web proxy in standard mode, every browser has to be pointed at the proxy. With more than a handful of computers, configuring each one by hand isn’t practical, and static settings cause other problems: laptops need the proxy in the office but not on the road, some websites break when proxied, and you may want internal sites to skip the proxy entirely. The answer is a dynamic proxy configuration.

Use the Web Proxy Auto-Discovery Protocol (WPAD)

WPAD is widely supported by all major browsers and lets administrators push dynamic proxy policies to users. At its core is a configuration script, usually named proxy.pac or wpad.dat, containing one JavaScript function, FindProxyForURL. The browser calls it for every URL and it returns whether to use a proxy, and which one, based on the site or the client’s network location.

Sample PAC Script

This example covers the two most common needs: skip the proxy for certain domains, and use the proxy only when the client is on specific networks. Lines starting with // are comments.

function FindProxyForURL(url, host)
{
  // The following domains will not be proxied
  if (dnsDomainIs(host, "domain.com")
      || dnsDomainIs(host, "company.com")
      || dnsDomainIs(host, "intranet.mycompany.com")
      // Add new domains by customizing the line below:
      || dnsDomainIs(host, "your.domain.here"))
    return "DIRECT";

  // If the client is on one of these networks, use the proxy
  if (isInNet(myIpAddress(), "192.168.0.0", "255.255.0.0"))
    return "PROXY 192.168.0.1:8080";
  if (isInNet(myIpAddress(), "10.0.0.0", "255.0.0.0"))
    return "PROXY 192.168.0.1:8080";

  // Add new networks by customizing and uncommenting these lines:
  // if (isInNet(myIpAddress(), "172.16.1.0", "255.255.255.0"))
  //   return "PROXY 192.168.0.1:8080";

  // Clients on any other network connect directly
  return "DIRECT";
}

Save the script as proxy.pac or wpad.dat and host it on a web server every workstation can reach. Google’s pactester tool (originally at http://code.google.com/p/pactester/) is handy for testing a script if it isn’t behaving.

How Browsers Find the Script

Browsers offer two automatic options. Either works.

A) Automatic configuration script URL (“Automatic proxy configuration URL” in Firefox, “Use automatic configuration script” in Internet Explorer). The simplest option: enter the full URL of the script, such as http://www.mydomain.com/proxy.pac. The browser downloads it at launch.

B) Auto-detect (“Auto-detect proxy settings for this network” in Firefox, “Automatically detect settings” in IE). The browser discovers the script on its own in one of two ways:

  • DNS (most common): create a DNS record named wpad in your clients’ default domain, pointing to a web server with wpad.dat in its root. If the clients’ domain is internal.mydomain.com, browsers will request http://wpad.internal.mydomain.com/wpad.dat.
  • DHCP: configure DHCP option 252 as a text option containing the script URL. Clients receive it with their DHCP lease. This is less common and not every DHCP server supports custom options.

Rolling the Setting Out to Browsers

Whichever method you pick, each browser may still need its setting changed. Here are three approaches.

1. Ask users to make the change. Where users can change their own settings, a clear email with simple instructions works surprisingly well, even for non-technical staff. For example: “Two weeks from today, we’re making a firewall change that requires a browser setting. Without it, you won’t be able to browse the web after the cutoff, but you can make the change any time before then. Please follow these simple instructions…”

2. Active Directory Group Policy. AD administrators can push proxy auto-configuration to Internet Explorer on every domain-joined Windows machine from a central GPO, for users, OUs, or the whole domain. Firefox can be managed the same way with third-party tools: the free FirefoxADM and Wetdog projects provide ADM templates (applied through login scripts or an executable), and FrontMotion offers commercial Firefox MSI packages that read Group Policy settings.

3. Login scripts. This also works in other environments, such as Novell eDirectory. For Internet Explorer, distribute the settings as a registry file, either hard-coded proxy settings or the auto-configuration URL. Include only the lines you need:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="10.129.0.1:8080"
"ProxyOverride"="*.local;<local>"
"AutoConfigURL"="http://192.168.0.1/wpad.dat"

Save it as proxy.reg and merge it silently from a login script:

regedit.exe /s proxy.reg

Related: creating a PKCS12 certificate for Sophos UTM 9.

BitLocker Group Policy Settings: A Complete Example GPO

Here’s the full BitLocker Drive Encryption Group Policy I use, exported from the GPO report. It backs up TPM and BitLocker recovery information to Active Directory, uses AES 256-bit encryption, requires recovery keys to be escrowed in AD DS before encryption starts, and sets policies for operating system, fixed, and removable drives. Replace the company name and recovery folder path with your own.

Computer Configuration (Enabled)
Policies
Administrative Templates
Policy definitions (ADMX files) retrieved from the local machine.
System/Removable Storage Access
POLICY SETTING COMMENT
Removable Disks: Deny write access Disabled
System/Trusted Platform Module Services
POLICY SETTING COMMENT
Turn on TPM backup to Active Directory Domain Services Enabled
Require TPM backup to AD DS Enabled
If selected, cannot set or change TPM owner password
if backup fails (recommended default).
If not selected, can set or change TPM owner password
even if backup fails. Backup is not automatically retried.
Windows Components/BitLocker Drive Encryption
POLICY SETTING COMMENT
Choose default folder for recovery password Enabled
Configure the default folder path: \\your-domain.com\dfs\users\%USERNAME%
Specify a fully qualified path or include the computer’s environment variables in the path.
For example, enter “\serverbackupfolder”, or “%SecureDriveEnvironmentVariable%backupfolder”
Note: In all cases, the user will be able to select other folders in which to save the recovery password.
POLICY SETTING COMMENT
Choose drive encryption method and cipher strength Enabled
Select the encryption method: AES 256-bit with Diffuser
POLICY SETTING COMMENT
Choose how users can recover BitLocker-protected drives (Windows Server 2008 and Windows Vista) Enabled
Important: To prevent data loss, you must have a way to recover BitLocker encryption keys. If you do not allow both recovery options below, you must enable backup of BitLocker recovery information to AD DS. Otherwise, a policy error occurs.
Configure 48-digit recovery password: Require recovery password (default)
Configure 256-bit recovery key: Require recovery key (default)
Note: If you do not allow the recovery password and require the recovery key, users cannot enable BitLocker without saving to USB.
POLICY SETTING COMMENT
Prevent memory overwrite on restart Disabled
Provide the unique identifiers for your organization Enabled
BitLocker identification field: Your Company Name, Inc.
Allowed BitLocker identification field: Your Shorthand Company Name
POLICY SETTING COMMENT
Store BitLocker recovery information in Active Directory Domain Services(Windows Server 2008 and Windows Vista) Enabled
Require BitLocker backup to AD DS Enabled
If selected, cannot turn on BitLocker if backup fails (recommended default).
If not selected, can turn on BitLocker even if backup fails. Backup is not automatically retried.
Select BitLocker recovery information to store: Recovery passwords and key packages
A recovery password is a 48-digit number that unlocks access to a BitLocker-protected drive.
A key package contains a drive’s BitLocker encryption key secured by one or more recovery passwords
Key packages may help perform specialized recovery when the disk is damaged or corrupted.
Windows Components/BitLocker Drive Encryption/Fixed Data Drives
POLICY SETTING COMMENT
Allow access to BitLocker-protected fixed data drives from earlier versions of Windows Enabled
Do not install BitLocker To Go Reader on FAT formatted fixed drives Disabled
POLICY SETTING COMMENT
Choose how BitLocker-protected fixed drives can be recovered Enabled
Allow data recovery agent Enabled
Configure user storage of BitLocker recovery information:
Allow 48-digit recovery password
Allow 256-bit recovery key
Omit recovery options from the BitLocker setup wizard Disabled
Save BitLocker recovery information to AD DS for fixed data drives Enabled
Configure storage of BitLocker recovery information to AD DS: Backup recovery passwords and key packages
Do not enable BitLocker until recovery information is stored to AD DS for fixed data drives Enabled
POLICY SETTING COMMENT
Configure use of passwords for fixed data drives Enabled
Require password for fixed data drive Enabled
Configure password complexity for fixed data drives: Allow password complexity
Minimum password length for fixed data drive: 8
Note: You must enable the “Password must meet complexity requirements” policy setting for the password complexity setting to take effect.
POLICY SETTING COMMENT
Deny write access to fixed drives not protected by BitLocker Enabled
Windows Components/BitLocker Drive Encryption/Operating System Drives
POLICY SETTING COMMENT
Allow enhanced PINs for startup Enabled
Choose how BitLocker-protected operating system drives can be recovered Enabled
Allow data recovery agent Enabled
Configure user storage of BitLocker recovery information:
Allow 48-digit recovery password
Allow 256-bit recovery key
Omit recovery options from the BitLocker setup wizard Disabled
Save BitLocker recovery information to AD DS for operating system drives Enabled
Configure storage of BitLocker recovery information to AD DS: Store recovery passwords and key packages
Do not enable BitLocker until recovery information is stored to AD DS for operating system drives Enabled
POLICY SETTING COMMENT
Configure minimum PIN length for startup Enabled
Minimum characters: 4
POLICY SETTING COMMENT
Require additional authentication at startup Enabled
Allow BitLocker without a compatible TPM Enabled
(requires a startup key on a USB flash drive)
Settings for computers with a TPM:
Configure TPM startup: Allow TPM
Configure TPM startup PIN: Allow startup PIN with TPM
Configure TPM startup key: Allow startup key with TPM
Configure TPM startup key and PIN: Allow startup key and PIN with TPM
POLICY SETTING COMMENT
Require additional authentication at startup (Windows Server 2008 and Windows Vista) Enabled
Allow BitLocker without a compatible TPM Enabled
(requires a startup key on a USB flash drive)
Settings for computers with a TPM:
Configure TPM startup key: Allow startup key with TPM
Configure TPM startup PIN: Allow startup PIN with TPM
Important: If you require the startup key, you must not allow the startup PIN.
If you require the startup PIN, you must not allow the startup key. Otherwise, a policy error occurs.
Note: Do not allow both startup PIN and startup key options to hide the advanced page on a computer with a TPM.
Windows Components/BitLocker Drive Encryption/Removable Data Drives
POLICY SETTING COMMENT
Allow access to BitLocker-protected removable data drives from earlier versions of Windows Enabled
Do not install BitLocker To Go Reader on FAT formatted removable drives Disabled
POLICY SETTING COMMENT
Choose how BitLocker-protected removable drives can be recovered Enabled
Allow data recovery agent Enabled
Configure user storage of BitLocker recovery information:
Allow 48-digit recovery password
Allow 256-bit recovery key
Omit recovery options from the BitLocker setup wizard Disabled
Save BitLocker recovery information to AD DS for removable data drives Enabled
Configure storage of BitLocker recovery information to AD DS: Backup recovery passwords and key packages
Do not enable BitLocker until recovery information is stored to AD DS for removable data drives Enabled
POLICY SETTING COMMENT
Configure use of passwords for removable data drives Enabled
Require password for removable data drive Enabled
Configure password complexity for removable data drives: Allow password complexity
Minimum password length for removable data drive: 8
Note: You must enable the “Password must meet complexity requirements” policy setting for the password complexity setting to take effect.
POLICY SETTING COMMENT
Control use of BitLocker on removable drives Enabled
Allow users to apply BitLocker protection on removable data drives Enabled
Allow users to suspend and decrypt BitLocker protection on removable data drives Enabled
POLICY SETTING COMMENT
Deny write access to removable drives not protected by BitLocker Disabled

How to Find Which Replica Disk a VMware View Linked Clone Uses

In VMware View (Horizon), each linked clone desktop is built from a replica disk. When you need to know which linked clones depend on which replica, for example before cleaning up storage, you can find out from the ESX/ESXi console.

Steps

1. Log in to the ESX host as root. On ESXi, open the console, press Alt+F1, and type unsupported (or use SSH).

2. Find every small descriptor .vmdk that points to a replica parent:

find /vmfs/volumes/ \( -size -1500c \) -name '*.vmdk' -exec grep replica {} -H \; | grep 'parentFileNameHint=' > replicalist.txt

3. Make the output easier to read by inserting an arrow between each clone and its replica:

sed 's/:/-->>/' < replicalist.txt > replicalist2.txt

4. View the results:

less replicalist2.txt

The output looks like this:

/vmfs/volumes/4cceb02c-6fba721c-a0ff-001e0b1f4ca2/test-2/test-2.vmdk-->>parentFileNameHint="/vmfs/volumes/4cceb02c-6fba721c-a0ff-001e0b1f4ca2/replica-8581f32c-a851-448e-8ea8-/replica-8581f32c-a851-448e-8ea8-.vmdk"
/vmfs/volumes/4cceb02c-6fba721c-a0ff-001e0b1f4ca2/test-1/test-1.vmdk-->>parentFileNameHint="/vmfs/volumes/4cceb02c-6fba721c-a0ff-001e0b1f4ca2/replica-8581f32c-a851-448e-8ea8-/replica-8581f32c-a851-448e-8ea8-.vmdk"

Reading the Results

  • Linked clones are on the left of -->> and their replica is on the right. Other VMs besides pool desktops may also appear.
  • The replica name in vCenter Server is longer than the folder and .vmdk name in the datastore. For example, vCenter shows replica-ae5923a9-4991-41e7-ba03-07c61429d839 while the .vmdk is replica-ae5923a9-4991-41e7-ba03-.vmdk.

Make Windows Prefer Wired LAN over Wi-Fi with a DHCP Default Router Metric

When a laptop is connected to both wired Ethernet and Wi-Fi, you usually want traffic to go over the wired LAN. If your Windows Server 2003/2008 DHCP server hands out the wireless addresses, you can make that happen automatically by giving the wireless gateway a higher route metric. Windows always prefers the route with the lower metric.

Set the Metric on the Wireless DHCP Scope

  1. In the DHCP console, right-click Scope Options on your wireless scope and choose Configure Options.
  2. Open the Advanced tab.
  3. For Vendor class, choose Microsoft Windows 2000 Options.
  4. Check 003 Microsoft Default Router Metric Base.
  5. Enter a value that suits your network. I use 0x1f4 (500), which gives the wireless route an effective metric of 525, higher than every other network metric we use.

Optional: Set the Wired Scopes Too

You can repeat these steps on your wired scopes with a value of 0, which leaves them at the base metric of 10. This is only necessary if their current base value is higher than 10. Check it by running route print from a command prompt.

For more detail, see Microsoft’s TechNet article on DHCP options and search the page for “default router metric base”.

PPTP VPN (GRE) Broken After VMware vSphere 5.5 Upgrade? Switch the Sophos UTM VM to VMXNET3

You’d think upgrading VMware would be transparent to the guest operating system. Not with vSphere 5.5: it broke my PPTP VPN. Here’s how I fixed it.

I run a Sophos UTM 9 firewall as a VM appliance on VMware 5.5. It works great, but to get PPTP VPN (which relies on GRE) working again after the upgrade, I had to change the VM’s settings and swap its network adapters from E1000 to VMXNET3.

1. Change the Guest Operating System Type

In the VM properties, change the guest operating system from “Other Linux”:

VM guest OS set to Other Linux 64-bit

To “Red Hat Enterprise Linux 6”:

VM guest OS changed to Red Hat Enterprise Linux 6 64-bit

This lets you add virtual network adapters other than the E1000:

E1000 virtual network adapter

2. Remove the Existing NICs

VM with the existing network adapters removed

3. Re-add the NICs as VMXNET3

Adding a VMXNET 3 network adapter

When you’re done, the VM should look like this:

VM with VMXNET3 network adapters added