Enable SSH Without Opening the Apple TV

From AwkwardTV

Contents

Parts Needed

MD5SUM: 280323d8700e4cfef15116f7e50590e3 boot.efi
(got it from the recovery image Zuo)

licensed copy of os x for intel

usb hub w/ external power

Instructions

THE METHOD DESCRIBED BELOW ASSUMES THE USB DRIVE OR IPOD YOU ARE INSTALLING TO IS EMPTY AND HAS NO DATA THAT YOU CARE ABOUT. PLEASE USE CAUTION

Step 1

Install full Mac OS X onto the device, using semthex's kernel and instructions detailed here: Apple TV Hacks - Mac OS X running on Apple TV. If you want to avoid having to use a keyboard and mouse through a USB hub later, boot up the installation before you change the kernel and activate SSH and/or Remote Desktop/VNC server in the Sharing preference pane.

If you're installing to a small device you'll want to read the instructions for a minimal install Here.

Step 2

Modify the AppleFileSystemDriver, add this text to the file /System/Library/Extensions/AppleFileSystemDriver.kext/Contents/Info.plist in the IOPropertyMatch array section. This can be done easily in the Finder with the TextEdit application.

Very special thanks to Turbo for this patch. If you skip this step then OSX won't boot and will complain that it is waiting for the root device

Step 3

Now we are going to change the partition info to that of a recovery system. This requires the use of the Terminal application. It is imperative that you ensure you are working with the proper disk. If you have only one internal hard disk in your system and the disk you want to modify is your only external disk, then it will likely be identified as /dev/disk1. To make sure, type diskutil list at the command prompt to see all disks attached to your system.

Then, assuming /dev/disk1 is the correct disk, using the command sudo gpt show /dev/disk1 should get results such as these:

Step 4

Remove the drive from your Mac and connect it to the Apple TV. If you didn't activate SSH or Remote Desktop/VNC, use a USB hub so you can also connect a keyboard and mouse. Reboot the Apple TV by pressing and holding the 'menu' and '-' buttons simultaneously on the Apple remote until the reboot occurs. If you activated SSH and Remote Desktop/VNC, just log in when the Apple TV is done booting.

The ATV OS is on the partition labled 'OSBoot'. Instructions for enabling SSH are located here. I used appletv-install.sh to copy the necessary files (gdb will probably fail, that is ok you can ignore it). Be sure to enable ssh on your Mac OS X install before you run this script so that it copies the ssh.plist file that has sshd enabled and not disabled.

The below is redundant, apparently you can also use mount_hfs to mount your partition, but I have documented success using the below method also - MrZ

If you mess up and want to mount your "repair" partition again, you can just reverse the steps, but change