Running Debian on AppleTV

I decided to install the latest Debian to my old AppleTV in order to use it as a server in the house. It has 160GB hard drive, 256MB RAM and a 1GHz processor. I think it could work well for NAS and VPN.

I pulled the drive out of the AppleTV and hooked it up to my mac with a USB to IDE converter cable (All of this work is done on the Mac running Ubuntu under VMWare). It would be a little easier simply having a Linux machine handy. Then we wouldn’t have to deal with the virtual machine and host OS fighting for the USB devices. Anyway, you just need that AppleTV drive plugged into a Linux host to do these commands:

I used this method to prepare the drive:
http://code.google.com/p/atv-bootloader/wiki/PartitioningLinux

Then booted up a Debian installer with VMWare, and installed Debian to partition #4 on the drive with partition #5 as swap. Do NOT install GRUB to the MBR, the recovery files that are placed in the two AppleTV partitions will search for menu.lst and boot that grub. You may need to install (create) menu.lst by hand, especially if your particular distro uses GRUB2 like the latest version of Debian does.

Here is a copy of the /boot/grub/menu.lst which I created by hand:
[bash]
default 0
title DebianTV
root (hd0,3)
kernel /boot/vmlinuz-2.6.26-2-686 root=/dev/hda4 ro quiet processor.max_cstate=2
initrd /boot/initrd.img-2.6.26-2-686
boot
[/bash]

After the OS install is finished, I sync and remove the drive from my Linux machine. Put the drive back in the AppleTV and booted it up. The AppleTV should boot straight to linux.


Posted

in

by

Tags:

Comments

11 responses to “Running Debian on AppleTV”

  1. Albert Avatar
    Albert

    Hi Chris,

    Thanks for the tips!

    Is the USB port working in Debian?

    Cheers

    1. Chris Carey Avatar

      Yes and no. I got the USB port to accept a hard drive, but the hard drive comes up as /dev/hda when my root drive also comes up as /dev/hda. This did not kill the machine but I was not able to get the drive mounted due to this sda vs hda issue. During boot the drive thinks its /dev/sda and after boot its /dev/hda or vice versa. I have put the box in the garage for now so I can’t look. but long story short, it was halfway working but never fully got a remote drive mounted on that USB port under linux

  2. Dennis Avatar
    Dennis

    I’ve been able to setup the drive partitions and then install debian to sda4 from vmware. I even got the /boot/grub/menu.1st file but it aways seems to boot to the penbuntu. did you install grub to the first partition or the 4th with the root? Did you make any changes to the OSboot or recovery partitions? I think I am missing a step somewhere.

  3. Cosmo Avatar
    Cosmo

    Just put 10.5 on it and call it good

  4. cobra2 Avatar

    To get around the HDA/SDA issue, you need to install the OS to an external HD and force the appletv to boot from that. I’ve got 5x 1TB external drives hooked up via a 7port powered USB hub. I had to dd the OS install to the beginning of each EXTERNAL drive but NOT the internal drive. I then added all the seperate partitions to /etc/fstab via UUID. This allowed me to not have to worry about which drive booted up first.
    I created a script to run on a reboot that runs dd to copy the root partition across all the external drives.

    I use the atv as a local webserver for testing, NFS shares, mpd server, and seedbox for my torrents. I don’t have X installed or mess with any of that gui crap.
    It runs Slackware-current.

  5. Ipguy Avatar
    Ipguy

    Is it possible to install Debian or Ubuntu on the Applt TV 2?

    1. Chris Carey Avatar

      Not that I’m aware of.. yet. It’s like an iPad without the screen.

  6. emb3dd3d Avatar
    emb3dd3d

    I just used the above links and installed Centos6 desktop to an apple tv… I just wanted to see what it would look like. It appeared to work fine, I was able to log into the desktop. I was using the hdmi cable and never tried the rca jacks or optical connection. Now I am updating to Centos 6.2 and turning off gdm so i can just use it as a server with a dmz dropbox. It was a fun project that I will use in restricted production.

    Great instructions…

    Greets!

  7. Terry Avatar
    Terry

    I am trying to install Linux on a Apple TV ver 1, it’s sole purpose is to run a single web browser page displaying an actively updated web page.

    No need for any other applications. Hardware required are a keyboard, mouse and the built in WiFi. Will this distribution work?

    The website is Active911.com used by my volenteer fire department. It displays firefighters responding to a alert.

    Since the old PC bit the dust, I had this old AppleTv collecting more dust, so I want to put it to use if possible.

    Thanks
    Terry

    1. Chris Carey Avatar

      Modding the AppleTV 1 to run Debian Linux is a cool hack but completely impractical, especially in 2016. It is very underpowered, wastes a lot of energy (feel the top when it’s powered on), and painful to set up and keep up to date. It would be much better use of your time and money to buy a Raspberry Pi 3 to serve this purpose. It can run Linux with a web browser perfectly right out of the box once you get the WiFi set up. You should be able to do so for less than $50, and lots of support and tutorials to get you going.

      1. Terry Avatar
        Terry

        Chris,
        Thanks for the suggestion. That is exactly what did. I purchased a Raspberry Pi 3 and I had it up and running in minutes. I was trying to use old existing hardware, even under powered it would have been enough. But I was wasting way too much energy on that configuration. I just opted for the low cost of a Raspberry Pi.

Leave a Reply

Your email address will not be published. Required fields are marked *