Use Apple’s USB SuperDrive with Linux

I’m really surprised and disappointed that Apple prevents us from using their USB SuperDrive with non Apple devices.

How to outsmart Apple’s firmware

Fortunately, with a little hack, we can awake the drive from its deep slumber. It’s required to send a “magic” byte sequence after the drive was connected. Thanks to “A Random Hacker” for figuring this out.

You have several options for making this work. In this post I’d like to unveil two of them.

Unlock with SCSI Generic (sg) driver

For communicating with the SCSI device directly we need the Linux SCSI Generic (sg) driver packages.

Lookup the device, it should be sr0 or sr1 by default depending on how many USB disc drives are currently attached. Check the output of following command to get a list off all device paths:

After you’ve the SuperDrive identified, we’ll send the magic sequence to the device.

Try to insert a disc, the drive should be awake now and start initialising the disc. For now the last step is necessary each time the drive is unplugged, so let’s automate it!

Custom udev rule

We’ll make us of the udev device manager. It runs as a deamon and receives events each time a device is initialised or removed. Furthermore, it features an extensible rule set for easy customising. Please check out this very good guide for further instructions.

Let’s write such a custom rule.

Add following rule definition.

This will do the “magic” each time a SuperDrive device is connected. To test the rule, disconnect the drive and connect it again, the drive should be unlocked, already.

Unlock with Superdrive-Enabler

Superdrive-Enabler is a little app that sends the magic byte sequence to a device.

Superdrive-Enabler for Raspberry Pi

I precompiled a binary for the Raspberry Pi in cases where you can’t or don’t want to install “sg3-utils”. Make sure that SuperDrive is connected via an active USB hub to the Pi. Copy the executable binary to your Raspberry with SMB or WGET.

Other distributions

Easily compile the superdrive-enabler source.

Custom udev rule

Let’s write a custom rule in a new *.rules file or separated by a line break in an existing rules file.

Add following rule definition.

This will trigger the “superdriveEnabler” app with the device path as parameter (e.g /dev/sr0) each time a SuperDrive device is connected. Reconnect the drive again and enjoy your CD/DVD collection with XBMC or any other media player!

42 thoughts on “Use Apple’s USB SuperDrive with Linux

  1. Hi
    thanks for the post, everything work smoothly, but for some reason i can’t get the automation to work, so i don’t have to type a command every time i connect the Superdrive, i opened the nano, save the file that was shown, but when i disconnected it and connected it again it didn’t work, i’m sure i’m missing a step here, could you please help me?

  2. Your solutions work wonderfully on Ubuntu GNOME 15.04, thank you! However, on my system, if I suspend the system with a disc in the drive, upon waking the system I have two instances of the drive in Nautilus. One can be ejected, the other cannot. Restarting the computer fixes the error.

  3. Everything in went smooth, but the problem I have is that it wont actually play a dvd. Any help would be appreciated.

    1. Did you try VLC as a media player? It works in most cases and brings it’s dependencies nicely when installed via package manager.

      1. I used this patch to get my Apple drive to work and I use VLC to play the disks. It’s al working together nicely. Thanks for the hack.

  4. Distribution: Ubuntu 15.04

    I needed a slightly modified udev rule (according to error messages and udev(7)):

    ACTION==”add”, ATTRS{idProduct}==”1500″, ATTRS{idVendor}==”05ac”, DRIVERS==”usb”, RUN{program}=”/usr/bin/sg_raw /dev/$kernel EA 00 00 00 00 00 01″

    One has to restart udev.service after adding the rule, of course.

    But your post showed me the right way to go, thanks for that.

  5. Thanks for the instructions! I followed the SCSI generic drivers instructions which work on Ubuntu 15.04.

    The only feedback I can provide is:
    – When creating the udev rule I initially didn’t notice that there is more text after DRIVERS==”usb” because it wasn’t visible in the text box. It might just be me, but perhaps it would be worth turning on the line-wrap for the text box by default?
    – The udev rule initially didn’t work for me. I tried to restart udev with “sudo restart udev”, which I got from another udev related post, but got the following error message “restart: unable to connect to upstart: failed to connect to socket /com/ubuntu/upstart: connection refused”. In the end, restarting the PC sorted it out. The superdrive now works automatically, even if you unplug and plug it back in while the PC is on.

    1. You’re welcome, glad it worked for you.
      I set the code box to always show the toolbar, which offer to copy and add line wrap. This should make life easier.
      Regards Chris

  6. Its worked but I format and empty my fedora 20 drive to install fedora 22.when its booting goes to emergency mode and he tells that the magic number perevet the boot.how can i remove the magic number from my rooted drive?

  7. I can’t recommend using the Superdrive-Enabler on the pi—using a 2011 Superdrive with an Pi 2 running Arch Linux sporadically browned out the system and induced an infinite reboot cycle that corrupted some disk-related system services (and locked up the Superdrive).

    Make sure you provide a high enough voltage to the USB in your OS config, and if your drive locks up it can be unlocked by rebooting your mac while the Superdrive is plugged in.

  8. I tried this and it did see /dev/sr0, but when I run
    “sg_raw /dev/sr0 EA 00 00 00 00 00 01”, that doesn’t seem to do anything. I put in the disc, and it doesn’t take it. Makes a very light clicking sound if I try to force it in. Still no luck.

  9. Hello I am really curious to try this out, however one question I have is will this affect my superdrive so i will no longer be able to use it on a mac or does this just make it compatable to use the USB superdrive on the Ubuntu with the ability of still using it on the mac.

    1. This won’t affect your superdrive since we don’t change anything on its firmware. We just send a command (magic byte sequence) to it each time it’s connected to the usb port to unlock it for non Apple devices

  10. Fabulous! Well done and thanks for sharing. Shame on Apple! What were they thinking?!?!? Maybe they confused it with a mobile phone, haha!

  11. Brilliant. Works great on Gentoo. Thanks for posting. Minus 1 (-1) to Apple…I’m trying to figure how what the Apple Product Manager was thinking when writing the requirement for the magic sequence…crazy.

  12. Hello, I have a Raspberry Pi Modem B+ with (2014-12-24-wheezy-raspbian) image, and got a ‘stated’ Superdrive for Apple from eBay http://www.ebay.com/itm/321534635491?_trksid=p2059210.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT after reading this post (and well done on this!) and plugged the USB DVD into one of the USB sockets and there is no /dev/sr0 (no /dev/s* either), so sq_raw command with not find the drive. I have opened the case and the drive was made in 2005. I am thinking that it may not be genuine. Is there more things I can do to find out want is happening? Thank you.

    1. Hi, regardings the eBay auction, this drive is not capable of writing DVD’s, therefore I doubt that it is genuine. But this shouldn’t matter for this purpose maybe it isn’t even necessary to send the magic byte sequence to activate it. Did you test it with another machine? Macbook for example? Did you connect it directly to the Rpi? You will most likely an active usb hub to spin the drive since the Rpi B+ does only deliver 600 mA.
      Regards Chris

      1. It needed a powered USB HUB, thanks for mention that, was something that I forgot to think about. First test on Raspberry Pi B+ after installing mplayer, played like it should. Thanks again, I am pleased that was solved.

  13. Hallo
    nach langer Suche endlich die richtige Hilfe gefunden. Vielen Dank!
    Ich habe mich gerade von Os X auf Linux Mint bzw. Elementary OS umgestellt und in beiden Distributionen läufts jetzt. Prima!

  14. Chris,

    Thanks for this super useful guide. I switched from a Mac to Ubuntu and didn’t want to buy a new DVD RW unit 😉 Your tip did the trick (works for me on Ubuntu 14.04)

  15. Thanks Chris

    I am on Oracle Linux 64 bit (6.3) and for someone looking to install SG, they can just yum it (sg3_utils is the package name), provided yum is configured to use the public Oracle yum repository.

  16. Nice! I’m relatively new to linux and had just installed Ubuntu in one of my laptops that didnt have an ODD. Had a spare superdrive lying around and tested this. Worked perfectly! Thanks.

  17. Thanks for this, it is very useful. It is needed not only on non-Apple devices but even on MacBook Airs running Linux.

    Your custom udev rule works fine on Fedora too, btw.

Leave a Reply

Your email address will not be published. Required fields are marked *