VMWare + iTunes + iPhone + Ubuntu Linux = awesome

slaniel | Ubuntu; VMWare; iTunes | Thursday, September 4th, 2008

With the help of my inestimable friend mrz, I have gotten iTunes to sync properly with an iPhone from within Linux. It works flawlessly. Here’s what I did:

  • Install VMWare Workstation 6.x. I tried with 5.x and had not much luck. In fact I believe when I first installed VMWare on this laptop, I had installed VMWare Server. I had even tried the variant of VMWare Server which uses a web GUI; I cannot testify strongly enough against it. Moral: go with Workstation 6.x. (Thanks to mrz for making this crucial suggestion. Its value is even more apparent later in our story.)
  • Create a new VMWare Windows XP image. I chose an 8-gig image, for no particular reason. (And in fact, now that I have everything running properly, I’ll see if I can knock that down. I have about 3.7 gigs left, and can’t imagine using any more than a gig of that.)
  • Install Windows XP. I paid something like $50 for a copy direct from the Microsoft store, courtesy of a close friend who will remain nameless.
  • Install all your various Windows service packs by going to the Start menu, then Run, then typing iexplore http://windowsupdate.microsoft.com/. There may be other ways to do this, but that one has always been surefire for me. Keep doing this, along with the necessary restarts, until you have no more updates left to install.
  • Install VMWare Tools into the image. This is under the “VM” menu.
  • Install iTunes into the image.
  • Within VMWare Tools, turn on Shared Folders. This allows you to share a chunk of the filesystem from the host OS (in this case Ubuntu) with the guest OS (Windows). I used this so that I wouldn’t have to copy MP3s that are already available in Linux into Windows. The shared-folders feature is only available under Workstation, so far as I know.
  • Here’s the cool part: even though Linux doesn’t really know what to do with the iPhone, VMWare can dig it. This seriously impressed me. Normally when I plug in the iPhone, Ubuntu recognizes the phone’s camera and asks me if I want to open it in F-Spot, but doesn’t do anything with the iPod component or the various installed apps. But lsusb tells me that I have an iPhone: it says Bus 005 Device 002: ID 05ac:1292 Apple Computer, Inc., and lsusb -v dumps out 303 lines of information; clearly it knows that something’s up. It’s just that Ubuntu doesn’t know how to make use of that information.

    Fortunately VMWare does. Under the “VM” menu, then “Removable Devices”, then “USB Devices”, we have “Apple iPhone (EHCI Port 1)”. Select that item. Voilà: the iPhone has now been passed through to Windows. Windows recognizes the device, the same way it would recognize any USB device that you plug into a USB port. Give Windows some time to load the appropriate drivers. Then launch iTunes. After a few moments, you should see an iPhone in your leftmost pane.

  • Now you want iTunes to see the files from your shared folders. Go to the VM menu, then Settings, then Options, then Shared Folders. Select “Always Enabled”, because why not. Add a folder with some descriptive name (like “MP3s”) pointing to a path on the host OS (here Linux). I would select “Read-only”, but I don’t know whether iTunes needs to write into my MP3 directory.

    Here I ran into some problems, which may or may not have had to do with various quirks of my particular install. I had to use a little hack to make Windows see a host called \.host. (You put an entry in the lmhosts file which manually specifies that .host == localhost.) I also had to reinstall the VMWare Tools, per a somewhat unrelated knowledge base entry. Without these two steps, there was no .host machine, hence no shared folders available within VMWare. With those steps taken care of, I mapped a drive letter to my MP3 collection. You can do this any number of ways: net use f: \.hostShared Folders at the command line (Start → Run → cmd) will work, as will My Network Places → Tools → Map Network Drive.

And there we go: you now have a VMWare instance from which you can run iTunes under Linux — and possibly from any other VMWare host OS.

…Huh. Looking at it just now, it appears that my Workstation install never expires. How does that work? I was actually more than willing to pay $50 just now to register this thing. Man. Thanks, VMWare!

9 Comments

  1. “Go to the VM menu, then Settings, then Options, then Shared Folders. Select “Always Enabled”, because why not.”

    Because if your Windows installation gets hacked or gets a nasty cough, cold, or other virus, it can wipe out the shared folder.

    “I would select “Read-only”, but I don’t know whether iTunes needs to write into my MP3 directory.”

    iTunes does indeed need to write to you MP3 directory, if for no other reason than to apply ID3 tags (if you use them). If your MP3 directory is also your iTunes Music folder, iTunes will also need to store (i.e. write) preferences there.

    I hope that info is useful. Otherwise, wish I had been the one to suggest VMWare. I use virtual OSes all the time and they are UNBELIEVABLY useful. Just wish I didn’t HAVE to.

    J

    Comment by Jeremy — September 4, 2008 @ 9:03 pm

  2. VirtualBox from Sun also does shared filesystems for guest OSes. I’ve been using Ubuntu on my laptop for about 18 months now, and while I still have an XP partition, I haven’t booted to it in the six months since I installed VB.

    However, as far as recommendations go, VMWare WS and VB are basically equivalent, so there’s no compelling reason to switch if you’ve got a working VMWare install.

    Comment by Tony Bartling — September 4, 2008 @ 9:47 pm

  3. FWIW, I was similarly able to mount my iPod with Windows XP as the host and Ubuntu Linux as the guest OS running in VMWare. I was able to use the free minimal version of VMWare and it all worked fine.

    Comment by Adam Rosi-Kessel — September 5, 2008 @ 9:52 am

  4. The free minimal version would be the VMWare Player, right?

    Shared Folders are reason enough to use Workstation; otherwise you need to copy MP3s into the image.

    I’d be curious also whether you see the performance boost that I saw when I switched to Workstation.

    Comment by Steve Laniel — September 5, 2008 @ 9:58 am

  5. Right, VMWare Player. It was fine for my purposes. I’m not a serial virtualizer.

    Comment by Adam Rosi-Kessel — September 5, 2008 @ 11:41 am

  6. The shared folders in workstation are indeed nice, but if you want to be a cheapy, you could just export the MP3 directory via samba and access them from the XP image that way.

    Comment by mrz — September 5, 2008 @ 12:44 pm

  7. Wish it would sync on VirtualBox.

    zeddock@gmail.com

    Comment by zeddock — September 10, 2008 @ 1:52 am

  8. I am wondering how your performance is with Windows XP as the guest OS. I have Kubuntu and am using VMWare Player. The performance is pretty bad. Music is choppy and videos are rough in iTunes. I may need to upgrade my system’s memory from 1 GB to 2 GB. Also, do you have coverflow working in your VMWare image?

    Comment by Kevin — September 11, 2008 @ 6:32 am

  9. Hi Kevin,

    XP performance has been quite terrific. It’s been a while since I’ve used the Player, but I do recall noticing a significant performance boost when I switched from Server to Workstation. My Ubuntu laptop has a gig of RAM; I’ve allocated 256 megs to the XP VMWare instance.

    As for Cover Flow: I don’t believe it’s enabled, because the virtual video card doesn’t support Direct3D. Such, at least, is what I gather from Apple and VMWare. I followed the directions in the second link, but it didn’t work. I could probably get it to work if I poked around a bit more, but I don’t have time just at the moment.

    Comment by Steve Laniel — September 11, 2008 @ 7:48 am

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Bad Behavior has blocked 679 access attempts in the last 7 days.