Run iTunes on Linux via Wine

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.

 

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

winecfg

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

Change this:

load-module module-udev-detect

To this:

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.

About Will Foster

hobo devop/sysadmin, all-around nice guy.
This entry was posted in open source, sysadmin and tagged , , , , , , . Bookmark the permalink.

2 Responses to Run iTunes on Linux via Wine

  1. Ben England says:

    Thanks for letting me run iTunes on Linux for the very first time. However, when I brought up a browser while music was playing, itunes audio output started getting really scratchy and intermittent, almost like an old AM radio. I had to restart iTunes. Doesn’t inspire a lot of confidence in Wine. Why Windows Version = Windows 7? That is ancient, pre-dates XP doesn’t it?

    Like

    • Will Foster says:

      Hey @Ben, Windows 7 (released in 2009) was a few versions after Windows XP. Did you try switching to direct sound in the iTunes application (guide was updated with screenshots) that fixed it for me. In Wine generally setting Windows 7 works for just about everything as XP is so old some applications complain about it.

      Also on Fedora 28 I noticed that PulseAudio now uses a time-based scheduler, on my older desktop it had issues with scratchiness on some applications outside of iTunes so I changed my /etc/pulse/default.pa (see post I just updated it).

      Like

Have a Squat, Leave a Reply ..

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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