Installing Windows 7 on MacBook Pro without SuperDrive

Right after I swapped my SuperDrive to second internal HDD I was graving to move my 20 GB Boot Camp partition to the other drive and make it bigger, so that I don’t have to carry another USB disk for my games.

UPDATE: From the comments it seems that on Mountain Lion 10.8.2 you do NEED rEFIt for the Windows partition to be visible in Boot Menu.

UPDATE 2: I have confirmed lately that the official Boot Camp Assistant method does work on MacBook Pro Retina (Mid 2012) with OS X 10.8.2 (12C3012) on it. So if your Mac came without SuperDrive from the Factory, try the official method first.

UPDATE 3: @Jorge_Rui posted excellent step-by-step instructions down in the comments on how he got it working. Take a look.

What didn’t work

You can skip to Success Story if you are not curious. Also, YMMV, so if my method does not work, you can try one of these and see if you have success with them.

USB-booting installer

Boot Camp Assistant warning that I need optical drive

First I tried to fake Boot Camp Assistant to create bootable USB stick, but that did not boot for some reason. Also, booting from USB-DVD did not work. Then I used Virtual Box to fully install Windows on physical partition and that did not show up in the boot menu either. With all of these options I also combined rEFIt to no avail.

EFI, rEFIt and File Vault 2

Intel Macs have been using EFI instead of BIOS for booting up the system since the beginning. If Boot Camp dual-booting is not enough for you, there is the rEFIt alternative boot manager that gives you more power over boot options. But it turns out that although rEFIt installs without any complaints, it fails to load from File Vault 2 encrypted partition, which is understandable as I haven’t yet provided my passkey.

So, running out of options, I decided to decrypt my partition, which I’d have had to do anyway sometime to be able to resize the encrypted partition over the previous Boot Camp partition (Disk Utility is not able to resize encrypted partitions). I still had rEFIt installed and I retried some of previous failed attempts, including booting from USB, but still no effect. Finally I noticed that I had actually two boot loaders – Mac’s own Option-key triggered menu and then the rEFIt that was installed on the primary Mac OS X partition. While most of the time Mac menu didn’t show me anything besides primary partition and Recovery HD, rEFIt showed me Windows partition (sometimes two of them pointing to the same partition), but was not able to boot from them (giving different errors from EFI failures to Windows complaining that winload.exe is missing or corrupt). In the end I removed rEFIt altogether.

The Success Story

OK, enough of the failures. What ended up working was a variant of the Virtual Machine method, that used Virtual Box to make the partition bootable and then copy over the installation files to that partition. Unfortunately I can not find the original post that lead me to the idea, but it was probably somewhere in this thread.

Note: At this point I had tried multitude of setups already and I can’t be sure that all of the steps below are necessary nor that all of the required steps are listed. If you find some errors, please comment on them.

Create partition

Create a partition in some way. You can use Boot Camp Assistant to shrink existing HFS+ partition and create a FAT32 partition or you can do it yourself via Disk Utility or diskutil command line tool. I had my partition left over from one of the tries with Boot Camp Assistant and USB DVD-drive. Using Boot Camp for this step has the side effect that it gives you the option to download latest Boot Camp drivers for windows (just have a USB stick ready to store them).

Let Boot Camp Assistant download latest support software

Set up Virtual Box guest

Now eject your Boot Camp partition so that it can be remounted elewhere. (Thanks, Bill, for pointing out that I had omitted this step). I used Oracle’s excellent (and free) Virtual Box virtualization tool. To get Virtual Box to use your physical Boot Camp partition, you have to make a raw disk image that is bound to your physical disk. In my case it was the disk1 and I partition number 3 (disk1s3 as seen from Disk Utility’s Info). To create the image, change directory to some good enough place to hold the file and enter (NB! adapt to your needs):

Next, give yourself access to the physical disk and the just created image files:

Last thing is to actually set up Virtual Box Guest OS. There is nothing special there, except that you specify your * bootcamp.vmdk* as the startup disk, instead of creating new one.

Installing Windows

Install Windows to the Virtual Box guest as usual. I shut down the Virtual Box client at the “Setting up Windows for first use” step, but according to some posts (links to which I again have misplaced), you could stop even at the first reboot, though it didn’t seem to work in my case.

Now you should have a partition that is visible to the Mac Boot menu, but not a working Windows installation.

Next step is to restart the install, only this time on the real hardware. To accomplish this, mount the Boot Camp partition, delete everything and copy over all files from the installer ISO (Alo commented below that on his newer Mac Mini he did not need this step, but instead installed rEFIt to boot the new partition). NB! You probably need to have some kind of NTFS driver, either NTFS-3G (see my blog on how to get NTFS-3g working in Lion) or some commercial driver like the Paragon NTFS for Mac OS X I have installed.

After you copy over the files, reboot your Mac and hold down Option-key to access the Windows partition. Now install windows as you would if you had with optical disk attached.


Now that I have finally managed to jump through all those hoops to get Windows installed, I can only wish that Virtualization advances enough that I could play those old Call of Duty games without even rebooting into Windows. Until then, I hope to preserve my newly installed Windows. ;-)

MacBook Pro bidrive or DIY optical bay HDD Caddy


If you ever run out of disk space on your laptop you might have wondered if you could replace your Optical Disc Drive which you rarely use anymore with another HDD. Turns out that of course you can and there are plenty of manufacturers out there who sell kits to do that. One of the most famous in Mac community is the MCE Technologies OptiBay pictured right.

But I live in Estonia and of course I wanted it NOW, so I went out for a little adventure to see if I can fit one of those el cheapo Akasa N.Stor HDD to ODD cases found in local PC store.

For the imatient: yes I can.

Jätka lugemist

Ruby (on Rails) toolchest for Windows users

Setting up solid Ruby on Rails developer box based on Windows can be tedious task. More so than on other platforms, because vanilla Windows is meant for end user and lacks proper development tools that exist on other platforms. But fear not, there are many good people out there that have jumped through multitude of hoops to get different parts of the ecosystem working. All that remains is to build a solid foundation for developmer from them. Jätka lugemist

TextMate 2 New Window (via AppleScript)

Often I find myself in a situation where I need to quickly paste some text and edit it a bit. Switching to TextMate also switches spaces to my last TM session, which might not be my current space. With other programs (and TextMate 1 for that matter) this can be overcome by selecting “New file” or “New window” from dock menu.

But the problem is that TextMate 2 alpha currently does not have
“New file” option in the Dock menu. I really miss this, because of my workflow – I use spaces to manage projects and programs I have open concurrently and I don’t want to mix the TextMate windows between spaces. So opening new TM2 window in current space is a must.

But surely the developers are preoccupied with more important features and thus I decided to throw in my 2 cents and cobbled together an AppleScript that one can use to open new window in current space.


Place this script in your Applications folder and wait until Spotlight has indexed it. Then push whatever shortcut you have for Spotlight (or Alfred, if you are like me) and enter few first chars. I have found that tmn is enough to trigger this application.

Hitting enter will fire this app and a sec later new TextMate window should be opened in current space. Definitely faster than switching to TM2, hitting ⌘N and then moving the window to correct space.


▼ Download TMNewWindow



iPhoto Empty Trash

If you use iPhoto to manage your photos and you have deleted a bunch of them either because they weren’t so good or perhaps moved to other library using iPhoto Library Manager, you notice that disk space hasn’t been freed. Fear not.

iPhoto Trash

iPhoto uses its own trashcan to store deleted photos for easy retrieval. You can view the contents of trash by clicking its icon in the left pane in the Recent section.

Empty iPhoto Trash

To free your disk space of these deleted photos you have to simply empty the trashcan. To do so, just push Empty Trash button in the upper right corner if you are inside the Trash.

Or at any time select “Empty iPhoto Trash” from the iPhoto menu as seen below.

Now it prompts you with the usual confirmation:

And when you agree, it will move the photos to the Mac OS X system Trash.

Empty Trash

After the iPhoto Trash has been emptied, the files are now in system Trash and to finally free disk space, this also must be emptied. This is done as usual, by right-clicking (Ctrl-clicking) the Trashcan and selecting “Empty Trash“. Again, it will prompt you with confirmation, but this time it includes all the files in the Trash so be sure to be sure. ;-)

Safety net

As you see, freeing disk space from deleted photos can be a long walk, but after all, photos might just be our most valuable files on our computers as they are impossible to recreate.

Always make (several) backups of your photos to be sure not to loose them.

Turn Linux into a remote AirPlay speaker

Some time ago Apple game out with the AirPlay feature (an upgraded AirTunes) which enables iOS devices and iTunes play music and videos on a remote device.


In our office we have a Linux box, a set of speakers and a few laptops sporting Mac and Windows. Tonight I set out with a goal to turn that Linux box into an AirPlay speaker so that each of us can play music from their laptop without having to reconnect the cables every time.


First off I stubled upon RougeAmoeba’s Airfoil, which is a $25 sofware piece that, enables half a dozen device classes to be hooked up as remote speakers to a Mac or Windows (yes, that too). And, better yet, instead of only enabling iTunes to play, it can reroute all sound to that remote speaker. Though, it’s Linux speaker software is free download, it still seems to require paid Airfoil to route audio, because bare iTunes couldn’t care less of the wannabe Linux speaker that should have appeared to the WiFi. As the price would have been multiplied by the number of laptops, it was unfortunately out of question.


With a bit of googling around, I next found Shairport, which (if I got it correctly) is based on data found in a hacked and reverse engineered AirPort Express. ShairPort turns a random PC into a fake AirPlay speaker set. The software itself got installed relatively quickly after going through the short docs (perhaps because I had most of the dependencies like avahi etc already in place because of the Airfoil).


Also, for Airfoil, I had already opened firewall to Zeroconf/Bonjour and ports TCP:5000-5005 and UDP:6000-6005  which seemed to apply to Shairport too.

After starting up the daemon, all of our iTunes magically discovered the new remote speakers and allowed us to play music there with a simple mouse click. Even from Windows. And from iPhone. And, if wanted, all at the same time. Voila!

This is definitely much easier than messing with the wires all the time.


desopafy Wikipedia

Today Wikipedia has a blackout. This is because US is passing a law that can threaten open Internet.

Please read all about the SOPA blackout in the Wikipedia article. I have signed a petition against SOPA and I am fully concerned about what this could mean to Internet.

Wikipedia is main source of information for me and when googling around I hit Wikipedia dozens of times a day. I would not even like to think about what it would be like if Wikipedia would be blocked, because of linking to webpages that, among other things, contained some alleged pirated materials.


Now what?

Having said all this and having already put in my 2 cents, I now have work to do and this blackout is hindering my progress, even if for just one day. Fortunately Wikipedia has not removed itself from Internet. It only has drawn a black blanket over it’s contents. So, after viewing this black page and dedicating a few (milli)seconds to think about the consequences of SOPA, tech-savvy people can still reach the articles and make use of them.

NOTE: This post is not about avoiding Wikipedia blackout. This post is about getting work done, after you have signed some anti-SOPA petition or written a letter of concern to the US Senate or your own Ministry of Foreign Affairs if you live outside US.


There are several ways to still access Wikipedia today. Wikipedia itself has pointed out that mobile Wikipedia is still accessible and as the blackout is JavaScript-based, disabling JavaScript, will avoid the blackout too. But being JavaScript based, the blackout can also be reversed with JS. My initial code was a bit crude, so I googled around and found a more thorough version (thanks timraymond and kballenegger). Add this link to your bookmarks (or drag it to your bookmark bar):


This bookmarklet will hide the blackout and show the Wikipedia article. But please, do at least think of what this blackout means, before you remove it.

Gimp Resyntesize: remove unwanted objects from photos

Probably many of us have seen at least demos of using Photoshop to un-clutter your photos, resulting in almost unseemingly removed objects and restored background. While I won’t argue that Photoshop does excellent job at this, it is good to know that open-source GIMP this functionality too.

The GIMP Resynthesizer plugin makes it easy to intelligently remove unwanted objects from photos. There seems to be a 2.0 version of this plugin available at the developer’s github page (bootchk/resynthesizer), but I haven’t tried that yet.

How this plugin works has been covered number of times before, (e.g this “Content-Aware Fill” clip or this resynthesizer tutorial), so I won’t go into details of this here.

Only difference for me was that I used the Enchance > Smart remove selection... filter rather than Map > Resynthesize... and the result is displayed below.

Using GIMP Resynthesizer to remove unwanted objects Gmail style related messages

Mac OS X Lion has a ton of new features and not the least of them is the conversation view that makes it look much in like Gmail.

Still, unlike Gmail, by default shows only incoming conversation and omits sent messages, unless one presses the “Show related messages” button.

Fortunately there is a preference option to turn this on constantly.

Go to menu “Mail > Preferences > View” and check “Include related messages” box.

I wonder why this option is turned off by default?

Ruby Rack servers benchmark

Facing the question which Ruby Rack server perform best behind Nginx front-end and failing to google out any exact comparison, I decided to do a quick test myself.

The servers:

Later I tried to test UWSGI server too as it now boasts built-in RACK module, but dropped it for two reasons: (1) it required tweaking OS to raise kern.ipc.somaxconn above 128 (which none other server needed) and later Nginx’s worker_connections above 1024 too and (2) it still lagged far behind at ~ 130 req/s, so after successful concurrency of 1000 requests, I got tired of waiting for the tests to complete and gave up seeking it’s break point. Still, UWSGI is very interesting project that I will keep my eye on, mostly because of it’s Emperor and Zerg modes and ease of deployment for dynamic mass-hosting Rack apps.

As UWSGI was originally developed for Python, I wasted a bit of time trying to get it working with some simple Python framework for comparison, but probably lack of knowledge on my part was the failure of it.


The test platform consisted of:

To set up a basic testcase, I wrote a simple Rack app that responds every request with the request IP address. I dediced to output IP because this involves some Ruby code in the app, but should be rather simple still.

Tweaking the concurrency number N (see below) with resolution of 100, I found out the break point of each of the servers (when they started giving errors) and recorded the previous throughput (the one that didn’t give any errors).


The results are as follows:

  1. Unicorn – 2451 req/s @ 1500 concurrent request
  2. Thin – 2102 req/s @ 900 concurrent requests
  3. Passenger – 1549 req/s @ 400 concurrent requests

The following are screenshots from JMeter results:

Unicorn @1500 concurrent request
Thin @900 concurrent requests
Passenger @400 concurrent requests

None of these throughputs are bad, but still Unicorn and Thin beat the crap out of Passenger.


The JMeter testcase

  1. ramp up to N requests concurrently
  2. send request to the server
  3. assert that response contains IP address
  4. loop all of this 10 times

Nginx configuration:

As is only logical, having processes match the number of cores (dual HT = 4 cores) gave best results for both Thin and Unicorn (thouch the variations were small).

Unicorn configuration

Passenger requires no additional configuration and Thin was configured from command line to use 4 servers and Unix sockets, but Unicorn required a separate file (I modified Unicorn example config for my purpose):


I admit that this is extremely basic test and with better configuration much can be squeezed out from all of these servers, but this simple test surved my purpose and hopefully is of help to others too.