
This article will tell you how to update iOS and data on it for Linux users. On this topic, you can google both the manuals and the problems that have arisen:
But this information is very fragmented. And it does not contain some subtleties, without considering which you can lose data on the phone (again, these articles do not tell what data and in what case you can lose). And in a place with the data - and a bunch of nerves. All this can make new Linux users no longer use it to work with iOS.
')
This manual is a step-by-step instruction for happy updating iOS through Linux using VirtualBox without losing data.
Further narration was tested on a bunch:
- Ubuntu (12.10)
- iPhone4 (iOS 5.0.1 up to iOS 6.0.1)
- VirtualBox 4.2.6 (with Windows 7 x32 installed).
Although, for sure the same will be true for the iPad.
Attention,
under the cut a lot of pictures!Step 1. Configure VirtualBox
After installing
VirtualBox, we need to configure it correctly. The first thing we do is make friends with a virtual USB 2.0. This is necessary for proper recognition and correct operation of the virtual machine with the iPhone. To do this, download and install the VirtualBox Extension Pack from
this page .
Check that it is established. Go to
File-> Settings . Must see something like:

Do not forget to check that the current user (under which you are logged in to Linux) is included in the
vboxusers group:
$ groups shanker shanker : shanker adm cdrom sudo dip plugdev lpadmin sambashare vboxusers
If not, add a user. For example, this is how I added myself:
sudo gpasswd --add shanker vboxusers
Adding USB filters
We will need the next step to automatically mount the iPhone into a virtual machine. First, I will say why it is needed. The fact is that in the process of updating the iPhone several times reconnects via USB, with different VID and PID. Because of this, the mounted iPhone does not automatically cling to the virtual machine and starts opening in Ubuntu. If you keep your computer updated all the time you update the iPhone and keep a close eye on the process, you have about a minute to fix everything: just hook it to the iPhone virtual
device via
Device-> USB Device .
And if you do not have time ... you can watch this picture:

or this one:

But on the device itself, this may appear:
Moreover, the device does not want to turn off the shutdown button (even if it is well kept for a very long time). Saves the retention of 2 buttons: off and Home buttons.
Select the created virtual machine, go to
Configure-> USB and create a new filter. In the
Manufacturer box, type
Apple Inc. .

After creating this filter, the iPhone after the reconnection will cling to the virtual machine again.
Creating a shared folder
In the process of synchronizing the device with the virtual machine and saving backups on the device itself, the virtual machine begins to swell exorbitantly. Moreover, at VirtualBox I found one unpleasant feature. If the disk space with virtualku ends - the config file is beating. This makes
it impossible to return to the saved state until you have fixed the config file . And it can be very difficult to do. Those. there is such a twofold feeling: you realize that you have not lost the data. But to return to the state with this data is not so simple.
So, go to
Configure-> Shared Folders , select the folder on Ubuntu where the data from the iPhone will be saved. Specify the auto connection in the parameters and allow the virtual server full access to the folder:

Step 2. Configure the Windows 7 virtual machine
I will not describe the installation of iTunes. I mean the reader knows this. If not, Google will tell you easily. Let's better think about this. Do you want to constantly copy device data from a virtual machine to it after synchronization to the shared folder we created manually, each time it is updated and synchronized? Think hard! Feel like laziness appears, which makes you say: “No, I don't want to! Never!". Here and my laziness is in solidarity with yours. And if so, let's automate it. Fortunately, this is done obscenely easy! Create a symbolic link to the shared folder created just above. Run the command line from the administrator and enter the command:
mklink /D %appdata%\"Apple Computer" "your_share_folder"
Here
your_share_folder is the path from the
virtual machine to your shared folder with it. I have a Z drive.
It is advisable to do this procedure BEFORE installing it in the iTunes virtual machine. Otherwise, the
Apple Computer folder will already be created in the system and you will have to copy its contents, delete the folder itself and paste the contents into the created symbolic link.
Step 3. Backup and sync your iPhone
Well, now is the time to do what we all did. Connect your iPhone to your computer. Make sure the virtual machine has picked it up automatically. Back up and synchronize data. Make sure that this data falls into a shared folder. The backups will be in the public folder in the
MobileSync \ Backup directory. Now go ahead with installing new software on your iPhone and updating iOS.
When and what data can be lost
Since I didn’t immediately wise up, but filled my cones on my forehead before I understood what to do and how, then the punishment touched me and I lost some data. Now I can share with readers when this can happen and what data will be lost, and which data will be saved.
I made a backup. At the same time I
did not sync the iPhone with the virtual. Since I
didn’t add USB filters and didn’t have the opportunity to reconnect the iPhone in time , then I saw all those scary pictures that I quoted above. Here I confess to the reader that I put these pictures on the Internet. As you can guess, I was not experiencing a very good psychological state at that time, and I had no desire to make any screenshots.

The natural CPU has loaded 100% of my two hemispheric cores in one process: “how to save data on the phone ????”
my_mind$ top PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2325 shanker 20 0 1382m 467m 43m R 200 12,6 28:26.58 how_restore_my_data_on_iPhone?
Trying to rectify the situation, I connected my iPhone with a new VID and PID. iTunes saw it and gave me another message, without adding optimism on an already spoiled day:

There was nothing to do, and I agreed. As a result, iOS was updated in 20 minutes and I was asked to restore some data. And the list showed exactly the backup I made before updating the system.

Well, I agreed. The process has begun ... It lasted all night. By the morning my data was restored. What have I restored? It will be easier to say what I lost: all the music, sound files downloaded for installation on calls and the arrival of SMS and applications with their data (in Yandex cards there were 3 GB of cards downloaded). I did not notice any more losses. Everything else was untouched:
- Contact lists
- SMS
- Photos and videos taken on camera
- Notes
- Reminders
- Wireless Settings
Moreover, if I understand everything correctly, then
even if you forgot to make a backup before updating iOS, iTunes will still do it . And in
order not to lose data - do not forget to synchronize them with the virtual machine.PS In this tutorial, I did not touch the issue of synchronization of contacts. Contacts are synchronized in WAB (Windows Address Book) and with the specified configuration steps, I believe, will remain in the virtual machine, and not on the shared folder in Ubuntu.