Windows Update not Windows Updating

I’ve had this issue more often than I’d like to actually care to remember.

First thing I check is website security settings:

Open IE
Select Tools
Select Internet Options
Click on the Security Tab
Click on the Trusted Sites button (check mark)
Click on the Sites button
Add https://update.microsoft.com, http://update.microsoft.com, and any other microsoft update related sites

Next thing I generally check is if the Trusted Sites are actually being trusted

Open IE
Select Tools
Select Internet Options
Click on the Security Tab
Click on the Trusted Sites button (check mark)
Click on the Custom Level button
Make sure that the security is at Medium or below (Medium, Medium Low, or Low) – I generally put this at Low

After that make sure that the following services are enabled:

Start
Run

services.msc

Automatic Updates/Background Intelligent Transfer Service (BITS)

Finally, if nothing else works, turn off Automatic Updates and remove the SoftwareDistribution folder

Start
Run

services.msc

Right-Click on Automatic Updates and select Stop
Start
Run

%windir%\SoftwareDistribution

Open the DataStore folder
Delete everything inside
Right-Click on Automatic Updates and select Start
Retry the Windows Update

Install VMWare Server 2.* on Debian 5.0 Lenny

I started with an HP DL380 G4 – dual 3.4GHz Xeon single core 533MHz bus, 4GB RAM, 6x 36.4GB SCSI in RAID5 (182GB available), 2U server. I then went on to install Debian 5.0 Server x32. If I ever want to run Wine or another program it’s generally still easier to run 32bit software. That and I only have 4GB RAM anyway.

So then I wanted to install VMWare Server 2.0.1 for Linux. The exact file name and version: 2.0.1-156745.i386.tar.gz. Why not ESXi? While ESXi is also free and a hyperadvisor, there seems to be a lot more overhead in terms of administration and setup – that and I can’t figure out how to speed up the transfer of virtual machines over the network. AND we already have several other servers running VMWare Server so we can still use the linux side for internal sites.

I knew it would be a challenge so I was ready for whatever I needed to do. Running this same setup on CentOS took less than half the time. However, CentOS has a much larger footprint and takes noticeably longer to install. And now that I have the steps required, I think I shall use Debian more often. Apt-get > Yum. Nano > vi.

I’m assuming that you have a fully installed Debian server here and you have at least a little knowledge of linux. Most of the steps do not require me to let you know what’s going on. I always run the install as the root user (su), so you can add sudo to all the commands if you so desire.

I’m also assuming that you went to www.vmware.com, clicked on Products, then on Server (Free). You’ll have to sign up for an account before you can download, but that’s easy enough. Download the appropriate file, in my case it’s 2.0.1 32bit linux server NON-RPM.

First gunzip and de-tar our file:
tar xzvf VMware-server-2.0.1-156745.i386.tar.gz
cd vmware-server-distrib

Then we need to grab the prerequisites:
apt-get install libx11-6 libx11-dev libxtst6 xinetd wget
Notice that these are NOT quotes or apostrophes. Very important step BTW.
apt-get install linux-headers-`uname -r` build-essential
apt-get install binutils-doc make manpages-dev autoconf automake1.9 libtool flex bison gdb
apt-get install gcc
This will remove a “setup is unable to find the ‘killall’ program” error.
apt-get install psmisc

Might as well do some housecleaning and make sure everything is up to date.
apt-get update
apt-get upgrade

Now you can run the installer:
./vmware-install.pl

If the installer complains about the gcc kernel version:

Your kernel was built with “gcc” version “4.1.3”, while you are trying to use “/usr/bin/gcc” version “4.3.2”. This configuration is not recommended and VMware Server may crash if you’ll continue.

Blah blah blah.

First, show all the installed versions of GCC:
ls -l /usr/bin/gcc*

Which spits out the following:

lrwxrwxrwx 1 root root 7 2009-05-06 09:17 /usr/bin/gcc -> gcc-4.3
-rwxr-xr-x 1 root root 196996 2009-01-18 09:39 /usr/bin/gcc-4.1
-rwxr-xr-x 1 root root 207648 2008-12-31 06:52 /usr/bin/gcc-4.3
-rwxr-xr-x 1 root root 16288 2009-01-18 09:37 /usr/bin/gccbug-4.1

You can see that the gcc command is linked to version 4.3. Let’s link it back to 4.1 so vmware can stop complaining.
su -
export CC=/usr/bin/gcc-4.1
Then rerun vmware-config.pl

You will see that the compiler will now use GCC 4.1, which just so happens to be the same version that was used to compile the kernel. No more complaints! Yay!

Basically follow the wizard the remaining steps and you should be fine. The above should save you quite a bit of time, frustration, and … if you’re a consultant it’ll make you look good.

https://IP_OF_SERVER:8333/ui will then allow you to login using the information provided during setup of the server/setup of VMWare.

Windows Server 2008 NTP

I was having issues with my 2008 servers clocks: they were running fast. After 30 days they were 2 minutes fast. 90 days they were 6 minutes. You can guess how fast they were after 120 days. Yay math!

In XP and 2000 one could simply open up the date and time control panel (or double click on the clock) and, through some tabbed Internet Time, select a predetermined NTP server. Maybe I’m just blind, but I couldn’t find the option in 2008 or vista. It could be one of my GPO’s blocking said option. In any case, my clients were all receiving this “fast” time. Not good.

To fix:
Open up an administrative command window (windows key + r works wonders for me)
Set the NTP server to time-nw.nist.gov
net time /setsntp:time-nw.nist.gov
Make sure that the NTP server has been saved
net time /querysntp
See where you’re grabbing your NTP information from (usually a domain controller)
net time
Actually corrects the time to your NTP server
w32tm /resync

RDP Connection Limit Windows Server 2003

One of the good things about Windows Server versus XP is the number of connections that you can have. XP is limited to 10 connections, Server is not limited. XP is limited to a single console connection and no RDP, Server is limited to a single console connection and two other RDP connections (total of 3).

One of the bad things is that in order to get your server to allow more than 3 simultaneous connections you need to install, and license, terminal server. Then you need to convert the server to run in Application Mode. Lots o’ fun. Our company made the mistake of installing a proof-of-concept of terminal server on a non-domain controller and non-production server. The server then died. And in order to retrieve the licenses, we’d have to contact the fine folk over at Microshaft and explain the situation, then get the new license keys, and then create the new server, and then configure the other servers to run in application mode. And hope it all works.

So I did it the easy way – hack the termsrv.dll file.

FYI hacking Microsoft files is a breach of the terms of service agreement and license agreements with Microsoft. Do so at your own risk.

First I will post how I went about “hacking” said file and how to implement in your own environment.
Unfortunately I can’t post the hacked file due to legal issues. So there is no “hey, here’s the file if you’re lazy”.

Now I’ve only tested this on Windows Server 2003 standard and enterprise, R2 and regular. ALL 32bit. I’m sure it’ll work on 64bit, but we have no needs to allow more than even the single console session on our 64bit servers.

Download the following files:
http://it.thelibrarie.com/utilities/vpatch32.exe
http://it.thelibrarie.com/utilities/2003tspatch.zip

Install the vpatch32 program (works on XP and Vista32/64)
Unzip the 2003tspatch.zip to find a PatchData.pat file
Copy the termsrv.dll file from your server’s WINDOWS\system32 folder to your desktop (easier to find, and you can’t patch an ‘in-use’ file)

Open vpatchprompt.exe located in %programfiles%\VPatch\
This will prompt you to find the PatchData.pat file you unzipped
Then it will prompt you to find the file you want to patch, in our case it’s the termsrv.dll residing on your desktop
Then choose a file name and the program will save the patched dll as this new name. I chose termsrvNEW.dll to keep it easy to locate.

Now the tricky part – because Windows has built-in protection for system files, we have to go about this in a trick-defeating manner.

On your server, locate the file in WINDOWS\system32\dllcache\termsrv.dll
Rename this file termsrvOLD.dll
Now locate the termsrv.dll file in WINDOWS\system32\
Rename this file termsrvOLD.dll as well
Copy the termsrvNEW.dll to WINDOWS\system32\
Rename this file to termsrv.dll

Windows will generally complain that a file has changed. Let the OS know who’s boss and that you want to keep the file. Now, reboot.

Test – if anything breaks you can always undo the files by using your old one again. If it all goes as planned, you can now have unlimited RDP connections to your server.

Yay!

***EDIT***
If you change the files and Windows changes them back, that’s the built-in security DEP of Windows. You may have to start in Safe-Mode (F8 before the black Windows Screen but after the BIOS) in order to edit these files.

***EDIT PT 2***
Before I could respond to a comment left by an anonymous internet troll, I did some extra research into the matter.
http://www.remkoweijnen.nl/blog/2008/12/09/windows-2003-x64-terminal-server-patch/ <--- apparently that will work on 64bit SP2 or R2 of Win2k3. I haven't tested it, so I won't comment further unless I need to apply this patch as well.

Backing Up A Linux Box

I finally came across a need to backup a linux box. Usually, in the past anyway, the linux box was such a strong contender that rarely if ever crashed that it seemed almost foolish to install AV and Backup software. Not that they crash more than they used to, but we rely on the systems so much more that we need viable backup solutions.

ClamAV, by the way, is a decent enough free solution to AntiVirus on a linux box.

Mondo is a great backup solution for a linux box.

I basically went to ftp://ftp.mondorescue.org/ and grabbed the three files I needed to get this running on a Debian 5.0 box.
(wget ftp://site/nameoffile)
File 1: mindi-busybox_1.7.3-1_i386.deb
File 2: mindi_2.0.6_i386.deb
File 3: mondo_2.2.8_i386.deb

Busybox is needed to install mindi, and mindi is needed to install mondo.

Install the applications:
Apt-get update
Apt-get upgrade
dpkg -i mindi-busybox_1.7.3-1_i386.deb
dpkg -i mindi_2.0.6_i386.deb
dpkg -i mondo_2.2.8_i386.deb

Create your bootable ISO rescue disk:
mindi
Select Yes for using your kernel for booting, and also Yes for creating an ISO of the CD.

Run your backup job:
mondoarchive

This will open up a window prompt wizard that allows you to choose where to backup your files.
Follow along with the wizard to finish your backup job.

Printer Showing As Offline

I had an issue of a printer showing up as offline even though it was most certainly online. I could ping it from the print server, and I could view the html pages for the configuration of said printer, but the print server was still listing it as offline. WTF, eh?

Then I came across a hotfix from Microsoft that says if the printer uses SNMP for certain communication that if it goes offline at any time there is a possibility that the printer will show offline even if all other communication works. The fix is as follows:

ON THE PRINT SERVER/HOST:
Open Regedit
start > run > regedit
Locate the Print key container
HKLM\SYSTEM\CurrentControlSet\Control\Print
Add a DWORD value to the print key container
Right-click and add DWORD Value
Give the DWORD key the name of SNMPLegacy
Set the SNMPLegacy key to 1
Close out of the registry editor

Now reset the print spooler service:
Start > run > services.msc
Find print spooler, right click, restart service
Test

Logging What Users Do In BASH

I like the BASH Shell – it’s fun and the default shell, so pretty much everyone can use it. And since I like the Ubuntu/Debian, the following steps apply to these systems – and you can probably figure out how to get them to work with BSD or another *nix flavor.

Finding out what people do with their access, on the other hand, is a little more difficult.

Sure, you can lookup their bash_history file, but that only goes back 15 to 25 commands (unless setup to a non-standard logging).
nano /home/username/.bash_history

Then I was turned onto Accounting Management:
apt-get install acct

That’s it! Easy, right?
Well, to see the information you have to know which commands to type.

LastComm shows the last command by a certain user, or when the command last matches your variable:
lastcomm username
lastcomm PID/Process

AC
ac
ac -d
ac -p

Ramblings Of An IT Person