Category Archives: Miscellaneous

Anything and Everything

KMS Setup and Citrix XenDesktop

I might split this off since KMS doesn’t need Citrix and Citrix doesn’t need KMS. But for my environment I needed both.

Background
I had installed a KMS server (Key Management Services server) for a recently-deployed Citrix XenDesktop environment. XenDesktop does NOT support MAK keys for the shared desktops (although it technically works), and instead lets me know to use KMS. KMS is really nice now that it’s working.

I actually ended up installing KMS on the WSUS server. Things I found out (my notes, take with a grain of salt since I haven’t gone back over it nor verified anything):

Prerequisites

  • Server 2008R2 Installed and configured on an AD Domain (member server or domain controller OK)
  • Server 2008R2 KMS Key (VLSC site at Microsoft)
  • Client KMS Keys (see below)
  • Hypervisor (for XenDesktop VDI) – Hyper-V, VMWare ESXi, XenServer are all supported. I use XenServer 6.1 although 6.2 just came out.

Common Client KMS Setup Keys
Full List found here (http://technet.microsoft.com/en-us/library/jj612867.aspx and http://technet.microsoft.com/en-us/library/jj219430.aspx)

Windows 7 Professional
FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4
Windows 7 Enterprise
33PXH-7Y6KF-2VJC9-XBBR8-HVTHH
Windows 8 Professional
NG4HW-VH26C-733KW-K6F98-J8CK4
Windows 8.1 Professional
GCRJD-8NW9H-F2CDX-CCM8D-9D6T9
Windows 8 Enterprise
32JNW-9KQ84-P47T8-D8GGY-CWCK7
Windows 8.1 Enterprise
MHF9N-XY6XB-WVXMC-BTDCT-MKKG7
Windows Server 2008 R2 Standard
YC6KT-GKW9T-YTKYR-T4X34-R7VHC
Windows Server 2008 R2 Enterprise
489J6-VHDMP-X63PK-3K798-CPX3Y
Windows Server 2012 Standard
XC9B7-NBPP2-83J2H-RHMBY-92BT4
Windows Server 2012R2 Standard
D2N9P-3P6X9-2R39C-7RTCD-MDVJX
Windows Server 2012 Datacenter
48HP8-DN98B-MYWDG-T2DCC-8W83P
Windows Server 2012R2 Datacenter
W3GGN-FT8W3-Y4M27-J84CP-Q3VJ9
Office Professional Plus 2010
VYBBJ-TRJPB-QFQRF-QFT4D-H3GVB
Office Professional Plus 2013
YC7DK-G2NP3-2QQC3-J6H88-GVGXT

Install And Activate Your KMS Server
Add the product key (your KMS key from the VLSC) on your server and activate with Microsoft. If you utilize the GUI you will receive an alert saying “Are you sure you want this to become a KMS Server in your environment?” I used the command line instead:
slmgr /ipk YOURPRODUCTKEYHERE
slmgr /ato
If you receive any errors, you will not be able to proceed much further.

You can also use the Volume Activation Management Tool (VAMT).

KMS For Office Products
Download the Office 2010 KMS Host License Pack
http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=97b7b710-6831-4ce5-9ff5-fdc21fe8d965
And install/run the executable
The wizard will ask for your KMS key for Office – enter that.
To install a new Office Key, simply type:
ospp /inpkey:YOURKMSKEY
ospp /act

Verify KMS Is Working
You must have 5 or more SERVER clients or 25 or more CLIENT clients trying to activate. Every 6 months. The KMS activation is good for 180 days before it needs to re-register with your KMS server.
Command line find out the number of activations
slmgr /dlv
Your pop up will display the following key information: The KMS channel your server belongs to (B channel for me), License status, Current KMS count, and number of requests received.
There is a KMS Emulator that can artificially inflate your numbers on the KMS server:
KMSClient.exe 1688 127.0.0.1 Windows
KMSClient.exe 1688 127.0.0.1 Office2010
KMSClient.exe 1688 127.0.0.1 Office2012


Citrix – Initial Setup

  1. Create a new virtual guest – I ended up using Windows 7 SP1 x64 Enterprise (Pro for proof of concept, Ent for production use)
  2. Install all updates and software required on the base image. I ended up with the OS, Antivirus, Java, Flash, and Reader installed by default.
  3. Join this guest to the domain if applicable.
  4. Install the Virtual Desktop Agent – I ended up “sharing” the XenDesktop Installer CD from the primary DDC XenDesktop system (\\xendesktopserver\sharename)
  5. Shut down the VM by using the Desktop Agent – in my case I had a virtual private disk as well, so this is very necessary with all changes
  6. Take a snapshot of the VM – name it “PREARM”
  7. Start the VM back up and rearm the Activation Key
    slmgr /rearm

  8. Shut down the VM by using the Desktop Agent
  9. Take a second snapshot of the VM – name it “ARMED”
  10. Use this second image (“ARMED”) as the base for your XenDesktop rollout

Updating the Master Image

  1. Roll back to the snapshot “PREARM”
  2. Startup the VM
  3. Make any changes/updates
  4. Shut down the VM by using the Desktop Agent
  5. Delete the current “PREARM” snapshot
  6. Take a snapshot of the VM – name it “PREARM”
  7. Start the VM back up and rearm the Activation Key
    slmgr /rearm

  8. Shut down the VM by using the Desktop Agent
  9. Delete the current “ARMED” snapshot
  10. Take a second snapshot of the VM – name it “ARMED”
  11. Use this second image (“ARMED”) as the base for your XenDesktop rollout

***EDIT***
I couldn’t get my office 2010 laptop to activate against the KMS host. I verified that the DNS entry was added:
nslookup -type=srv _vlmcs._tcp

Port 1688
Srv hostname MYSERVER.MYDOMAIN.TLD

The eventviewer showed “The client has sent an activation request to the key management service machine” along with “0xC0020017, 0X00000000, 127.0.0.1:1688”
That’s why! 127.0.0.1! Localhost my arse.

You can change this by setting the host:
Open a command prompt with admin privs
cd\program files\microsoft office\office14 (or 15)
cscript ospp.vbs /sethst:YOURSERVER_FQDN.domain.tld
Then activate
cscript ospp.vbs /act
Success!

To set this back to default:
cscript ospp.vbs /remhst

To change the key:
cscript ospp.vbs /inpkey:YOURKEYHERE

Remote key:
cscript ospp.vbs /inpkey:KEY COMPUTERNAME
cscript ospp.vbs /act COMPUTERNAME

http://technet.microsoft.com/en-us/library/ee624350.aspx

NON-Domain Systems KMS Activation
cscript \windows\system32\slmgr.vbs /skms FQDN_OF_KMS_SERVER:port
-or-
cscript \windows\system32\slmgr.vbs /skms IPADDRESS_OF_KMS:port

Fog, Windows 7, Sysprep

Back in the day (I’m starting to feel old now) I setup a Ghost server with PXE booting. It was a pretty nice setup; a Dell PE2550 with 4x144GB SCSI (~385GB usable), 24port gigabit switch, and enough desk space – and power – to handle 16 laptops or 22 desktops at a time. It took 2 of us about 3 weeks to get the workspace setup, and another 3 weeks to get the Ghost server and PXE working. And then there was always the issue of updating the drivers on the PXE image without breaking anything else. Basically crossing your fingers and hoping for the best.

That was five years ago.

Looking back on my previous experiences I can definitely say I’ve grown and become more knowledgeable. Back then, when I had researched a solution, I just googled for “imaging software server” or something similar. Working for a computer reseller meant that I had access to NFR copies of quite a bit of software, so management decided that we should go with Ghost. I hadn’t even begun to research into FOG yet.

Fast forward the five (almost 6 now) years, and I know to look into server software that supports all operating systems, supports multicast, and is fairly intuitive to setup. Enter FOG.

I like to install the latest and greatest, but in this case I had some issues that I didn’t feel like resolving when I tried to use FOG with 12.04LTS. Instead I opted to use 10.04LTS. It’s an internal server, so the patching levels are not generally as critical. I also installed this on a production network – there are 7 VLANS, active directory and windows DNS/DHCP, cisco switches. IP helper has already been set on the switches for DHCP. The active directory environment is 2008R2.

Install Ubuntu 10.04LTS x32 – I gave it a single 2.4GHz Xeon core, 512MB RAM, and 120GB partition. Installed with LAMP (no mysql password), SSH, and Mail.
Change the Root Password
sudo passwd root
Login As Root
su
Update the system
apt-get update && dist-upgrade
Reboot
reboot

Install FOG – version 0.32 at the time of this writing
mkdir -p /opt/fog-setup
cd /opt/fog-setup
wget http://sourceforge.net/projects/freeghost/files/FOG/fog_0.32/fog_0.32.tar.gz
tar -xvzf fog*
cd fog*
cd bin
./installfog.sh
The wizard now starts. http://www.fogproject.org/wiki/index.php/Integrating_FOG_into_an_Existing_Network
I chose the following:
“N” normal installation
10.10.10.10 IP Address of FOG
“Y” to setup a router/DHCP address
10.0.10.1 IP address of DHCP server
“Y” to DNS
10.0.10.1 IP address of DNS
“N” eth0 is fine by me
“N” I already have DHCP
“N” I’m not international
“Y” looks good; set it up
Make sure you read! If you have a password setup on mysql you must adjust the configuration files accordingly (opt/fog/service/etc/config.php)
I ended up rebooting the server just in case.

Edit the Windows DHCP Options
I have 7 different DHCP scopes (one for each of the VLANs I had), so your settings may be different. Instead of making the options change per scope, I performed the task in the Server Options area.
Right-click and select “Configure Options”
Select 066 and set the value to your FOG server IP address
Select 067 and set the value to pxelinux.0

At this point you should be able to connect to your PXE FOG server – set a test workstation/laptop to boot PXE (Dell’s have F12 for this), and connect via your network interface.

SYSPREP coming soon
CONFIGURATION OF FOG coming soon

USB Drive Missing Space

I had formatted a usb flash drive to be a linux boot disk. Then, when finished, I went to reformat the drive and was only prompted to format 168MB out of the 1GB it originally had.

Open up the command line and type in the following:
disk part
list disk
select disk YOURDISKNUMBER
clean

After cleaning, you should be able to right-click and format again with the full amount of space. You can also finish this up using command line:
create partition primary
select partition 1
active
format fs=fat32 quick
assign
exit

Proxmox Mouse Not Working

I was copying Windows-based machines from VMWare and Hyper-V to proxmox – only the mouse stopped working after I would finish copying. It would get “stuck” in the bottom right hand corner of the screen – I could right-click and get a menu option to pop up, but other than that it was completely useless.

Now I’m a big fan of the command line, but on my windows hosts it’s a ton easier to have mouse control.

So I found this guy’s blog:

VMWare mouse problems – mouse stuck in bottom right corner

Basically do the following:

Open Regedit
HKLM\System\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}
Find the registry key “UpperFilters”
Remove the word msvmmouf – keep all other entries in there, but tidy up the spaces/returns if necessary
Under this 4D36E96F-E325-11CE-BFC1-08002BE10318 key, see if the other 01, 02, 03 etc folders have any mention of vmware. Delete the entire key if they do (example: highlight 02 and hit delete).
Reboot.
Profit.

I also had to remove a few vmware entries:
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1001354

Delete the following:

HKEY_CLASSES_ROOT\Installer\Features\C2A6F2EFE6910124C940B2B12CF170FE
HKEY_CLASSES_ROOT\Installer\Products\C2A6F2EFE6910124C940B2B12CF170FE
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Features\C2A6F2EFE6910124C940B2B12CF170FE
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\C2A6F2EFE6910124C940B2B12CF170FE
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\C2A6F2EFE6910124C940B2B12CF170FE
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FE2F6A2C-196E-4210-9C04-2B1BC21F07EF}
HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.

I also got a Processr.sys issue (fix found here http://pve.proxmox.com/wiki/Processr.sys):
DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS
processr.sys

Edit the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Processor
and
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Intelppm

Find the “Start” key

Change it from the default value (mine was 3) to a “4”

Embed Flash, TL Edition

So I needed to embed some flash files for the boss, but my old script was no longer working for IE8/9 (didn’t test on 7, since who uses that anyway?) Firefox and Chrome were working just fine. Argh.

<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='300' height='300' id='player1' name='player1'>
   <param name='movie' value='player.swf'>
   <param name='allowfullscreen' value='true'>
   <param name='allowscriptaccess' value='always'>
   <param name='flashvars' value='file=playlist.xml'>
   <embed id='player1'
          name='player1'
          src='player.swf'
          width='300'
          height='300'
          allowscriptaccess='always'
          allowfullscreen='true'
          flashvars="file=playlist.xml"
   />
</object>

So I went ahead and found that code. I ended up using WinFF to convert an m4v file to a web-based flv, then I used the jwplayer as my swf, and file=filename.flv as my flv.

ESXi 4.1 Dell OpenManage

I had Nagios telling me there was a memory issue on the server, but not in which slot the bad ram was located. OM to the rescue?

Download oem-dell-openmanage-esxi_6.3.0-A00.zip (I’m running on a Dell PowerEdge 2850 Server)
Use the VMWare VSphere CLI to run the following:

vihostupdate.pl –server SERVERNAME_OR_IP -i -b “C:\oem-dell-openmanage-esxi_6.3.0-A00.zip”
Enter the username (root)
Enter the Password (password)

Then, using the Dell Web Server administrator (OM-SrvAdmin-Dell-Web-WIN-6.3.0-2075_A00.20.exe), connect to your virtual machine and IGNORE CERTIFICATE ERRORS!

Software I Use – May 2011 Edition

I was trying to come up with a list of software that I “must have” on a new system (links to come hopefully later):

Dual boot Windows 7 x64 Pro/Ent/Ultimate with Ubuntu 11.04 x32
Inssider – Great for finding SSIDs, models of access points, security information, and channels of wireless networks
Angry IP Scanner – My favorite IP scanning utility is great for finding open web servers, DNS servers, or anything with RDP open
Putty – Terminal emulation software
FireFox – I still enjoy this more than Chrome, but they both have their place. Include Adblock Plus, Web Developer, NoScript, and GreaseMonkey with Youtube Auto Buffer and experts-Exchange
Terminals – My favorite RDP saving utility
CDBurnerXP – Burns ISOs, music, data
ISORecorder – Creates ISOs from folders or drives
CPUID’s CPU-Z and HWMonitor – Monitoring hardware in your system
NMAP-Zenmap GUI – NMAP for windows
WinSCP – SCP client for windows
Notepad++
NetIQ ADCheck
Filerfrog
TheDude
TightVNC
ThreatFire
Secunia PSI
Nod32
Filezilla