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. I got this byte sequence from a source I no longer can find on the web. So, I don’t take credits for it.

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!

65 comments

  • AtBios  

    Thanks for this tip! Now my super-drive starts and I can put in a DVD, however, it keeps ejecting it after a few seconds so it never really accepts my DVDs. Has anyone else had this problem? Im on Ubuntu Budgie 18.04.

  • Pingback: MacBook Air SuperDrive on Linux – Thoughts of a sysadmin

  • Mike  

    Greatly appreciated, perfect on Mint 19.1. Eject done simply from icon on Files.

  • Sergey Samoylov  

    Thank you! Worked like magic. And to the guy, who suggested installing eject command.

  • Hari  

    Thank you so much for this awesome fix. It worked like a charm and allows me to use the superdrive on my ancient MacBook whose internal DVD-Rw drive had stopped working ages ago. I recently resurrected this computer with Linux Mint and your post helped me get the superdive also going.

    Hari

  • Andreas  

    Hi Christian,
    thank you very much for this useful guidance! I’ve just installed Xubuntu 18.04. on my 8 years old MacBook Air (late 2010). Now even the superdrive works! I’m very happy 🙂

    Andreas

  • Pingback: Porting Game Code to Plan9 (9front) – 9front (Plan9) Programmer's Notebook

  • luisgulo  

    PERFECT !
    Thanks !!!!

  • Korhan Tınaztepe  

    Hi there, many thanks for the explanation of the magic packet to wake Apple Superdrive up and running. I now have connected my Superdrive to my RPi 3B. The Raspberry Pi 3B/3B+ can provide total 1.2A current on its USB ports, so there is no need for a powered USB hub, just connect the Superdrive directly to RPi 3B/3B+. For RPi 2, you still need the power hub, it can only supply 0.5A current on USB ports. While installing sg3-utils, think about installing another packet called “eject” it is used such as “eject /dev/sr0” which will eject the disc from Superdrive. What I use is simply:
    sudo mkdir /mnt/superdrive
    sg_raw /dev/sr0 EA 00 00 00 00 00 01
    sudo mount -t iso9660 /dev/sr0 /mnt/superdrive

    and when done

    sudo umount /mnt/superdrive
    eject /dev/sr0

    Works like a charm!

    • onmomo  

      Glad it helped, thx for your snippets!

  • Cosmin  

    Many thanks for this solution! Exactly four years after your post, working very well on a Ubuntu 17.04 machine!

    • onmomo  

      Thanks, glad that it still works!

    • onmomo  

      Amazing, thanks for letting me know.

  • Martin  

    Hi Christian,

    Thanks, this gets the DVD player up and running. But neither Video nor VLC can play the movie. Is there more that I need to do at my end, or is it a DVD issue? The one I’m trying this with is “Insurgent”.

    Thanks,

    • onmomo  

      Not that I’d know of. Did you try with kodi?

  • Pingback: Sluit je Apple SuperDrive aan op je Raspberry Pi | Frits Bosschert

  • Nathan Sinclair  

    Hello, im new to this, having had a spare superdrive lying around. I’m having some troubles with it… not working with audio cds, or regular dvds, but im trying to get copy-protected dvds to work.

    I run a raspberry pi 3+ and just bought a usb hub to power the drive. I’ve got the mpeg 2 decoder key for my pi. When it is plugged in, shows up, dmesg shows that it’s sr0 and sg0, however putting a disc in doesn’t show up on df -h. In fact, continuously starting the disc as soon as i put it in. Obviously i think this is a power issue, however i wanted to be certain. It is not mounting whatsoever.

  • Marc  

    Thank you so much! Still working!

  • David  

    Really cant belive this still works! Thought apple might of patched it already.

  • Mathieu  

    Still works in 2017 thanks!

  • Pingback: How to use a Superdrive with Linux | Serious Piffle

  • Faeng  

    You rock! This hack works perfectly so far.

  • MGH  

    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?

  • elshi  

    Viele Grüße aus Bayern und vielen vielen Dank für die Lösung!

  • zeze  

    Hey, I think your site might be having browser compatibility issues.
    When I look at your blog site in Safari, it looks fine but when opening in Internet
    Explorer, it has some overlapping. I just wanted to give you
    a quick heads up! Other then that, fantastic blog!

  • J.D.  

    Thank you! This was very helpful! 🙂

  • MBGM  

    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.

  • Barry Schwartz  

    Works fine on Gentoo with eudev instead of udev, but of course it does. 🙂

  • Ubuntix  

    Hi Christian,

    am I allowed to use your blog entry on my own blog with a link to your site?

    ” …many thanks to Christian Moser who solved it for us!”
    would be the comments and redirect to you.

    Cheers

    Ubuntix

    • onmomo  

      Hi, sure just go ahead. 🙂

      Regards Chris

  • L00DeR  

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

    • onmomo  

      This is hard to tell most likely you need some special packages/libs for playing dvd on Linux systems. I’m able to playback dvd on xbmc with my superdrive.
      Regards

      • Abe West  

        Hi onmomo, can’t make it work on my libreelec kodi on RPi3. Seems that I can’t apt-get the sg driver package (and any other package). Any tips on how to get the Mac Superdrive working on libreelec?

    • Lukas  

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

      • tom  

        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.

  • Rafael Xavier de Souza  

    Bravo!! Love Apple hw, but Linux as OS. This has been really helpful to me. Thanks

  • Olaf  

    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.

  • snert  

    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.

    • onmomo  

      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

      • snert  

        That’s great. And thanks again!

  • Manuchehr  

    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?

  • Adifex  

    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.

    • Adifex  

      tldr; active USB hub is needed.

  • Dev  

    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.

    • onmomo  

      Does the drive have enough power?

  • nepo  

    Thanks alot, works well under Linux Mint 17.1 Rebecca!

  • Harrison  

    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.

    • onmomo  

      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

  • Adam  

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

  • Rob Hines  

    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.

  • Joe Fidler  

    Very helpful – worked perfectly on OpenSUSE 13.2. Thanks for the tips!

  • William George  

    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.

    • onmomo  

      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

      • William George  

        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.

  • Brian  

    Worked perfectly on Debian Jesse! Thanks for this.

  • Gerhard Roocks  

    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!

  • Felix Faassen  

    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)

  • kiwigander  

    Thank you Christian, you have just solved a frustrating problem!

    (MacBook Air 4,2; Linux Mint 17 Qiana)

  • soumik  

    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.

  • Eric  

    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.

  • wienerwuerstchen  

    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 *

© 2010 - 2015 Christian Moser - All data and information provided on this site is for informational purposes only. The techtalk blog or the author makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this site & will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use. All information is provided on an as-is basis.