Showing posts with label ipod. Show all posts
Showing posts with label ipod. Show all posts

Monday, December 21, 2009

How To: Sync iPod Touch 2G using VirtualBox on a Linux Host

Well, the last couple of days have been spent setting up a virtual machine running Windows XP for my syncing needs (I usually use my PC for syncing my iPod, since it runs Windows 7, but when on the road, I will only have my netbook, and require some way to sync it). Therefore I always had the Windows XP partition on my netbook, however, I've not booted it since September, and before that I hadn't booted it for about 4 or 5 months. Since I use it so infrequently, I decided to get rid of the waste of space on my netbook and give that extra space to my media partition, my /home, my /, and possibly install a version of Ubuntu for my Full Circle Magazine articles (just to make sure my methods apply to it, etc.). At the writing of this post, the version of VirtualBox I am using is: 3.1.2-1 (virtualbox_bin PKGBUILD off the AUR). Now, according to some sources, the following step is unnecessary for this version of VirtualBox if you run HAL, but I did it and it's what I will probably continue to do. I will also skip the process of installing VirtualBox (Personal Use Binaries), simply because it varies to a large degree.

Preliminary step:
Add your user to the vboxusers group

sudo gpasswd -a $USER vboxusers

This will add your user to the vboxusers group, so that you can access virtualbox (most installations do not do this by default).

Step 1 (optional step):
Add the following to your /etc/fstab file:
none /proc/bus/usb usbfs auto,busgid=108,busmode=0775,devgid=108,devmode=0664 0 0
Since the layout cuts off the end of the above command, it ends with: "devgid=108,devmode=0664 0 0"
Ensure that you change the groupd ID (108) to whatever group ID is assigned to your vboxusers group. You can check this by issuing:
sudo grep vboxusers /etc/group
Once this is set up, you can force the usbfs to mount by issuing the following command:

sudo mount -a
For those of you who don't know, this will mount all filesystems listed in /etc/fstab.

Step 2:
Set up the guest machine. I installed Windows XP into a virtual machine using 384MB of RAM, 16 bit color, and basically the defaults for everything else (since it was running on a netbook). It's up to you what you allocate to the machine.

Once this is set up, install XP, and install iTunes. Before doing anything else, consider how you're going to store your music. I'm not a fan of copying an entire media library to a virtual machine just so I can continue updating it (and I only allocated 8GB to XP), so I decided to set up my iTunes folder as a VirtualBox shared folder. This is great for me, since I have a separate media partition (of about 70GB) with my Music, Movies, Pictures (and some backups) on an NTFS partition for access between the now dead XP install and any install of Linux I may have. Since this is the case, I created a virtualbox share for /media/Media/Music/iTunes/iTunes Music/ (your path will be different). To do this, install Guest Additions, and go to Devices --> Shared Folders. Set up the Folder and make sure you check the box next to "Make Permanent".
Now, in your XP host, right-click My Computer and choose "map network drive". The server is //vboxsvr/sharename (in my case, iTunes, but it will be whatever you chose previously). I mapped this drive to Z:, simply because I will never use that drive letter and so don't have to worry about any changes. Now on the guest machine, open iTunes, accept the license agreement, and head to the preferences (Edit --> Preferences), then open the "Advanced" tab and change the Music Folder to the Z: drive (or whatever letter you chose), and delete the original entry. This means that is should use the shared folder for any new music, podcasts, videos, etc. (I haven't tested that yet though). Once that's done, you need to add all the media to your iTunes.
This can be done by going to File --> Add Folder to Library, and choosing the iTunes Music folder (only if you have used the iTunes 9 way of organizing music, otherwise you may want to choose the parent directory to your podcasts, videos, etc.). Once the import is done (it can take a while), authorize the computer for any iTunes Store accounts you have, and plug your iPod in.

Step 3:
Syncing the iPod. Once you plug your iPod in, the Linux host will take control of it (which is fine). If you installed the guest additions and rebooted the guest OS, you should be able to go to Devices --> USB Devices --> iPod, and choose it. Give it a moment, and XP should inform you it found a new device (iPod), and begin installing the drivers for it. Once this happens, let it install and wait until it appears in your iTunes window. It will then warn you (if it's set to auto-sync), that some purchases are from another iTunes Library, whereupon you want to choose "transfer to PC" (or words to that effect), so that the purchases are synced to the iTunes folder. Once complete, your iPod should sync without a problem and you should be happier with all that free space.

If you want to update the music on iTunes, you should just import the CD/mp3s to the computer, and copy them to either the "automatically add to iTunes" folder, or add them to the correct folder in the Music sub-directory. iTunes may or may not automatically register/add the files (I haven't tested this yet either), but adding it manually is still less work than rebooting and doing it all there then copying it over to Linux. You can also import the CDs via iTunes in virtualbox and see if the CD will be ripped straight into the shared folder.

Hopefully this is interesting to anyone who was thinking of doing the same. I am quite happy (and surprised) to find that this solution works for me, even on my Samsung N110 netbook (1.6GHz intel atom, 2GB of RAM, 160GB hdd, intel 945GME), and frees up some space (about 50GB, since that's what I had left allocated to Windows). The best thing is I can create a backup of the hard disk, and save all my work, or use snapshots (or both). I know that you can probably sync the iPod to some degree in Linux natively, but I prefer having access to the podcasts I subscribe to (revision3 shows and engadget mostly) via iTunes even on the go.

For those who're curious about my partition layout on my netbook, it's as follows:
3GB Recovery Partition (Samsung)
68.36GB for Media
74.68GB Extended partition
  • 15.01GB /dev/sda5 (my arch root partition)
  • 24.44GB /dev/sda6(my arch /home)
  • 964.81MB /dev/sda7 (my swap partition, that I probably don't need).
  • 34.30GB of as-of-yet unallocated space (will probably become a 15GB Ubuntu /, and 14 GB Ubuntu /home, as to protect my theme settings and custom tweaks to Arch)

Friday, December 4, 2009

Apple does it again...

Well, Apple has managed to take senselessness to a new level. I found out today (after deciding I wanted to write a lockscreen application to display a to do list on my iPod touch instead of paying for an application that does something similar) that Apple offers an SDK for Mac OS X only! This raises the question: Why offer iPod/iPhone support for Windows, if you don't plan on letting people develop from that same OS? There is no way I will ever pay for an iMac, Mac Mini, or macbook for the sole reason of developing an application for an iPod. I prefer Linux over Mac OS X, and I prefer Windows 7 over Mac OS X, and I simply dislike Apple's policies about keeping their source closed and the restrictions they place on the user. I can understand, to some degree, WHY Apple does this for Mac OS X, since they need their main income to come from the laptops, but I can simply not understand why you would snub perfectly good developers simply because they don't own a mac machine. If I can't get my iPod to do what I want, I will most likely stop using it for anything but media playback (if that, since I have a SanDisk eSansa 260 lying around somewhere), and will go out and find myself some open-source mobile internet device that allows me to configure it like I want (or actually talk myself into paying for a phone contract with a Droid or something).

Apple: if you want to keep your customers, you have to make your customers happy. This is generally accepted as a good business plan. This doesn't just mean making nice looking devices with "lots of features", but also giving developers the ability to develop for the device, regardless of what OS they run. Heck, if anything, it'll prompt more people to illegally install OSX86 or virtualize Leopard (against the EULA) in order to develop for an iPod/iPhone. I'd probably even be tempted to consider this, if I had enough of an urge to develop for the iPod, but I don't. I just want to tweak one little thing on my lockscreen so that I can view the contents of a to do list file without unlocking the iPod and opening the file, and I can't even do that.

I'm not going to make ranting like this a habit on the website, but I felt that this needed to be said, and I couldn't find any kind of contact email for the dev portion of apple's site, where I could offer my opinion. Oh, and while I'm on about Apple fails, their Black Friday rebate offer came out to something like 13€ off an iPod. If the device costs 180€, the least you can do when offering a rebate is to take 10% off the price! (Excuse me if the numbers are incorrect, I'm going by memory here, but either way, the sentiment stays the same. If you want to offer a rebate, make it one worth considering.)

Anyways, to anyone who reads this: Enjoy your weekend, and, if looking for a new smartphone, do take a look at some of the new Android devices (or the HTC HD2) before looking at an iPhone. What I find Apple does is try to gain the title of "best" and thereby prejudice people into thinking everything else is terrible, which isn't the case. If I were a betting man, I'd say the Android phones will stay up-to-date longer, as there are tons of community developers working on apps and fixes and updates, whereas Apple's iPod is locked in by the restrictions they themselves put on it. Chances are good that Android can outlast iPhoneOS by staying recent and modern, while making good use of the hardware without overtaxing the system (and by running more than one application at a time!). If you want to see how fast Android development is, just compare the T-Mobile G1 with the Motorola Droid (Milestone for us European folks).

Tuesday, February 3, 2009

That itch to disassemble is back!

Well, on Sunday I was sitting at home and this urge came over me to take something apart (it's been a while since that happened, used to be too busy to do so), and all I really had on-hand that I hadn't yet taken apart and re-assembled was my old, broken iPod Mini (broken in the sense that the battery holds roughly 5 seconds of charge). First I had to heat the glue at the top and bottom with a hair dryer, then I pried them off (using a thin screwdriver and my fingernail to bend the side away), unhook the bottom metal plate (held in place using tension in the tags), disconnected the click-wheel, unscrewed it from the top metal plate, and pushed it out. I even took pictures!
Quick note: the parts were lying on a Lufthansa clipboard, thus the funny colors.

Another slightly off-topic note. The article for Full Circle Magazine I wrote (Command & Conquer, filling in for Robert Clipsham) was released in issue 21 yesterday: http://fullcirclemagazine.org/2009/02/02/full-circle-21-out-now-finally/