Booting VMWare ESX on an Apple Xserve

I installed VMWare VSphere ESXi 5.0 on my Apple XServe 3,1.  I rebooted and OSX server booted instead of the ESXi installation.  Here’s how to fix it.

In OSX run this command:

bless --device /dev/disk1s1 --setBoot --verbose

where disk1 is the disk that the ESXi installation is on.

Hope this saves someone some time.

Restricting access to distribution groups in exchange 2010

Use this shell command to restrict access to distribution groups to your exchange users.

This sets “Require that all senders are authenticated” in Message Delivery Restrictions in EMC

Get-DistributionGroup | Set-DistributionGroup -RequireSenderAuthenticationEnabled $true

Error creating new-ReceiveConnector

When created a new-ReceiveConnector you get an error like this:

New-ReceiveConnector : Active Directory operation failed…This error is not retriable. Additional information: The parameter is incorrect.  Active directory response: 00000057: LdapErr: DSID-0C090C30

This is caused by not running setup /prepareschema before upgradeing to sp3.  To work around the error just run that command from the sp3 media.

http://support.microsoft.com/kb/2457729

Exchange sp3 hell

My Exchange 2007 store ran out of space and the stores dismounted. This is on a CCR cluster. After expanding the volume I brought the mailbox db up. I backup up the databse with DPM 2007. After the backup the log files aren’t deleted.

On the target node, which is also the node being backed up, I see these events:

Microsoft.Exchange.Cluster.ReplayService (2300) The surrogate backup procedure to MBX has been successfully completed.

The Microsoft Exchange Replication Service VSS writer (instance 46a3ea35-c95a-4ac4-981a-2be339853fc8) has successfully completed the backup of storage group ‘First Storage Group’.

Database log truncation has been requested for this storage group. Log truncation will occur on the active copy after the next log generation is created. Log truncation will occur automatically on the passive copy after that log file is copied.

On the active node I see these event:

Information Store (2236) The surrogate backup procedure has been successfully completed by MBX.

(error, source ESE, Event ID 214) MSExchangeIS (2236) First Storage Group: The backup has stopped with error -521.

This is what I did to fix it:

I dismounted the database, ran eseutil /mh “database name” on the database and verified the the log required value was “0″, meaning all transactions were committed to the database. I then moved the log files to another volume. I didn’t delete them in case of some unlikely failure. I also could have zipped them and deleted the log files. In this case it was faster to move them and I had SAN space to create a temporary volume to hold the log files. Server 2008 had a hard time even displaying the folder that contained the log files so I used the command move E000*.log in a command window started as administrator. Once the log files were moved I mounted the database and run a backup with dpm.

I did do the above, but it didn’t fix the problem. Turns out SP3 was the problem, read bellow.
After searching around on that error -521 I found this article which says that VSS backups work from the backup perspective but throw that error and the log files aren’t truncated.

http://support.microsoft.com/kb/2297394/

So it looks like I didn’t notice this after I updated to sp3. I installed rollup 1 for sp3 and the error was gone but the logs still weren’t turncated due to the logs I removed. I restored the log files I removed (I had just moved them to a temporary volume (NEVER DELETE LOG FILES!) and ran a backup from dpm and the logs were truncated normally. -1 to MS for bad SP!

WWDC 2010 Keynote

Waiting for Steve…

5200 attendees

2 Million ipads in 59 days…more ipad love…

5 Milion books sold.  Can add highlighting and notes to books with a view that’s easy to find them.

5 Billion downloads on app store.

Guess Steve thinks android isn’t a factor…iphone has 53% browser market share in US.

iPhone 4

  • redesign – thinner, glass on both sides, stainless around edge
  • front facing camera, micro sim tray, camera on back, noise canceling mic
  • antennas integrated into stainless band
  • 326 pixels per inch on display
  • A4 chip (same as in ipad)
  • 7 hrs talk time, 6 hours 3g browsing, 300 hrs of standby
  • 802.11n
  • 5 Mp camera and HD video
  • iMovie for iPhone
  • threaded messages in mail

Use 10.5 Server to host 10.6 Updates

SUS on 10.5 by design doesn’t see 10.6 specific updates. Use these modifications to get Apple Software Updates Server 10.5.8 to host 10.6 Updates.

This originates from This Apple Discussion.

  1. Stop SUS either from Server Admin or from the command line with:
    serveradmin stop swupdate
  2. Create the file
    /usr/share/swupd/html/content/meta/mirror-config-1.plist

    with the following contents:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>PrimaryCatalog</key>
    <string>http://swscan.apple.com/content/catalogs/index.sucatalog</string>
    <key>CatalogsList</key>
    <array>
    <string>http://swscan.apple.com/content/catalogs/index.sucatalog</string>
    <string>http://swscan.apple.com/content/catalogs/others/index-leopard.merged-1.sucatalog</string>
    <string>http://swscan.apple.com/content/catalogs/others/index-leopard-snowleopard.merged-1.sucatalog</string>
    </array>
    </dict>
    </plist>
  3. Edit /etc/swupd/swupd.plist and change the metaIndexURL entry to look like this. Make sure the port is the port your update server is set to use. Mine uses port 8080.
    <key>metaIndexURL</key>
    <string>http://localhost:8080/content/meta/mirror-config-1.plist</string>
  4. Create links to the catalog files that will be downloaded:
    cd /usr/share/swupd/html/
    ln -s /usr/share/swupd/html/content/catalogs/others/index-leopard.merged-1.sucatalog index-leopard.merged-1.sucatalog
    ln -s /usr/share/swupd/html/content/catalogs/others/index-leopard-snowleopard.merged-1.sucatalog index-leopard-snowleopard.merged-1.sucatalog

    Now you can push each url for each major version through WGM or in /Library/Preferences/com.apple.softwareupdate.plist
    …or if that doesn’t sound reasonable…

  5. To use a single url for updates from the client add this to the LoadModules section of the /etc/swupd/swupd.conf file:
    #For using one URL for all clients
    LoadModule rewrite_module       libexec/httpd/mod_rewrite.so
    
    #Rewrite section for using one URL for all clients
    RewriteEngine On
    RewriteCond %{HTTP_USER_AGENT} Darwin/10
    RewriteRule ^/index\.sucatalog$ /index-leopard-snowleopard.merged-1.sucatalog
    RewriteCond %{HTTP_USER_AGENT} Darwin/9
    RewriteRule ^/index\.sucatalog$ /index-leopard.merged-1.sucatalog

    In 10.6 apple started using separate urls for each major version, so normally a 10.6 client would have to call into the index-leopard-snowleopard.merged-1.sucatalog url to see 10.6 specific updates. This change allows all clients to use the url with index.sucatalog and rewrites the request based on the user agent string. For Snow Leopard it’s Darwin/10. From HT4069

  6. Start SUS with server admin or the command:
    serveradmin start swupdate

Wait for swupd_syncd to download the new updates. You can watch swupd_access_log in Server Admin or from the server command line with tail -f /var/log/swupd/swupd_access_log. Also watch your network traffic on the server with Activity Monitor. You should see log entries like this as updates are downloaded.
127.0.0.1 - - [22/Apr/2010:15:33:51 -0400] 8080 GET "/content/meta/mirror-config-1.plist"

Deleting persistent printers

I deployed printers with Group Policy preferences to XP sp2 computers using KB943729 client side extensions. I deleted the deployed printers from the policy and they did not delete from the client.  Adding a delete printer record doesn’t work.

As far as I can tell they can only be deleted from the registry with a command like this:

reg delete HKLM\SYSTEM\CurrentControlSet\Control\Print\Connections\,,SERVER,PRINTER /f

Where SERVER is your print server and PRINTER is the printer name.

To avoid this problem deploy printers in replace mode, and check “Run in logged-in users security context” and “Remove this item when no longer applied”

Fixing a TI-89

If you TI won’t turn on or is flickering with inconsistent power stop banging it around and read on!  On my TI-89 corrosion had built up on contacts connecting the battery compartment to the circuit board.

2010-02-21 17.16.35.jpg

You can see the corrosion on the right contact.  I just used sand paper to clean it off and was back in business.

To take apart the case remove the 6 screws with a T6 torx driver and the backup battery cover.  Then pry the case apart.  snap it back together after the contacts are cleaned.

WWDC Keynote

WWDC Keynote – keep refreshing, updating.
New 15″ pro – 1699

  • built in battery
    • 1000 charges
    • 7hr battery life
  • up to 8GB ram
  • up to 3Ghz

New Macbook 1199

  • built in battery
    • same as 15″
  • up to 5 GB
  • backlit keyboard
  • firewire 800
  • now is pro

Air 1499

Bertrand – talking about how great win 7 is .. and snow leopard…

safari 4 released for leopard tiger and windows.

  • plugin crash protection

Craig Federighi vp mac os engineering

  • new stacks functionality – scrolling, subfolders
  • previews in finder for media
  • expose – click and hold does expose for app
  • Safari 4
    • cover flow view of history
  • quicktime 10
    • video editing in quicktime, with timeline
    • integrated sharing

Bertrand – Technologies

  • Grand Central Dispatch
  • openCL
    • open computring language
    • run compute code on graphics processor
    • hardware independent, c based
  • exchange built in to mail, ical, address book

Snow leopard retail – $29 – family pack $49 – available September
iPhone – Scott – new price 8GB $99

  • 50,000, 1billing downloaded, 40 million sold
  • New features
    • copy/paste/undo
    • Search mail (including server side)
    • itunes rent and buy from iphone
    • itunesu support
    • parental controls for itunes and rated apps
    • tethering (share internet connection) (usb or bluetooth) no supported by att
    • autofill
    • http streaming
  • find my iphone – through mobile me – remote wipe
  • sdk
    • in App Purchase
    • peer to peer – over bluetooth, no pairing
    • accessories – apps can talk directly to hardware
    • cocoa touch control to embed google maps
    • turn by turn using core location
    • push notification
  • App Demos
    • spark – science app with support for sensors pasco.com
  • JDPower for consumer and business
  • iphone 3g S – $199 – 32GB $299 (att prices) June19
    • 7.2 Mbps HSDPA
    • 3Mp camera
    • tap to focus
    • video – 30 fps vga – editing – integrated sharing
    • voice dialing and phone control
    • compass
    • hardware encryption
    • better battery life

One more thing

Blowing away OpenLDAP (Open Directory)

I was having many problems with LDAP after my server lost power.  See below for the various issues I was having and bellow that the solution, which was basically dumping the contents of ldap, blowing away the database and adding them back in.  It was actually quite simple.

I was finding that some machines, which I have adding themselves to ldap via a script, are not showing up in LDAP.  Some though are showing up in dscl.

For example the machine hse118-20 does not show up in workgroup manager.
in dscl when I cd to the Computers container and do “read hse118-20″ I get what looks like the appropriate data back.
in dscl when I cd to the Computers container and do an “ls” hse118-20 does not appear in the listing.

****

slapd in debug mode and saw these errors in the slapd.log when I go to create the mslib group:

May 18 11:12:05 chetwood slapd[14034]: => bdb_dn2id_add: subtree (cn=mslib,cn=computer_groups,dc=chetwood,dc=local) put failed: -30996
May 18 11:12:05 chetwood slapd[14034]: entry failed schema check: value of naming attribute ‘cn’ is not present in entry
May 18 11:12:05 chetwood slapd[14034]: => bdb_dn2id_add: subtree (cn=mslib,cn=computer_lists,dc=chetwood,dc=local) put failed: -30996
May 18 11:12:05 chetwood slapd[14034]: entry failed schema check: value of naming attribute ‘cn’ is not present in entry

I can add a group called “test.”  I get something similar when I try to add a group (which I think I’ve added before) called hse118, but without the “put failed” line:

May 18 11:19:43 chetwood slapd[14034]: entry failed schema check: value of naming attribute ‘cn’ is not present in entry
May 18 11:20:13: — last message repeated 1 time —

****

Here’s what I get using slapadd (with slapd halted), this does work for other group names (just changing mslib to test for example):

chetwood:~ root# slapadd -v << EOF
> dn: cn=mslib,cn=computer_lists,dc=chetwood,dc=local
> objectClass: apple-computer-list
> objectClass: top
> structuralObjectClass: apple-computer-list
> cn: mslib
> EOF
overlay_config(): warning, overlay “dynid” already in list
overlay_config(): warning, overlay “dynid” already in list
overlay_config(): warning, overlay “dynid” already in list
overlay_config(): warning, overlay “dynid” already in list
overlay_config(): warning, overlay “dynid” already in list
=> bdb_dn2id_add: subtree (cn=mslib,cn=computer_lists,dc=chetwood,dc=local) put failed: -30996
=> bdb_tool_next_id: dn2id_add failed: DB_KEYEXIST: Key/data pair already exists (-30996)
=> bdb_tool_entry_put: txn_aborted! DB_KEYEXIST: Key/data pair already exists (-30996)
slapadd: could not add entry dn=”cn=mslib,cn=computer_lists,dc=chetwood,dc=local” (line=6): txn_aborted! DB_KEYEXIST: Key/data pair already exists (-30996)

****

And lastly — I did a db_verify on the cn.bdb with slapd stopped and it came up with some errors.  I ran db_recover on the database and it hung on a log file (there were 3), which was dated early march.  I didn’t know what else to do so I removed that file (this was all last night) and the recover completed without error.  The db_verify still errors on cn.bdb

****

And here is the solution:

  1. Login as root and Stop Ldap:
    launchctl unload /System/Library/LaunchDaemons/org.openldap.slapd.plist
  2. create a directory to hold a backup, in root’s home is fine:
    mkdir opendirectory
  3. enter the directory and dump the LDAP database
    cd opendirectory/
    slapcat -l ldap.ldif

    Use a text editor to look at the file and make sure it looks like the data in ldap
  4. Move all files except the config file from the OpenLDAP db location:
    find /var/db/openldap/openldap-data -type f | grep -v DB_CONFIG | xargs -I arg mv arg openldap-data/
  5. create a new database from the dump file created above:
    slapadd -l ldap.ldif
    slapindex
  6. start ldap
    launchctl load /System/Library/LaunchDaemons/org.openldap.slapd.plist

Now test ldap with workgroup manager or dscl and make sure your entries are there. If anything goes wrong then the original database can be copied back.