Recent versions of Wine can run iTunes and Apple Music for Linux with no wizardry required. Having been given a free Apple Music subscription as part of a family plan it’s useful to have additional streaming media options. Below are the steps to use iTunes on Linux via Wine and have access to iTunes and Apple Music.
Ensure you have wine installed (>=3.10). On Fedora 28 this is the current version as of typing this. Earlier versions of Wine do not work so well but 3.10 seems ok.
dnf install wine winetricks
Configure OS Inside Wine Config
Next run the winecfg command and configure your operating system to Windows 7.
Download iTunes for Windows 64bit
Next you’re going to download the Windows iTunes installer.
Run the Installer with Wine
Next you’re going to run the installer with wine and walk through all the confirmation steps. I opted to not install a desktop icon so I have no idea what that will do.
You can either run wine against the .exe file or right-click and run it from your file manager.
After everything is installed you should see iTunes available in the application menu of your desktop environment. Go ahead and run it.
Application Settings and Sound
From here you can safely log into iTunes with your Apple ID and everything should work.
Fix: Scratch Sounds in iTunes
If you experience scratchy sounds go into iTunes preferences and change the playback device to Direct Sound and restart the application.
Fix: Static and Crackling in Fedora 28+ in General
Recent Linux distributions using PulseAudio have changed to a time-based scheduler in stead of interrupt-driven. This may cause static and popping on older hardware. I noticed after upgrading to Fedora 28 that I started hearing crackling in the headset, I was able to fix this by editing /etc/pulse/default.pa
load-module module-udev-detect tsched=0
Then restart PulseAudio as your normal user:
pulseaudio -k pulseaudio --start
Note that some applications may need to be restarted on Linux to take effect but this solved all the general scratchiness issues I had in general (mumble, bluejeans, etc).
Syncing Devices and Music Library
I have not gotten an iPhone detected and synced through iTunes running via Wine, I tried briefly to pass-through an iPhone via the USB dev device but but didn’t spend too much time on it. Winecfg has the ability to map “drives” which correspond to hardware storage devices on the system.
[81085.354682] usb 2-3.2: Product: iPhone [81085.354684] usb 2-3.2: Manufacturer: Apple Inc
If anyone has any luck here please post in the comments.
You do have access to your music library and can sync previous purchases down locally but I haven’t used this much past occasionally using the Apple Music streaming.
Better Media and Streaming Options
Apple Music is good for playing specific artists or songs but I prefer other solutions for streaming (that mixes together related music based on an artist).
iTunes as just a media player is like using WinAmp with DRM and playlist functionality. It is just really not a good media player when there are so many native choices like Amarok or Rhythmbox available for the Linux desktop. If you’ve already curated an extensive iTunes library or playlist then running it in Linux may be useful for you.
For streaming I think Pithos is hard to beat, it serves as a front-end to Pandora and also doesn’t stop or display ads when I’ve used it. I do not have a Pandora subscription. It supports using an HTTP proxy like tinyproxy to stream through a remote host avoiding country restrictions if you are travelling. I include Apple music in my choice sometimes just to have variety.