How to manage and restore a modern iPhone or iDevice on ubuntu with iTunes

Solution 1:

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.

Solution 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.