Using the Zune HD in Linux

Contrary to a lot of advice on the Internet, the Zune HD can be used in Linux. Support has been integrated into libmtp for the mtpz protocol thanks to some awesome work by Sajid Anwar.

libmtp however, does not and will not contain the encryption keys required, so it will seem like the Zune isn’t recognised. Running mtp-detect on the command line gives

shane@ratbert:~$ mtp-detect
Unable to open ~/.mtpz-data for reading, MTPZ disabled.libmtp version: 1.1.6

Listing raw device(s)
Device 0 (VID=045e and PID=063e) is a Microsoft Zune HD.
Found 1 device(s):
Microsoft: Zune HD (045e:063e) @ bus 1, dev 6

It’s simple to get this to work however.

Just create a file in your home directory called .mtpz-data and add to it the following string of numbers. This is the encryption key needed to interface with the Zune.

Encryption Key

Now, run mtp-detect and you should see the encrypted handshake take place, gmtp, Clementine, Rhythmbox and any media player that supports mtp should now be able to copy music to and from the Zune HD.


Add yours →

  1. Thank you!!! 🙂

  2. Awesome! Sajid Anwar is my new hero, I’ve been wanting this for years!

    And thank you for the keys as well 🙂

  3. I’m having trouble figuring out how to integrate mtpz with libmtp. I downloaded the mtpz zip from github but I’m not sure what to do with it. Could you explain it to me or point me toward a guide? Thank you.

  4. This method is not really working for me. After the encryption key is in place, I open Clementine and see my ZuneHD in unmounted state. I double click on it, and get an option to ‘open device’. Clementine asks me to ‘connect’ the device, because this is the first time I would be using it, and then it keeps syncing at 0% forever and ever. Tried with Ubuntu 13.10 and Xubuntu 14.04. Any suggestions?

    • It seems like I am getting an error caused by the well known Libgcrypt bug. When I look at syslog, I see this:

      “clementine: Libgcrypt warning: missing initialization – please fix the application”

      • No suggestions I’m afraid, I haven’t used this in a while, so the instructions may be out of date. Did you fix your problem and I can add how you did it to the blog post?

        • Unfortunately, no. I have found similar errors in a few other places, like libpam, for example, but no clue where it is coming from.

          • You’ve tried other applications like Rhythmbox I assume? It’s odd, because it sounds like the mtp handshake is happening ok, but there’s something else going on. Does mtp-detect seem to carry out the handshake and all that correctly?

  5. Maybe I am missing something but this does not do anything for me. While Ubuntu can identify my Zune as a Zune, there is no adding songs to it in Rhythmbox nor can I access any files through Nautilus. Am I missing something here? I created an empty file, titled it as direct in your post, copy and pasted the encryption key, then dumped it in my Home folder.

    • Hi there,

      Unfortunately I don’t have my Zune (it’s back at home in another country) at the moment, so I can’t test things out again, but this should still work. Are you sure the file is named .mtpz-data and nothing else? What happens when you run the mtp-detect command after you’ve made the file?


      • Here is the bulk of it, the rest was device info:

        libmtp version: 1.1.6

        Listing raw device(s)
        Device 0 (VID=045e and PID=063e) is a Microsoft Zune HD.
        Found 1 device(s):
        Microsoft: Zune HD (045e:063e) @ bus 2, dev 5
        Attempting to connect device(s)
        ignoring libusb_claim_interface() = -6PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
        LIBMTP libusb: Attempt to reset device
        MTPZ device detected. Authenticating…
        (MTPZ) Setting session initiator info.
        (MTPZ) Resetting handshake.
        (MTPZ) Sending application certificate message.
        (MTPZ) Getting and validating handshake response.
        (MTPZ) Sending confirmation message.
        (MTPZ) Opening secure sync session.
        (MTPZ) Successfully authenticated with device.
        Error 2: PTP Layer error 02ff: get_all_metadata_fast(): could not get proplist of all objects.
        Error 2: Error 02ff: PTP: I/O error
        Error 2: PTP Layer error 02ff: get_handles_recursively(): could not get object handles.
        Error 2: Error 02ff: PTP: I/O erro

  6. Very cool. This is the first time I’ve seen the handshake key be broken open for Zune HD. I wonder how much longer until plugins for Winamp / Musicbee / etc start cropping up, or could they not use the same handshake?

    • It seems like this would be possible, however there just doesn’t seem to be the interest or demand to do it, unless you would like to take up the baton. From a technical point of view there’s no reason that this shouldn’t work. The key is there to be used.

  7. im not sure how you write the encryption to a file. im admittedly still new to linux

  8. I couldn’t make it work on Linux Mint. Just says ‘unable to mount location’ when I try to open it file-manager.
    mtp-detect finds it as Device 0, but then says ‘failed to open session….’ after a few seconds of trying.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.