Sunday, August 28, 2011

Running Windows 7 in a Virtual Machine Under OSX To Double Battery Life

I have had a Macbook Pro for a few years now and absolutely love the hardware (currently have an i7 model) but personally even after all this time find the usability of OSX far inferior.  I don’t want this post to turn into a debate about which is better, but if you prefer Windows 7 to OSX then you may find some value in this post.

Up until recently I have been running Windows 7 natively (ie – using Bootcamp drivers) on the Mac and it runs flawlessly, except for one issue which has always griped me – battery life.  The problem is that Apple do not provide a driver for their graphics switching magic voodoo hardware solution, so under Windows 7, the dedicated NVidia or ATI graphics chip is constantly used.  This is fine if you use the Mac to play games all day long, but if like me you are just doing development or word processing, etc it is a pain that your 7-8+ hours of battery life under OSX is reduced to 3-3.5 hours under Windows 7.  Not to mention the MBP gets much hotter due to the graphics chip working overtime.  So after realising there is no native solution (and probably will not be in the foreseeable future, if ever) I came to the conclusion that the only hope was to run Windows 7 in a VM under OSX and then force the graphics in the MBP to always use the integrated graphics using the excellent gfxCardStatus utility.  This utility allows you to force OSX to use either the integrated graphics, dedicated graphics or auto switching feature of the operating system which is cool.  Personally I set it to always use integrated graphics which I have found fine for every application I have tried, even GPU intensive ones, but the choice is always there to use switching if required which is nice.

As a VM solution I am currently trialing Parallels, which most objective reviews that I have read (ie – ignoring forums full of people stating their ‘preferences’) is superior in performance.  The result I have observed are as follows:

Windows 7 native (Bootcamp) 3 – 3.5 hours
Windows 7 running under Parallels 5.5 – 7 hours

The variation I have experienced is due to what applications you use during a given session.  Unfortunately I do not have much time so I cannot present more comprehensive results, but the above was gathered over 10 days.  So clearly, when it is able to use the integrated graphics, Windows is able to achieve very close to what I get under OSX.  If only Apple would release a native driver … Still I don’t hold my breath so I highly advise this solution to all Windows 7 users.  You also get a few other improvements as an added bonus.  First of all, the ACPI capabilities now function correctly (again lack of drivers from Apple is a cause of this) so that the screen reacts promptly and quickly to ambient light changes.  You also get the ability to switch to OSX which is handy if you are doing iOS dev, etc and the ability to seamlessly integrated with OSX applications is nice (ie open files with OSX applications).

There are some downsides of course.  Performance is not as good as running natively – whilst many people in the Apple forums seem ‘happy’ with the performance (always a great word to use when measuring performance) it is clearly slower than running Windows natively.  The problems largely come when you switch between Windows and OSX.  If you stay in either it is fine, but it is not uncommon for me to wait minutes after switching from Windows to OSX before OSX even becomes responsive.  Applications take noticeably longer to load in a VM and so on.  WPF applications do not perform correctly under Parallels unless you turn off graphics acceleration.  However most of these issue come to IO limitations.  You can clearly hear the hard drive being thrashed to bits and would be largely solved with the use of an SSD.

I am out of time so in conclusion, all I can say is give it a go for yourself, but given the doubled battery life I achieve when running in a VM, I am happy to put up with the relatively small losses I observe.  As for the actual VM software, I think largely all three options (Fusion, Parallels and VirtualBox) are going to be comparable in performance.

Saturday, August 13, 2011

Using The Picasa Desktop Application to Bulk Upload To Google+ Albums

If you want to bulk upload a lot of photos to your Google+ enhanced Picasa web albums for backup or other reasons without affecting your quota, then this post will help you.

The Picasa desktop application allows syncing with your online Picasa Web Albums.  It will even resize the photos to 1600x1600 (which is the largest size a photo can be without affecting your quota using a standard account) so that your uploads don’t consume your quota.  The problem is that the desktop client doesn’t support resizing to 2048x2048, which is the maximum size of a free photo when you have a Google+ account.  You want to take advantage of this extra size, but you don’t want to have to manually upload your entire photo collection using the online Google+ photo uploader, because it is slow and notoriously buggy.  For instance when uploading my thousands of photos, it would often freeze or stop uploading after a few dozen.  This is not unusual for heavy web applications like this – native applications exist for a reason after all.  So what do you do?  Using the following steps, you can get around the default Picasa desktop application limitations to very easily upload all your photos:

  1. Set Picasa to actively watch the root directory containing the photos you want to upload
  2. Create a root directory for resized photos (eg - ~\Resized) and set Picasa to actively watch it
  3. Select the folder you want to upload (in my case, I have photos organised by month)
  4. Select 'Export' in the middle of the toolbar down the bottom of the screen
  5. Make sure the size is set to 2048 (type manually) and the Export location is set to the resized photos root directory created in (step 2) and export
  6. The exported folder will appear in the Picasa folder list automatically after it is scanned
  7. Right-click the new folder and select 'Upload To Picasa Web Albums'
  8. Select 'New' and enter the desired album name.  Ensure the 'Size to upload' is set to 'original'.  The album visibility can only be changed using the web application
  9. Click Upload and wait for the images to upload
  10. If some images fail with '... must be at least -90', then it is due to invalid GPS EXIF metadata.  Select the photos and select View -> Places.  On the right-hand side, select each location and 'Remove location data' to clear the invalid metadata, then re-upload as per (step 7) reusing the existing album

Note that there is still a limit in Picasa Web Albums where you can only have a maximum of 1000 photos in a single album, so it is wise to organise your photos into some kind of folder structure.  I personally organise my photos in a fairly flat folder structure – first by year then by month.  I do this because time doesn’t repeat itself so It makes it easy to decide where a photo should be stored and to manage and synchronise photos between multiple computers.  Usually it means that there is less than 1000 photos in a month, so I don’t run into the above-mentioned problem.  I then use extended tags and meta data to allow the photos to be sorted and viewed as I like (by person, topic, location, etc).