Use Apple’s USB SuperDrive with Linux

Posted byChristian Moser Posted on30. March 2014 Comments93

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 full credits for this.

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.

# Debian
sudo apt-get install sg3-utils

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:

ls /dev

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

# Do magic...
sg_raw /dev/sr0 EA 00 00 00 00 00 01

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.

# Debian
sudo nano /etc/udev/rules.d/99-local.rules

Add following rule definition.

# Initialise Apple SuperDrive
ACTION=="add", ATTRS{idProduct}=="1500", ATTRS{idVendor}=="05ac", DRIVERS=="usb", RUN+="/usr/bin/sg_raw /dev/$kernel EA 00 00 00 00 00 01"

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.

# download binary
wget https://github.com/onmomo/superdrive-enabler/raw/master/dist/rpi/superdriveEnabler_rpi
# make binary executable
chmod +x superdriveEnabler_rpi

Other distributions

Easily compile the superdrive-enabler source.

# Download the source from my github repository
wget https://raw.githubusercontent.com/onmomo/superdrive-enabler/master/src/superdriveEnabler.c
# compile it
gcc -o superdriveEnabler superdriveEnabler.c
# Make it executable
chmod +x superdriveEnabler

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.

# Debian
sudo nano /etc/udev/rules.d/99-local.rules

Add following rule definition.

# Initialise Apple SuperDrive with superdrive-enabler
# Make sure that you adjust the path to the superdriveEnabler on your system
ACTION=="add", ATTRS{idProduct}=="1500", ATTRS{idVendor}=="05ac", DRIVERS=="usb", RUN+="/home/pi/superdrive-enabler/superdriveEnabler /dev/$kernel"

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!

Category

93 People reacted on this

  1. 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.

  2. 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

  3. 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

  4. 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!

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

  6. 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,

  7. 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.

  8. 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?

  9. 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!

  10. 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.

  11. 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

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

    1. 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

      1. 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?

    2. 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.

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

  14. 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.

  15. 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

  16. 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?

  17. 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.

  18. 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.

  19. 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

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

  21. 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.

  22. 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.

  23. 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!

  24. 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)

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

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

  26. 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.

  27. 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.

  28. 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.

Comments are closed.