Saturday, November 13, 2010

Add Boxee to Startup

System->Preferences->Startup Applications Click Add, name it Boxee, and type
/opt/boxee/run-boxee-desktop
into the command field.

Boxee for Ubuntu Maverick 10.10

Shit wouldn't install using
sudo dpkg -i boxee.deb
I had to run this deb file from the graphical UI.

Friday, November 12, 2010

Installing Ubuntu Server on an Acer Revo R1600

This is turning out to be harder than I thought.
First I tried the new 64-bit Ubuntu Server 10.10 image. I used the method described on the download page, using the Universal USB Installer from pendrivelinux.com. Beware their ads; the download link is a standard text link just past the page break. FUCK Registry Mechanic.
Anyway, the UUI makes my USB drive bootable, and my Revo boots to it without problems (just press F12 at POST to choose the boot device). The installer starts, but fails during the expansion of the installer components. The progress stops around 20% and the error message says it couldn't find a file on the installation media. I thought I got a bad copy, so I tried a few more times. Then with a few more drives. Same shit. I'm using the torrent version and forced a recheck on the torrent during this, so I can't imagine that the image is bad.
Whatever, I'll try the 10.4 edition. It's going to be a HTPC, so I don't plan on using anything but the software front-end anyway.
I used the same method to write the 64-bit 10.4 Server image to the USB drive. This time, the installer starts but the display is using a bad resolution/refresh rate. I tried to change the video mode boot option (F6 at the first installer screen) using these vga codes, but just got different bad resolutions my monitor wouldn't display correctly. So I deleted all the boot options except initrd and the installer starts just fine... but doesn't mount the drive. When I mount the drive with
mount -t vfat /dev/sdb1 /cdrom
it still doesn't read the media. Guess I took out too many options after all.
So I reboot and just delete the vga=788 option. It starts and finds the media, but stops at 15% file copy...it seems stuck at copying firewire-core-modules-2.6.32-24-di. What the fuck.
While I was reimaging my drive with UNetBootin, I looked up how to set up a PXE boot server. Of all the shit I've set up and all the varied OS installs I've done, this is one I never got working, or had the right patience for, until now. The guide I found, as usual, was outdated and didn't work.
So here's what did work:
I'm using a Windows 7 desktop with a Ubuntu Linux server to set up the Revo. So these instructions are for Linux, and I'm using putty to SSH into the server and get this done.
1. Install bootp and tftp-hpa:
sudo apt-get install bootp tftp-hpa
bootp is a program that will respond to the PXE client call and hand it the right information to get a file from a server, and boot using that file. Some router firmware, like DD-WRT, provide a configurable bootp server. I'm not using one of those at the moment, so I'm using my Linux server for both functions.
tftp-hpa is an ftp-like service that provides basic file read-access over a network without authentication, which is exactly what you want in this kind of setup (less configuration).
2. Configure bootp:
sudo nano /etc/bootptab
and add this to the end of the file:
client:\
ha="01:23:45:67:89:AB":\
ip=192.168.0.13:\
gw=192.168.0.1:\
sm=255.255.255.0:\
td=/: hd=/: bf=pxelinux.0
Yes, including all the backslashes.
"client" can be changed to your destination client's hostname.
"ha" is the hardware address, or MAC address, of the client you want to PXE boot. Easiest way to find it is to try to PXE boot the client. It will display the MAC address of the NIC it's trying to PXE boot.
"ip" is the IP address of the client machine. I have this client set to a static DHCP address in my router already, but I don't know how much it matters since the bootp program should be identifying the machine with the MAC address. I imagine these IP settings are for using bootp as an initial or basic DHCP server. Either way, put something here.
"gw" is the gateway address of the client machine. As in your router.
"sm" is the subnet mask. Almost always 255.255.255.0.
"td" is the path to the PXE boot file, relative to the root of the tftp directory. "/" is just the root, which is what I'm using.
"hd" is another directory you can add on to "td" to get to the PXE file. I dunno, "/" works for me.
"bf" is the boot file. For Ubuntu (probably all Linux) it's pxelinux.0. This would be different for Windows, like ntldr or something. I'll get to that another day.
3. Now, bootp doesn't come with a daemon and the script I found was for an older Ubuntu. However, I don't plan on using this all the time. So run this:
sudo screen bootpd -d 4 -c /var/lib/tftpboot
This will run the bootpd program in another screen with a -d parameter I'm ignoring and a -c parameter for the absolute tftp path. I'm not sure how to implement this with separate bootp and tftp servers. Welp.
4. Edit the tftpd-hpa configuration:
sudo nano /etc/default/tftpd-hpa
Make it look like this:
#Defaults for tftpd-hpa
RUN_DAEMON="yes"
OPTIONS="-l -s /var/lib/tftpboot"
This has the same directory, /var/lib/tftpboot, that bootpd is using. Good.
5. Get the netboot files:
Here's where I found them: http://archive.ubuntu.com/ubuntu/dists/maverick/main/installer-amd64/current/images/netboot/. The file you want is netboot.tar.gz. You can obviously edit the first link for the current/desired dist and architecture.
Now un-tar that netboot file into the server's /var/lib/tftpboot directory. On linux:
sudo tar -xf /home/me/netboot.tar.gz.gz /var/lib/tftpboot/
I had to use sudo because /var/lib is not mine to touch, and the .gz.gz is sic. When I downloaded the file as linked above, chrome gave it to my hard drive with .gz.gz extension. YMMV.
6. Start the tftpd-hpa service:
sudo service tftpd-hpa start
7. Check:
bootpd: installed, configured, currently running?
tftpd-hpa: installed, configured, service started?
files: netboot files and folders in the correct folder?
Then power your client and request a network boot! From here, your client should take just a few seconds to get acquainted on the network and then a Ubuntu logo and install menu should pop up. If not, watch your client's PXE output. If it seems to be just waiting, it's probably not getting a bootpd response. If that's the case,
sudo screen -r 
to get back into the bootpd that's running.
For my HTPC I'm choosing the following optional software: LAMP server, OpenSSH server, Samba file sever, and Ubuntu desktop. You may not need or want the LAMP server, and you can choose another desktop flavor or none at all if you're installing to a non-graphical server or something.
The netboot installer gets everything from the internet, so I don't have to download an image then get it on a medium, etc. Also, once the netboot has started, the server doesn't need to run bootpd and tftpd-hpa any more. To stop them manually:
sudo service tftpd-hpa stop
sudo screen -r
and then ctrl-c to kill the bootpd running in that screen. Of course, if you restart your server these processes will end naturally and won't restart on their own.