10

This question—how to install iTunes on ubuntu—has been asked many times before on this site, but the answers are all outdated and involve Wine or some other tool that no longer works for the most recent version of iTunes. Put simply, I need to regularly back up and occasionally restore the firmware on an iPhone 6.

I cannot:

  • dual boot Windows—for some reason installing one OS makes the other unbootable & after days of headache & dozens of reinstalls I’ve decided to just leave Ubuntu be & not try to preserve Windows. Plus “just use Windows” is not really a solution on an Ubuntu forum.

  • use libimobiledevice-dev. libimobiledevice-dev doesn’t let you manage iOS updates or sync music anymore.

  • Buy another phone. This one should be obvious but for some reason some asshat always comments “too bad lmao shouldntve bought an iphone ;P”.

5
  • 1
    A fourth option would be to run Windows in a virtual machine. I agree that "just use Windows" is not a great option on an Ubuntu forum, but the iPhone is a completely proprietary, locked-down device that's a contantly-moving target, and the open-source tools to work with it on any platform are few and far between. Jul 10, 2016 at 15:26
  • 1
    I figured the answer would involve a virtual machine. I have oracle virtual box installed & one of Microsoft’s Edge virtual machines but I havenːt gotten a chance to install it. Will it let iTunes restore the device? Criticism of the iPhone, while technically correct, overlooks the sheer-facts-on-the-ground that Apple holds an unbreakable monopoly due to iMessage. Too many FOSS commentators ignore this important fact. Jul 10, 2016 at 15:28
  • 1
    Yes, you should be able to configure Virtualbox to give the virtual machine access to your computer's USB ports, if it doesn't already. Then you should be able to use iTunes or whatever just as you would on Windows. Jul 10, 2016 at 15:29
  • are the instructions at help.ubuntu.com/community/PortableDevices/iPhone/… still valid? also it says you cannot restore the device is that still true? Jul 10, 2016 at 15:31
  • I don't know -- I've never even used an iPhone (other than borrowing a friend's for a quick phone call) :D Jul 10, 2016 at 15:32

3 Answers 3

10

Okay, I have gotten this to work, and have successfully restored an iPhone 6 on Ubuntu 16.04. Posting my steps here as I’m sure there are plenty of ubuntu users like me who would enjoy knowing there is a (relatively) easy way to get iTunes working without having to borrow a Windows computer from a relative.

1. Install VirtualBox

Install VirtualBox from virtualbox.org; pick the one that’s labeled for Linux hosts, since we are installing a virtual Windows on Linux (Linux is the host). Other virtualization apps may work too but I didn’t test them.

2. Download a Windows Virtual Machine image

Go to developer.microsoft.com and download a Microsoft Edge virtual machine. It’s free. Make sure the platform matches the virtualization software you are using (VirtualBox). The one I used was the Win 10 Stable version, but the others probably work too. Note that these images are very large (~4.7 GB) and can take a while to download.

3. Extract the .ova image

Extract the downloaded .zip to get the MSEdge - Win10TH2.ova file. The file is large, and it takes a while to extract, but on my computer Archive Manager was able to unzip it just fine.

4. Import the .ova image

Double click the .ova file; Ubuntu should automatically open it in VirtualBox. Let VirtualBox import the .ova, all of the default settings are fine except for the Virtual Disk Image file setting, which should be changed from .../VirtualBox VMs/MSEdge - Win10TH2_1/MSEdge - Win10TH2-disk1.vmdk to .../VirtualBox VMs/MSEdge - Win10TH2_1/MSEdge - Win10TH2-disk1.vdi (the file extension is changed from vmdk to vdi. This is important for the next step, increasing the virtual hard disk size.

5. Increase the virtual hard disk size

This is probably one of the more unexpected things you have to do to make iPhone backups and restores work properly. The default virtual hard disk size VirtualBox allots the virtual Windows 10 is simply not big enough to store most iPhone backups, which will cause them to fail. Fix this by navigating to your Windows VM directory (probably:

cd VirtualBox\ VMs/MSEdge\ -\ Win10TH2 

and running this command:

VBoxManage modifyhd MSEdge\ -\ Win10TH2-disk1.vdi --resize 128000

The number 128000 represent the size, in MB, that you’re resizing the disk to. 128 GB is probably enough to hold two or three iOS backups.

6. Increase the Windows partition size

Just upping the disk size isn’t enough to make iTunes aware it has more space to use. You have to use the Windows diskmgmt.msc command (in the ‘start menu’ or whatever Microsoft calls it these days) to open up the Disk Management tool. Then right click on the blue “Windows 10 (C:)” partition and select Extend Volume. By default it will expand the partition to fill the entire 128 GB.

7. Install iTunes

This step is pretty simple, just install iTunes on your virtual machine the same way you would install iTunes on any regular Windows computer.

8. Enable USB visibility

Your virtual iTunes won’t be able to see your iPhone because USB is disabled by default. First you need to turn off the virtual machine (if it’s running), and install the USB extension pack from VirtualBox; it’s labeled VirtualBox 5.0.24 Oracle VM VirtualBox Extension Pack.

Note that the information at https://help.ubuntu.com/community/PortableDevices/iPhone/iTunesVirtualBox is very out of date. I followed all of the steps but I’m not sure this is really necessary. If you do, do not perform step 4 (adding the line none /proc/bus/usb usbfs devgid=123,devmode=664 0 0 to etc/fstab), this will cause a black screen of death on your Ubuntu installation. Fortunately, if this does occur to you, you can always use the Emergency mode command line to navigate back to fstab/etc (cd .. ; cd etc) and use nano (nano fstab) to remove the offending line.

Next go to the Settings editor in the VirtualBox Manager, and go to the USB tab. Check the Enable USB Controller box, and pick USB 2.0 (EHCI) from the choices. (If it’s grayed out, remember to turn off the virtual machine.) Then add an empty USB filter (blue circle) to the USB Device Filters list. Do not select a specific filter (green plus sign) like “Apple Inc. iPhone”, because that filter will fail to detect an iPhone in Recovery Mode, whereas the null filter will.

9. Congratulations! You’re done!

You can now use iTunes with your iPhone on your Virtual Machine completely normally. You can even back up, update, and restore the iOS firmware.

5
  • To run virtual machine, you need to have a computer that is powerful enough first.
    – tomchiukc
    Aug 16, 2016 at 13:57
  • How can this be an accepted answer? These are the steps to emulate windows on Ubuntu. Not an "Ubuntuy" answer.
    – markroxor
    Oct 31, 2017 at 8:42
  • @markroxor unfortunately it is the only way until Apple releases a version of iTunes compatible with Linux? Oct 31, 2017 at 20:24
  • How do you deal with the VMs having a 90 day expiry?
    – raphael
    Mar 29, 2020 at 18:12
  • important: you have to be in the vboxusers group for VirtualBox to be able to capture the device
    – L. Levrel
    Jan 21, 2023 at 21:58
2

(Old i5, 4GB RAM, CentOS 7, VirtualBox 5.1.22 with extension pack)

I used the method to restore/update an iPad. It worked fine but was even simpler:

  • Windows 7 virtual machines are much lighter than Windows 10. W7 by default sets 512MB for RAM while W10 sets 4GB. W10 wouldn't even boot. I set 1.6GB RAM for W7 and it worked seamlessly.
  • No need to change extension from vmdk to vdi nor to resize it.
  • VirtualBox extension pack is a must to enable USB 2.0. Remember that to 'plug' the device in the virtual USB port one has to select it in 'Devices>USB' when virtual Windows is running.
  • Just selecting the iPad which shows up under 'Devices>USB' as 'Apple ...' worked fine for me. Once or twice during restore/update it 'disconnected' but selecting it again was enough to resume process.

One other thing I forgot: Windows 7 virtual machine is 32-bit so download iTunes 32-bit for it.

1

! Important ! Do NOT follow any of the commands used to install the extensions pack in step 8: Enabling USB visibility. Just double-click the extensions pack (after having VirtualBox installed and the pack downloaded) then click "install" and enter the sudo password. This makes VirtualBox itself install the pack so you can't accidentially mess it up.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .