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.
UPDATE: Correcting the Black Screen Issue with Wine
Folks in comments have noted that recent versions of wine may render some wine applications with a black screen. I’ve only had this issue on Intel-based integrated GPUs but have found that you can work around it calling Wine commands through the excellent Lutris game manager/launcher.
I believe this somewhat has to do with the move to DXVK for handling DirecX11 calls with Wine and recent Win32/Win64 applications.
Lutris is just a useful way to launch any Wine-based application, though it’s original purpose is to support Gaming on Linux with Vulkan / DXVK.
First you’ll want to install the Lutris game manager, refer to your distribution package manager to do this on another distribution.
dnf install lutris
Setup Lutris to Launch iTunes via Wine
Now you need to associate iTunes (or anything else) with Lutris, this can be done in a few steps.
Configure Wine Options
Enable DXVK in the Wine Setting
Save and click on Add Game
Now navigate to where iTunes.exe is located and associate it as a new game.
You’ll also want to set your Wine prefix to where you store and run your Wine applications, for me this is ~/.wine
When all is done, save and you should see a launchable entry for iTunes on the Lutris main menu.
After launching iTunes by right-clicking to “Play” or simply pushing the Play button when iTunes is highlighted it should launch for you.
Workaround for Installing iTunes via Wine
Some folks have noted they cannot even use wine to install 64bit iTunes to begin with, much less use Wine to launch it. In these cases you can use Lutris to install iTunes by creating an entry just for the Win64 installer EXE.
You should just add the iTunes64Setup.exe as a normal game (name it something like itunes-setup). It should be able to pull off the install for you. Then, you can associate a permanent, real iTunes application entry in Lutris (pointing it to the installed iTunes.exe) following the screenshots above and you can safely remove the installation-only entry from the Lutris library.
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.