Today at work (I started writing this the same day, but it took a bit longer then I thought to finish), we needed to test a new calendar feature with the various devices our sales reps use. Android was easy, the entire IT staff have android phones, and most even have an android tablet. iPhone is another matter, no one had an apple device we could test on. Luckily we happened to have a few old iPhone 3 in our storage closet from when we switched phone carriers a few years ago. Unluckily, they were using an old iOS version and no longer activated. Activation and upgrading require iTunes, which runs on Windows, but I sadly run a linux machine. For windows only tasks I run a virtual Windows XP machine in VirtualBox.
VirtualBox can pass USB devices from the host machine to the virtual machine, but doing so requires an extension package. You can download the extension file from Oracle’s website, but there are several versions available. I use VirtualBox v4.1.12. The website says that the 4.1.xxx extension package only works with version 4.1.xxx but it installed properly on my system anyways. You can install extensions from the Preferences panel under File > Preferences (Or Ctrl+G).
Once you have the extension installed, plug in your iPhone. Next, open up the settings panel for your virtual machine and go to the USB tab. Enable the USB controller. You also need to add a new filter for the iPhone. The USB filter will connect the iPhone to the virtual device for you automatically when it is connected. Now we can close the panel and start the virtual machine.
With the virtual machine running you can install iTunes and open it up, the iPhone should connect like it would on a physical machine. Once it has finished setting itself up, iTunes should offer any available updates to iOS, let it start the update. About half way through, the update will fail, this is because the iPhone has rebooted into recovery mode, which changes the USB identification. We need to go back to the settings panel and add the recovery mode iPhone to the USB filters.
Once that is done, we can manually connect the recovery mode iPhone to the virtual machine to reconnect the iPhone to the virtual machine. This is done by right clicking the USB button at the bottom right of the Virtual Machine and selecting the iPhone from the list. Once this is done iTunes will recognize the troubled iPhone and ask if you want to reset and update it.
At this point iTunes should be able to complete the update. As the iPhone shifts between normal and recovery mode, VirtualBox will use the filters you set earlier to automatically connect the device to the virtual machine, just like if it was a physical box. Once this is done you can remove the USB filters, or leave them as is so you can continue to use iTunes to load music and the like to your iPhone.