Sunday, September 27, 2009

Working VNC: AppleTV 2.3, aTV Flash 3.4.1, iPhone 2.2 (5G77)

For the benefit of other users looking for a way to use Firefox on the AppleTV without the need for an external keyboard and mouse, just your iPhone, just follow these steps. Be warned, though, you *will* need to ssh into your AppleTV and enter some commands at the command line / terminal...

1. Download the original AppleTV v1 recovery disk image from the net. This will be named OS-dot-DMG 1.0.dmg, so try http://www.google.co.uk/search?q=OS-dot-DMG%201.0.dmg.

2. Once you have that .dmg, use your favourite SFTP/FTP software to copy it over into the home directory (i.e. / when logged in by SFTP).

3. Now start Terminal.app on your Mac and "ssh frontrow@appletv.local" (or on Windows do whatever you normally do to ssh to your AppleTV). Your password is probably "frontrow".

4. In your root directory, an "ls" command should reveal the "OS-dot-DMG 1.0.dmg" file you copied there in step 2. If not, go sort that out.

5. Enter the following command. This will mount the recovery .dmg on your AppleTV. No damage is done to other mounted disks, so don't panic :-)

sudo hdiutil mount OS-dot-DMG\ 1.0.dmg

6. Now we need to copy some files from the recovery volume to our actual AppleTV. Be careful to get the backslashes right in each command. None of these commands should generate any output, so if they do you have made a mistake :-)

sudo cp -pr /Volumes/OSBoot\ 1/System/Library/CoreServices/RemoteManagement/ /System/Library/CoreServices/RemoteManagement
sudo cp -pr /Volumes/OSBoot\ 1/System/Library/Perl/ /System/Library/Perl/
sudo cp -pr /System/Library/Perl/Extras/5.8.6/ /System/Library/Perl/5.8.6/

7. Now the RemoteManagement infrastructure is installed, we need to setup a remote login password. Again, this command should not generate any output:

echo 71463E00FFDAAA95FF1C39567390ADCA > /Library/Preferences/com.apple.VNCSettings.txt

8. Now we need to configure some further remote login settings. None of these commands should generate any output either:

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -clientopts -setvnclegacy -vnclegacy yes
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -users frontrow -privs -all -restart -agent -menu

9. Finally we need to start the actual VNC server process. We put an ampersand (&) at the end to keep the process running the background after we're log out:

/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/MacOS/AppleVNCServer &

10. You don't even need to reboot at this stage. Just start up a VNC client and connect to your AppleTV's local IP address (or appletv.local from a Mac) and it should connect. If you get a connection failure, try again a couple of times. If it still continues to fail to connect, double check the steps above and repeat if necessary.

11. On connection you will probably get a corrupted version of the AppleTV menu (or similar). This is expected; you don't need to be able to see the AppleTV video output on your iPhone, you just need to be able to get mouse and keyboard events from your phone to the AppleTV...

12. So now run up Firefox, for example, on your AppleTV (instructions for installing Firefox are elsewhere on this site, though I note that the latest aTV Flash 3.3.5 supports installation via the Maintenance menu. You should find that with your iPhone connected via VNC to the AppleTV, you can move the mouse around the screen, click on things, enter text - do everything you would normally do with a browser, in fact. Except that this is on your home TV. Amazing. Now why haven't Apple implemented this?!?

Just for completeness, these were the versions I used:

Hardware:

AppleTV Take Two at firmware version 2.2, hacked with aTV Flash v3.3.5
1st Generation iPhone 2G running firmware version 2.1, hacked to bits with PwnageTool

Software:

Jaadu VNC v1.2 (the best VNC app in the iTunes AppStore; maybe try the Jaadu Lite version first...)
Firefox v3.03
Panic Transmit 3.5.4 for SFTP
MacOS X 10.5.5 versions of Terminal.app and ssh

No comments:

Post a Comment