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)

Thursday, December 17, 2009

View Revision3 shows on your Xbox 360 Via TVersity

Recently I purchased an xbox360 for games + videos (HD playback). After setting up my HDMI to DVI cable to my monitor and the standard TV cable to my speakers, I started trying to figure out how to stream my media (matroska backups of most of my DVDs) to my xbox, I stumbled upon TVersity, which is a free (well, there is a free version) Media streaming server. In order to set it up, I had to do the following:
  1. Remove all my old codecs (mainly just DivX codecs for me).
  2. Install Combined Community Codec Pack
  3. Download and install TVersity. Ensure that you do not install the TVersity codec pack.
  4. Once TVersity is installed, you have to change the following settings:
  • Set Media Playback Device to Xbox360 (optional)
  • Ensure that the "automatically start media server" box is checked.
  • Under transcoder settings, change: transcode: "when needed"; change the maximum video resolution to the largest possible video you'll stream; Change "Windows Media Encoder" to Version 9; Optimize quality; Change WLAN to LAN (if you are on a LAN)
Once you've changed these settings, if you go to your xbox360, and go to the System Settings, and run a network connection test for PCs, and let it wait until it discovers the TVersity server on the PC. If it doesn't work the first time, ensure that your firewall and router allow connections on the port specified in the general settings of TVersity. Once the server is recognized, you're ready to start adding Revision3 shows to your media library on TVersity.

The way I do it, is to head to "RSS and Podcast Feeds" choose "Video Feeds", and use the rss feed of the specific show I want (if you're on the revision3 page for the show, it's listed as "Episode RSS Feed"). Choose the quality/type of video feed you'd like from the list, and copy the URL into a new item in the TVersity rss feeds window. You might want to add tags or titles to the feeds (I just used the names of the shows), in order to keep track of what was there.

Once you've added the feeds, let them sync up (might take a few minutes), and then restart the MediaServer (might not be necessary, but I was required to do it before my xbox could find the feeds). Once that's complete, go to your Videos Library on the xbox, choose the TVersity server on your computer, and head down to "RSS & Podcasts", and choose the show you want to watch. You're then greeted with an unsorted (I can't get it to be sorted by date, but it's probably possible) list of the episodes. If you know which one you want, you can sort by title to find it easier. Choose the video you want to play, and install any new updates (I needed an update for my xbox for mpeg4 HD videos), then sit back and enjoy your show!

Tuesday, December 8, 2009

More Google Wave Invites!

*Update* Google Wave was released to the public, thereby making this thread obsolete.

I got another bunch of invites to send out. In total I have 17 invites to give out. Same deal as the last time. First come, first serve, leave your email address in a comment with an "invite please" (or something like that), and I'll add you. Invites can take some time to be sent out, but it seems to be going quicker these days. Either way, I suggest you don't wait for it, just let it surprise you.

6 of 17 invites remaining.

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