peteg's blog - hacking - mac

Goodbye VMware Fusion, hello VirtualBox

/hacking/mac | Link

I got sick of VMware Fusion 3.1.3 failing to bring the bridged ethernet interface back up after sleeping, and figured that it wasn't worth $US40 to find out what the newer v4 does on the now near-obsolete Snow Leopard. Time to try out the free/libre VirtualBox that so many people have mentioned.

Well, installing Debian is easier than ever. Configuring the network was quite tricky though, as I have a relatively complex setup. The first adaptor is a NAT interface for talking to the internet. The second is the ethernet bridge that serves TFTP and NFS to the ts7250 ARM board when I'm hacking it, and the third a host-only adaptor so I can SSH into the virtual machine. That all seems to work OK. The bridged ethernet is even more reliable than before: it always comes back after sleep, and the TFTP boot does not time out like it used to under VMware.

... and then there is the USB connectivity: I plug the FTDI-based AVR programmer into the virtual machine so I can make install there. This doesn't work too well with VirtualBox due to this bug, though cranking the number of CPUs down to one does get it to go: I can program the AVR using it. The USB performance seems a bit dire though, and this is one area where they lag VMware by a long way.

I don't know if the graphics emulation is much chop as I use X11 over SSH to (only) run Emacs.

When too much hardware is barely enough

/hacking/mac | Link

Apple continue to ship their MacBook Pros with insufficient memory. I got jack of this thing hitting swap even though it had another gigabyte on my previous MacBook; subjectively it felt worse for the same workloads, maybe because Chrome is a memory pig. (I'm back on FireFox now.) So last Friday I went to MSY to buy a couple of 4Gb sticks. Their price for Kingstons: $42 each. Apple wants $480 for the pair. That is an insane price differential.

MSY (being MSY) only had one in stock, however, and I wasn't in the mood to wait howeverlong. (It is extremely irritating that they don't indicate their stock levels online, or allow online orders. It is also irritating to have to wait for some bloke to pointlessly, endlessly complain about their refusal to give him a replacement/refund when his son couldn't install a CPU properly.) I hoofed it back to the place where mrak got his last time, in the little slice of Tokyo on George St near the tram line. They wanted $60 a stick which was fine by me, and the bloke helped me install it. While prying the underside off it I tipped three of the tiny screws onto the floor, but somehow by the end of our conversation he had recovered all three. I have no idea how he did that.

Thus far I cannot get it to use the final 1.5Gb or so, even with Windows XP and Debian running in VMware concurrently. Thus I can hope it will last a year or so, though I fully expect Lion to eat it when the time comes.

Today I bought what may have been the last two Logitech USB hubs available in a shop in New South Wales, from Myer in Orange, for $36 each. mrak told me ages ago that these things were reliable and I've been happy with the one I got at the time, which is presently hooked up to the BeagleBoard at ANU. The price tag was $60 each but the bloke gave me a hefty discount on the merest suggestion they were overpriced. I am shocked that Logitech has not replaced this classic hub, and that there is nothing else readily available with its reputation for just working.

When too much hardware is not quite enough

/hacking/mac | Link

Finally Apple released a new MacBook Pro that was worth buying; I'd been waiting about two years for this. Somewhat surprisingly, given Intel's problems with the SATA interfaces on their new Sandy Bridge chips, Apple managed to roll out the new laptops pretty much under the radar and at a time that suited me: NICTA wanted me to pay off my salary sacrifice by the end of March (the end of the fringe-benefits tax (FBT) year, I believe), so I hurried off to the Apple Store at Bondi, where the service was terrible but everything was shiny.

The calculus of which one to buy was pretty easy, as it turned out. The 13 inch ones, which I would be inclined to buy, only have two cores and crappy Intel integrated graphics, and the bottom-end 15 inch one has an ATI/AMD card that is apparently worse than the previous-generation's NVIDIA one. That left the top-end 15 inch, of which I got the 2.2GHz one as I'm not going to miss 100MHz of CPU performance. I was going to get a high-resolution screen and faster hard disk, but they don't do that in the shop, and teeing up a delivery was a bit tricky, being on holidays and all.

It ended up being a lot of cash with the AppleCare and the 8Gb iPod Touch, free with a mail-in rebate. Yep, I got suckered the same way last time, but this time it's free! What could go wrong with that...

Performance-wise this machine smokes the old Core2 Duo MacBook; building my stock Isabelle theory takes about a third of the time, albeit by toasting my thighs. Given that the unibody is (even) more durable than the plastic case, I expect to easily get four years out of this thing. Moreover I can play finally all those games of yesteryear, such as Portal. I think there are a few issues for Apple to iron out yet, though; it's a lot crashier than the old MacBook, perhaps due to immature graphics drivers.

VMware Fusion 3 is a goer.

/hacking/mac | Link

I've been very happy with VMware's Fusion product since their public beta a few years ago, using it mainly to run a Debian instance for Haskell hacking, and Windows for doing my tax. Recently the slow HGFS performance has been a drag while hacking ikiwiki, as git seems to take ages to perform a commit on my Mac home directory mounted under Debian. Fortunately, the unreasonably cheap upgrade to Fusion 3 yields a massive speedup.

Hmm, perhaps I spoke too soon. It seems a bit buggy: HGFS doesn't seem to cope with colons in filenames, of which there are many in the ikiwiki bugs directory.

/hacking/mac | Link

I had my first encounter with an Apple "Genius Bar" today, having been referred to the one on George St in Sydney by the always-helpful staff at CompNOW at UNSW. In brief, the power adaptor for my MacBook was getting dangerous, with the insulation on the wire between the box and the computer wearing through, and sometimes getting quite warm. Apparently these things are known fire hazards.

The genii require booking, and I think I got the final one of the week: 4:45pm on this, a Sunday, afternoon. The machine is still under an AppleCare warranty, so the bloke replaced it on the spot. The CompNOW people said it would take them three to four days to do the same thing, as they had no stock, and moreover would need to hang onto my adaptor for that time.

Everything is bright and shiny.

/hacking/mac | Link

Last Friday I decided to get the MacBook's case fixed again — due to a design flaw the top keyboard panel tends to crack in the bottom right corner. This is probably related to how I carry it around in a backpack. They also replaced (at least) the caps on the keyboard, which are perhaps a part of the same assembly (?).

I also took the opportunity to buy a copy of Snow Leopard from the pushers at CompNOW on the UNSW campus, thinking my poor little MacBook could benefit from the decreased memory pressure. In brief:

I'm slow: a new Carbon Emacs has been out for a month.

The Mac OS X 10.4.11 Upgrade Killed My MacBook.

/hacking/mac | Link

That's a first, a Mac OS X update that screwed things up so badly the MacBook ceased to function. Oh well, I now know where an Apple store is in Hồ Chí Minh City; I went to:

Thuan My Co. Ltd - Apple Authorised Reseller
98 Nguyễn Công Trứ, District 1, Hồ Chí Minh City.
Tel: 84 8 8218936, 8218937
Fax: 84 8 8218937
Email: thuanmy-sales@hcm.fpt.vn

and tried to buy a copy, nay a licence, of Leopard. I'll spare you that story. The "update" function failed to work any magic (or didn't like the cafés I went to), but the "archive and install" thing did the trick. I get the impression that some database in my old 10.4 installation got trashed.

Here are some fix-ups for Leopard from around the net (sorry for the lack of attribution). Let's fix the Dock (make it look more like Tiger's):


defaults write com.apple.dock no-glass -boolean YES
killall Dock

and the transparent menubar (cut and paste this line, then — eek! — reboot):


sudo defaults write /System/Library/LaunchDaemons/com.apple.WindowServer 'EnvironmentVariables' -dict 'CI_NO_BACKGROUND_IMAGE' 0.63

Time machine claims to have done something but I haven't tried to use it yet. Spaces is clunkier than I'd expect; using an app that sprays windows around like Finder and expecting some kind of mid-90s "raise" functionality is apparently asking too much. The wifi widget on the menubar finally works like what every user of open networks wants it to. Worth the money? Probably not, but heh, anything to get the MacBook back on its feet. That's the last time I travel without a Mac OS X DVD.

Die, X11, die...

/hacking/mac | Link

This whole Unicode fiasco has finally killed X11 as a viable option for me. I wouldn't have thought it was so very hard to provide a complete set of easily-usable Unicode fonts, but there it is.

So, on André's advice, I've switched to:

  • Aquamacs, GNU Emacs with a shiny-happy Mac OS X face. Apart from a lot of minor irritations that come with losing about a decade's worth of XEmacs configuration, it seems quite slick. I tried Carbon XEmacs but it doesn't support Unicode out of the box, and I refuse to spend (more) hours fiddling with it.

  • Terminator, an xterm-alike written in Java, is possibly the best thing ever to run on the JVM.

  • A new bash from MacPorts that speaks Unicode better than the crusty old one that comes with Mac OS X 10.4.x.

Of course I'll still need X11 for sundry old-school things like Isabelle, but there the pain is much less.

So, why Aquamacs rather than a fancy closed-source editor? Well, TextMate crashed on me after about twenty minutes of use — I tried to open a file while saving-as another one, and was madly switching programs trying to navigate the directory tree — and so I recall the cardinal rule of editors: anything less than twenty years old hasn't been tested enough. Whether the (relatively shallow) differences that Aquamacs has to GNU Emacs matter is something I will soon discover.

iPhoto Script Export

/hacking/mac | Link

This thing is magic: one can readily write a little script to (in my case) copy images from iPhoto into a Blosxom-friendly location, and output the requisite tags.

Accessing the Mac OS X paste buffer from the command line.

/hacking/mac | Link

If you have ever wanted to ship data to or from your X11 environment, check out pbcopy and pbpaste. Now, if only X had a sane cut-and-paste model, we'd be home...

FireFox 1.5.0.11 Mac-optimised builds.

/hacking/mac | Link

I'm not a huge fan of the new FireFox (v2.x) for reasons that slip my mind now. Fortunately a kind soul is still cranking out optimised builds for the Mac, sans fancy widgets.

André on Mac OS X essentials.

/hacking/mac | Link
André's been procrastinating about something, and so we all benefit from his list of tried-and-true Mac apps. Hmm... XEmacs-style Meta-/ for Cocoa apps? It's all my Christmases come at once.

iPod Shuffle Gripes

/hacking/mac | Link
OK, I've owned the damn thing for about a month, time to put the boot in. :-) What I like:
  • Unplugging the headphones makes it pause. Perhaps all iPods do this, but my iRiver didn't.
  • The control is much better designed than my old iRiver.
What I'd like:
  • Some audible warning that it's out of juice. The little all-purpose LED glows red, I think, and that's that.
  • A way to delete songs on the player itself, so I can fill it up with random crap and on-the-spot nuke the annoying stuff, rather than having to tediously go through it afterwards in iTunes at home.
What I don't like:
  • The dinky dock. My old iRiver had a standard mini-USB port, which happened to be the same as my Canon PowerShot A75. One cable was all I needed. Moreover I have no way to recharge it without having the iBook plugged in and running — there's no juice on the USB bus when it's suspended.
Ars Technica killed theirs by running a car over it. This program may yet liberate me from iTunes inanity.

Powering the iBook from the car.

/hacking/mac | Link

I trudged all over Sydney CBD today looking for a new pair of Docs and something that would let me recharge the iBook from the car. It seems the old Docs shop on Pitt St Mall has folded, and the joint down George St that for years proudly advertised cut-price Docs has gone for the factory- (China-) direct brand instead. I'd forgotten what a hassle it is shopping on the street.

Anyway, to cut a long ramble short, I ended up buying a "Powertech Plus Cat. MP-3463 3.5 Amp Universal Step-up DC/DC Converter for Notebook Computer" from Jaycar on York St for $40. The sealed-in cardboard says it was made in China and is distributed by Electus Distribution, and I can guarantee you that the cardboard was printed there too. I can't find it in either of their catalogues. There is also a 6 Amp version for those who have something hefty.

It works, with one small wrinkle: the iBook-sized plug adaptor is wired backwards! Fortunately the iBook is up to that game, simply ignoring a reverse-polarity 24 volts. The solution is to wedge the plug adaptor onto the cable backwards. For the curious these Italians have the details, or you can try to figure out what Apple is on about.

/hacking/mac | Link
André pointed out Terminator to me, a cross-platform terminal emulator written in Java. It sounds promising; the only things tying me to X.org are XEmacs, a DVI viewer and xterm.

Easing into the 21st Century.

/hacking/mac | Link
Met up with André in Newtown for a coffee and some lunch, and being the unpaid ambassador for Apple that he is, we ended up in the Apple store on Broadway and I parted with $119 for an iPod Shuffle, a replacement for my venerable 256Mb iRiver iFP-390T I bought in Boston at the end of 2003. I can't see why it needs an on/off switch.