Hints for development under Parallels

A couple of hints for those using ParallelsI use a Mac. For all my Symbian development needs, I use a virtualization product called Parallels running Windows XP. It’s great!

Hint One: networking from Windows to the Mac

I keep my source code in a Subversion repository running under MacOS X. Accessing this from the PC environment is fine, but for the fact that the IP address of the Mac changes. That’s particularly true of the latest version of Parallels, where there’s a special ‘host only’ mode which enables the two environments to communicate even when there is no external network. However, installing Bonjour for Windows appears to allow you to refer to your Mac using its local DNS name. For example, my Mac appears (to my PC) as adrian-taylors-macbook.local. Even to things as obscure as the Subclipse Eclipse plug-in which I’m sure has no special knowledge of Bonjour.

Hint Two: Creating a TrueCrypt volume

TrueCrypt is a system for encrypting whole volumes under Windows or Linux. Such a volume can either be contained in a file on some other volume (as is normally most appropriate under a normal Windows PC), or a whole hardware device or partition can be encrypted.Under Parallels, the latter works beautifully. Just configure Parallels to have an extra hard disk:

Extra Hard Disk in Parallels

TrueCrypt has an option to encrypt a whole device in its encrypted volume creation wizard. However, if you select a whole volume it will warn you that Windows may overwrite the first few bytes of the drive. So you must first create a partition on it. Any old FAT or NTFS partition will do. Use Windows Control Panel -> Administrative Tools -> Computer Management -> Storage -> Disk Management (an obscure location!) Once you’ve created the FAT/NTFS partition, you can then tell TrueCrypt to create an encrypted volume on this partition.

Creating an encrypted TrueCrypt volume

  It works beautifully and is reasonably fast – the Symbian emulator only takes a few seconds to load even when none of it is cached.(Note that I haven’t actually tried using a TrueCrypt volume in a file on my main Parallels volume, so it may be quicker, but I’d be very surprised).

Hint Three: Getting the Symbian emulator to actually boot

I have found two problems getting the Symbian emulator to boot under Parallels. About half the time, it crashes before even displaying its window. After some investigation, it appears that the emulator is getting a high-resolution time from Windows, then executing 400000 instructions, then getting the time again – in order to determine how quickly the host PC executes instructions. The problem is that Parallels’ high-resolution timer appears to be insufficiently high resolution*, and the times come back the same. This confuses the code which fails with a divide-by-zero exception. There’s no particular workaround unless you have access to Symbian OS source code (in which case, comment out Wins::CalibrateCpuSpeed() within src\cedar\generic\base\wins\specific\variant.cpp, cd .., bldmake bldfiles, abld build winscw udeb vwins). However I’ve e-mailed Parallels to see if they can improve their timer, and will let Symbian know too.

The other problem is that, under certain Symbian OS emulators, they crash when they discover the PC has no serial port. (They try to use it to find a modem). To fix this, simply add a virtual serial port under Parallels. It can be connected to a file, or anything… that solves that problem.

(* I have no evidence that their timer is lower resolution than a real PC. Maybe my PC is just very fast, and lots of people with Core 2 Duo PCs are having trouble with the Symbian OS emulator.) 

Parallels is, incidentally, great. It is absolutely as fast as a real PC in normal usage, and even uses some of MacOS X’s cool graphics effects when you switch between Mac and PC – the whole screen ‘flips round’ in front of you.

2 Responses to “Hints for development under Parallels”

  1. macrobug Says:

    [...] For the S60 3rd edition SDK, here’s my fix for the bug I talked about a while back. [...]

  2. www.macrobug.com» Blog Archive » UIQ3.1 SDK on Parallels Says:

    [...] Back in November I was having difficulty getting the S60 3.1 SDK to run on Parallels. At that time I had access to some Symbian OS source code (through a contract) so was able to debug it. [...]