[solved] OS X 10.7 Lion and mail search not working…

I was stunned to find out that the search function on the Mail.app wasn’t working anymore since I’ve upgraded my Mac from Snow Leopard 10.6.8 to (the very cool) Lion 10.7. Thought it could be Spotlight not working, or something else.

Well, as it turns out, it’s a combination of 2 problems:

1) turn Spotlight indexing on: sudo mdutil -i on /
2) when using IMAP, configure your account to Keep a message for viewing offline

That’s it! Where Snow Leopard was able to search thru already downloaded mail (although the above option was enabled), Lion can’t.

Now the search is working great!

OSX: Screen Sharing over the internet

Here’s a quick write-up describing how to connect to your Mac at home from your Mac at work (or any other Mac…).


1) User access with administrator’s rights on your remote OS X computer.

2) An Secure Shell (SSH) client on your local computer. On Windows, Puttyis a common and free version. Linux and MAC OS X, by default, come with SSH.

3) A VNC viewer client on your local computer.  In our case, we’ll using Screen Sharing. You won’t find it in the finder; it’s hidden here:

/System/Library/CoreServices/Screen\ Sharing.app

4) Network access to the SSH service on your remote machine.  This requires

a)  You know your remote machine’s hostname or IP address.
b)  Being behind the firewall, having VPN access, or being accessible to the public Internet (i.e. no firewall).

How to Remotely Turn On (and off) OS X Screen Sharing

This procedure keeps security in mind.  The idea is to turn on screen sharing while you need it, and then turn it off when you’re done.

1)  SSH into your remote OS X machine with an administrator’s log in and password.

2) Enable Remote Desktop (a.k.a. Screen Sharing, a.k.a. VNC) with this command:

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw password -restart -agent -privs -all

3) Login using a VNC client. You can use Screen Sharing or Chicken of the VNC (see tip below).
Your password is “password” (see the -vncpw flag in the above command;  you can — and should — change this).

4) When you are done, turn of screen sharing using your SSH session:

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off

Problems connecting with your VNC client, like Chicken of the VNC?

Set your remote display settings to greyscale (to speed up things) or ‘Let server decide). Anything lower than ‘thousands’ won’t work.

defaults write com.apple.ScreenSharing controlObserveQuality 2


Joining partitions in OS X

Eager to take on new challenges, preferebly with live equipment, I decided to reclaim some disk space.

My Ubuntu install on my MacBookPro was sitting there unused for a while now. And with VM’s who needs to dual boot anyway?

So, let’s trash my Ubuntu install. Now joining my ‘windows’ disk to my active partition was a piece of cake. However the linux swap would not budge.

Ofcourse booting from another disk was a solution which is by me considered as a failure not a solution.

Simple solution in the end:

box:~ user$ diskutil list /dev/disk0

#:                       TYPE NAME                    SIZE       IDENTIFIER
0:      GUID_partition_scheme                        *320.1 GB   disk0
1:                        EFI                         209.7 MB   disk0s1
2:                  Apple_HFS Inlakesh                309.2 GB   disk0s2
3:                 Linux Swap                         4.1 GB     disk0s3

box:~ user$ diskutil eraseVolume HFS+ oldswap disk0s3

Started erase on disk0s3
Unmounting disk
Initialized /dev/rdisk0s3 as a 4 GB HFS Plus volume
Mounting disk
Finished erase on disk0s3 oldswap

box:~ user$ diskutil list /dev/disk0

#:                       TYPE NAME                    SIZE       IDENTIFIER
0:      GUID_partition_scheme                        *320.1 GB   disk0
1:                        EFI                         209.7 MB   disk0s1
2:                  Apple_HFS Inlakesh                309.2 GB   disk0s2
3:                  Apple_HFS oldswap                 4.1 GB     disk0s3

box:~ user$ diskutil mergePartitions HFS+ Inlakesh disk0s2 disk0s3

Merging partitions into a new partition
Start partition: disk0s2 Inlakesh
Finish partition: disk0s3 oldswap
Started partitioning on disk0
Merging partitions
Waiting for disks to reappear
Growing disk
Finished partitioning on disk0
#:                       TYPE NAME                    SIZE       IDENTIFIER
0:      GUID_partition_scheme                        *320.1 GB   disk0
1:                        EFI                         209.7 MB   disk0s1
2:                  Apple_HFS Inlakesh                319.7 GB   disk0s2

That’s it. Scrapping the uneeded partition (volume in apple diskutil speak) to something diskutil understands, i.e. HFS+, worked like a charm!


Serial converters on Mac OS X ( USB to RS232 )

Hello All.
Being a network equipment kind of person, there is no way around the console and then. We all know the Prolific 2303 works fine, and now I know that most FTDI converters (on sale at for example the fnac stores) also have excellent drivers for Mac OS X.

So getting a good and cheap cable is not an issue, nor is getting a driver a challenge.

The other bit I’d like to share is the wonderful command line tool called ‘screen’. Now you can do lots of funky stuff with screen, however also use it for accessing your serial port.
It’s as simple as ‘screen /dev/tty.PL2303-XXX 9600‘ or ‘screen /dev/tty.usbserial-XXX 9600‘ et voilà.
To end a screen session the propper way, releasing your serial port again, is done by ‘Ctrl+A‘, followed by ‘:‘ and typing ‘exit‘ and hitting return.
There are plenty of guides out there if you think this is too basic. I just wanted to share that serial console on a mac is easy.

Mount remote SSH or FTP as a local disk

This is a nice trick I use to get my /home/Public of my NAS at home directly as a mounted volume on my MacOS X desktop.

You need to install three applications / frameworks:

1. MacFuse
2. Macfusion
3. sshfs (to update the old version pre-installed with Macfusion)

1. Install MacFuse

Download and install MacFuse.
MacFuse comes with a nice preference pane to check for updates. The version was 2.0.3 (or 2.1.5 beta) as of this writing.

2. Install Macfusion

Macfusion is an open source SSHFS mounting application for OSX (Snow) Leopard. Download and install.

If you’re using Snow Leopard, you’ll find that the current version of MacFusion refuses to complete a connection to a remote server. You can fix this in three steps:
1. First, quit MacFusion.
2. Second, open System Preferences and then open the MacFUSE pane. Check the “Show Beta Versions” box and click “Check For Updates”. Go ahead and update MacFUSE to version 2.1.5 beta as of this writing.
3. Third, open up a terminal and do the following:

rm /Applications/Macfusion.app/Contents/PlugIns/

Your MacFusion installation should now be working on Snow Leopard.

Add an SSHFS file system

To add an SSHFS file system click on the plus icon at the bottom of the main window and choose SSHFS.

Adding an SSHFS filesystem
Set SSHFS mount parameters

Under the SSH tab:
Host: The hostname of the server that you SSH to. This is usually the domain name of you website ( e.g. ‘yourdomain.com’ ).
User Name: Your SSH username.
Password: Your SSH password.
Path: can be left blank, default path will be used

Under the SSH Advanced tab:
Port: The default SSH port is 22 unless your server uses a different one ( just try 22 ).
Follow Symbolic Links: Leave this checked.

Under the Macfusion tab:
Mount Point: can be left blank.
Volume Name: can be left blank, but to nice up the icon on your desktop, use any name
Ignore Apple Double Files: You must uncheck this if you plan to open/edit/save files on the mounted volume. For example, if you want to edit an image file using Photoshop, this setting has to be unchecked. However, this powerful feature comes with a downside. Leaving this unchecked will cause OSX to place .DS_Store and ._ * ( Appledouble ) files on the server. OSX utilizes these hidden files for enhanced filesystem features and extended file attributes in non OSX native filesystems. For example, a Photoshop file can have icon, thumbnail, and version cue information saved in a separate Appledouble file. These files are invisible in OSX and other filesystems as they start with a dot. Leave this checked if you are just going to copy/move/delete files ( increases speed ). You can leave this checked if editing text files as most apps don’t save additional file attributes with text files. However, this depends on the application you use, so do some testing first.
Enable Negative VNode Cache: This is an optimization to increase speed and should generally be left checked unless files can appear on the mounted volume from the server side. For example, if multiple users are using your mounted disk space leave this unchecked.

You will now have an SSHFS filesystem ready to mount on your desktop.

Mount the remote filesystem

Click on the mount button and if the SSH settings are correct, you should have a green disk icon mounted on the desktop.

You can now access your remote files like they were on an external disk attached to your computer. You can copy, move, rename and delete files at ease. Remember that if you want to edit files on the remotely mounted disk, the Ignore Apple Double Files checkbox should be unchecked. You can easily edit the SSHFS mount settings by unmounting the disk and clicking on the Edit button.

You might have noticed that we completed only two of the three steps but you can already mount your remote filesystem. This is because Macfusion already has SSHFS pre-installed within its application package. However, I found the mounted filesystem response to be a little sluggish and wondered if the version of SSHFS that came pre-installed with Macfusion was outdated.

3. Update SSHFS

Let’s examine the pre-installed version of SSHFS that comes with Macfusion. RIGHT-CLICK ( or CONTROL-CLICK) on the Macfusion app in the Applications folder. You will be presented with a contextual menu. Choose the “Show Package Contents” menu option. You will then be presented with a folder containing the application folder hierarchy. Drill down until you see an application called sshfs-static.

Macfusion application hierarchy showing the location of the pre-installed version of SSHFS
This is the copy of sshfs that Macfusion uses to do its magic. To check its version, I opened up the Terminal app, changed directory to the parent folder off sshfs-static and typed in ./sshfs-static -V . You don’t have to do this by-the-way, just skip to the Download and Install SSHFS section.

% cd /Applications/Macfusion.app/Contents/PlugIns/

% ls -la
total 5736
drwxr-xr-x 9 chandima staff 306 Aug 4 2008 .
drwxr-xr-x 5 chandima staff 170 Aug 4 2008 ..
-rwxr-xr-x 1 chandima staff 46928 Aug 4 2008 new_sshfs_askpass
-rwxr-xr-x 1 chandima staff 2756952 Aug 4 2008 sshfs-static
-rw-r–r– 1 chandima staff 13259 Aug 4 2008 sshfs.png
-rw-r–r– 1 chandima staff 6796 Aug 4 2008 sshfsAdvanced.nib
-rw-r–r– 1 chandima staff 7609 Aug 4 2008 sshfsConfiguration.nib
-rw-r–r– 1 chandima staff 61418 Aug 4 2008 sshfs_icon.icns
-rwxr-xr-x 1 chandima staff 29280 Aug 4 2008 sshnodelay.so

% ./sshfs-static -V
SSHFS version 1.8 (MacFUSE SSHFS 1.3.0)
MacFUSE library version: FUSE 2.7.3 / MacFUSE 2.0.3
no mount point

The pre-installed version was 1.8. I wondered if I’d get a speed increase if SSHFS was updated to the latest version which was 2.2 (as of this writing).

Download SSHFS from:

http://code.google.com/p/macfuse/wiki/MACFUSE_FS_SSHFS (make sure you download sshfs-static-leopard.gz ).

After you uncompress the gzip archive, you will end up with a folder called sshfs-binaries. In there, you will see an app called sshfs-static-leopard.
Rename sshfs-static-leopard app to sshfs-static to match the filename that Macfusion expects.

Replace the old version of sshfs with the new version:
Drag and drop the downloaded and renamed sshfs-static executable into the Resources folder to replace the older version within the Macfusion package hierarchy.

You can check the version again to make sure that the new version is recognized.

% ./sshfs-static -V
SHFS version 2.2 (MacFUSE SSHFS 2.2.0)
MacFUSE library version: FUSE 2.7.3 / MacFUSE 2.0.3
no mount point

I unmounted and remounted the filesystem and the speed increase was quite significant. I highly recommend that you do this third step.

That’s it! Now you can access your remote SSH folders as a local volume.

Boot PowerPC Macs via USB 2.0 drives

First off, I have tried and tried again over the years to boot various PowerPC Macs via a USB2 disk. Thankfully, somewhere about the time the iMac G5 with the ambient light sensor (ALS) was released, Apple tweaked their Open Firmware, which allowed us to boot PowerPC Macs from USB2 drives.

Machines that I have tested this hint on and made it work are:
iMac G5 w/ ALS
iMac G5 w/iSight
12″ PowerBook 1.3GHz

Without further delay, here’s the process to follow.

Note: As with all hints that have to do with Open Firmware, proceed at your own risk! I have not experienced a problem and I don’t see how this hint could render your Mac useless, since the default can always be recovered by resetting the SMU.

Here’s what you need to do…
You need a USB2 drive with an OS X system installed (I am using 10.4.3, though any I think will work as far as what the machine can boot). As you know, there are many different ways of getting a system on a USB drive; contact me if you have any questions on how to do that, or search macosxhints.com for that information.

Connect the drive to your machine, and find out which partition the OS X system is installed on. I usually find this by going to Disk Utility and looking at the info for the partition on the USB disk with OS X. That is, disk2s3 is usually for a USB disk with no OS 9 drivers installed that is the second disk disk. disk3s9 might be a USB disk with OS 9 drivers that is considered the third disk. There are other ways of finding this out, but in my case, my disk is disk2s3 (the 3 on the end will come into play soon).

Start up the machine in Open Firmware (this is the fun part). Hold Command-Option-F-F right after the machine is turned on.

Here is the moment of truth. If this step does not work, I have had very limited success getting a machine to boot off USB2. In Open Firmware, type devalias, and you should get a list as output. In this list, look for ud, usually below where you see hd (ud is “USB Disk,” I presume). If found, it will usually have beside it /pci@f2000000/usb@1/disk1, or something similar. Again, if you see this, I have not had this fail yet.

Now type printenv boot-device, which will usually get you output of boot-device hd:,\\:tbxi. (See where this is going yet?)

Type setenv boot-device ud:3,\\:tbxi where the number after the colon corresponds to that partition number we found in step two. You should get an ok back.

Type printenv boot-device, and you should see the change displayed already. Something like:
boot-device ud:3,\\:tbxi hd:,\\:tbxi”

Type mac-boot and cross your fingers.

If this fails, there is a remote possibility that you can still boot off of USB2, but you may need to substitute ud for /pci@f2000000/usb@1/disk1, or something similar. If the firmware cannot list the contents of the drive, it seems it cannot boot off of it.

As you should know (thanks to the owner of the iMac G5 w/iSight for letting me know I should mention this), USB2 booting is not supported, therefore you should remember OS X has no support for booting USB 2 and the firmware has no support. So in System Preferences, the USB disk will not be shown as a bootable drive. In the optional boot menu (reached by holding down the Option key during boot), it also will not show.

Amazing Apple desktop music video (say what?!)

A digital filmmaker named Dennis Liu has made an amazing video for The Bird And The Bee’s lovely song “Again & Again”. The set? His Mac desktop. You sort of have to see it for yourself to understand; luckily, Dennis has dropped it on YouTube so that the world can see it in low-res glory:

Innovative, and definitely cool. It doesn’t seem to be an “official” video for the song…but if it isn’t, it oughtta be. (Hey, Bird! Bee! Y’all paying attention?)

Parallels Desktop for Mac build 3120

A must-have if your happy enough to own an Apple Intel machine. Look at the goodies:

There are a lot of features and enhancements introduced in this Release Candidate, such as:

  • NEW! USB 2.0 support – “Plug and play” popular USB devices like external hard drives, printers, scanners and USB 2.0 web cameras, and use them at full native speed.
    • NOTE! Current Build 3120 doesn’t support iSight and some other web cameras
  • NEW! Full-feature virtual CD/DVD drive – Burn CDs and DVDs directly in virtual machines, and play any copy-protected CD or DVD just like you would on a real PC
  • NEW! Coherence – The groundbreaking feature that lets you run Windows applications without seeing Windows just got better! Learn more about Coherence >>
  • NEW! Better Boot Camp support – Using your Boot Camp partition in Parallels Desktop is now easier than ever. RC’s Boot Camp support includes:
    • Full support for FAT32 and NTFS partitions
    • Easy offline configuration. Simply tell Parallels Desktop that you want to create a virtual machine from a Boot Camp Partition and click start. No complicated set up required!
    • No need to re-activate Windows each time you switch between Boot Camp and Parallels. Activate Windows only once inside Parallels and work in both environments
    • IMPORTANT! It is not possible to suspend a Virtual Machine that is connected to Boot Camp as it could result in an unstable system.
    • VERY IMPORTANT! Beta1 (build 3036) users must boot natively into Boot Camp and uninstall Parallels Tools for Boot Camp prior to running it in RC (build 3120).
  • NEW! Transporter RC bundled – migrate your real Windows PC, or existing VMware or Virtual PC VMs to Parallels virtual machines! Learn more about Transporter RC >>
    • IMPORTANT! Beta1 users MUST upgrade their Transporter package on their Windows source machine before using Transporter in RC. Failing to do so may result in a system crash and loss of data
  • NEW! Added keyboard remapping configuration
  • New Look and Feel – completely redesigned windows and easier to follow dialogues to make Desktop for Mac more user-friendly than ever
  • NEW! True “Drag and Drop” functionality – a long awaited feature that lets you seamlessly drag and drop files and folders from Windows to Mac OS X and vice versa. Parallels Desktop now shares the entire Mac file structure between OS X and Windows – no more worrying about which copy of the file is the most recently updated!
  • Read/Write Boot Camp partition – use your Apple Boot Camp Partition as a virtual HDD for Parallels Desktop for Mac
  • Virtual Machine Catalogue – now all of your virtual machines are available through a centralized VM catalogue which appears on each Parallels Desktop for Mac instance
  • One-click Virtual Machine Aliases – automatically create a desktop shortcut for your virtual machine with the OS Installation Assistant, by dragging-and-dropping from title bar, or by pressing Command-Option keys combination. Clicking on Alias automatically starts the Virtual Machine
  • Resizable Main Window – resize the Parallels Desktop for Mac main window as you do with any other Mac application
  • Auto-Adjusting Screen Resolution – Windows auto-adjusts its screen resolution to the actual main window size
  • Improved graphic performance – up to 50% faster!
  • Connect/disconnect USB devices schema improved – no more annoying “wait 5-10 seconds” message on USB device connecting to Parallels Desktop for Mac!
  • Up to 5 Virtual NICs – now each Virtual Machine can have up to five virtual network interfaces
  • Enhanced Shared Networking Mode – run Cisco VPN and many other complex networking applications in conjunction with Connection Sharing Mode
  • NEW! Lots of various fixes

Get it while you can: download and get your trial key here.

Apple Special Event on February 20

I’ve just got an anonymous tip from a source that indicates that Apple is planning a special event on February 20 to introduce Mac OS X 10.5 (Leopard), iLife ‘07 and iWork ‘07 as well as updated Mac Pros. Mac Pros will be available immediately with a free upgrade to 10.5 when it ships, and the ship date for 10.5 will be confirmed for 3/24/07 as they have been predicting for quite some time now. There is some speculation that we may see a week earlier or later for this event, depending on the status of Leopard, but this is the most likely date which is being planned (by this time, Leopard’s new interface will be complete and the OS will be finishing up testing). What better way to demo Leopard than with a brand new 8-core Mac Pro?

Many will remember that last year, not long after Macworld, Apple had a special event on February 28, 2006, to introduce new Intel Mac Minis and iPod HiFi.
The real question on everyone’s mind, however, is…

… will we see anything unexpected? Like an updated touchscreen iPod? Or perhaps a 12″ultra-portable Mac Book Pro? I continue to believe that it’s still going to be a little bit longer before we see either of those… NAB is coming up in April (the 14th-19th) and I’d peg updated Mac Book Pros at this event.

And then when will we see the full screen iPod and updated Mac Minis, iMacs, etc.? I don’t have any recon on that, so I’m not just going to make up something like some of the other guys would…if you have any ideas, sound off in the comments section below!