July, 2008


27
Jul 08

HOWTO: Install Ubuntu over a network

I recently bought a laptop with a broken cdrom drive and this is how I’ve managed to put Ubuntu on it. The process is based on this tutorial on the official Ubuntu help site, although it differs slightly in software used and goes into more detail.

The Problem

I have a laptop I want to install Ubuntu on and I can’t use the cdrom. This method is also useful if you want to install Ubuntu on a bunch of machines at the same time without having to deal with the hassle of burning multiple copies of the cd image.

Minimum Requirements

This process is faily complicated and requires a few things that aren’t normally available. First off you need the target computer to support booting over PXE. Most modern BIOS support this nowadays, but if you’re dealing with legacy hardware this could be an issue. The second basic component is another computer which will act as the PXE server. You’ll need to install a dhcp server, a tftp server, and you’ll need to configure it to act as a internet proxy for the target computer. The point is that you need full access to this machine and you’ll need to have both machines connected over a network, preferably ethernet.

My setup

To make the tutorial easier to follow here’s what I have and what it’s called.

Joker (192.168.2.X) is the laptop I want to install Ubuntu on, it is connected through a switch to blackmesa (192.168.2.1) which is another laptop which acts as a router for the house network, it does dhcp, tftp and ip forwarding so that the other computers can get to the internet.

Let’s get started

First we’ll get blackmesa setup to serve the files we need. We’ll need to download the alternate cd image, or one of the minimal install images. The alternate image can be found next to the normal desktop and server images on any of the Ubuntu ftp mirrors. The minimal cd images are linked from a page on the Ubuntu help wiki.

The tutorial uses dnsmasq as the dhcp and tftp server, I used dhcp3-server because that’s what I already had running. dhcp3-server doesn’t have a built-in tftp server so we’ll need one as well.

sudo apt-get install tftpd-hpa tftp-hpa xinetd dhcp3-server

My /etc/dhcp3/dhcpd.conf file looks like this:

subnet 192.168.2.0 netmask 255.255.255.0 {
    option routers 192.168.2.1;
    option subnet-mask 255.255.255.0;
    option domain-name-servers 80.58.61.250, 80.58.61.254;
    range dynamic-bootp 192.168.2.2 192.168.2.254;
    default-lease-time 21600;
    max-lease-time 43200;
    filename "pxelinux.0";
    next-server 192.168.2.1;
}

The important lines are the last two. filename specifies what the file PXE will try to grab is called, pxelinux.0 is the normal value for this and what the file Ubuntu uses is called. next-server tells the client computer where to find the PXE files. In this case, because the tftp server and the dhcp server are the same the ip number is the same.

Now we copy the files we need for netboot. We mount the iso image as a loop device:

sudo mount -t iso9660 -o loop ubuntu-8.04.1-alternate-i386.iso /media/cdrom

And copy the files we need to the tftp server folder

sudo cp -a /media/cdrom/install/netboot/* /var/lib/tftpboot/

Next we configure the tftp server by creating a new file called /etc/xinetd.d/tftp, it should look something like this:

service tftp
{
    disable                 = no
    socket_type             = dgram
    wait                    = yes
    user                    = root
    server                  = /usr/sbin/in.tftpd
    server_args             = -v -s /var/lib/tftpboot
}

And reboot the tftp service

sudo killall -HUP xinetd

The last thing you need to do is enable the host computer to do ip forwarding so that the client computer can get to the internet and download the packages it needs. To do so is fairly simple:

sudo su
echo 1 > /proc/sys/net/ipv4/ip_forward

If all is well we’re done setting up the host machine, blackmesa in this case.

Onto the client

Telling the client to boot from the network device is very easy but varies wildly from BIOS to BIOS. In my case I had to go into the boot order page and enable Ethernet device and set it as first option. Now when you reboot, your computer will bring up a text based installer. If it doesn’t and it gets stuck grabbing dhcp or comunicating with the tftp server then something is going wrong, in my case the process was so quick I didn’t even see this screen.

Once in the text based installer, continue the install process as you normally would, but remember to disable network booting after you’re done or you’ll get sent to the text based installer when you reboot.


25
Jul 08

Happy Sysadmin Day

Happy sysadmin day to me: unofficial sysadmin of a bunch of random people! To celebrate, I retroactively dedicate last night’s party to us geeks who keep all your websites running without you knowing it. :-D


22
Jul 08

Que huevos

Estaba sentado en mi ordenador en casa hace cinco minutos cuando alguien tocó el timbre. Me levanté de mi cómoda silla para ver quien era ya que no esperaba a nadie y el tipo me contestó vengo a dejar publicidad, me deja pasar?

Y me quedé a cuadros.

¿Hay alguien ahí fuera que le dice si hombre, pasa y lléname el buzón de mierda?

Lo peor de todo es que sé que el tipo toco más timbres hasta que algún imbecil lo dejó entrar y cuando baje más tarde me voy a encontrar con el buzón lleno de spam.


17
Jul 08

Summercase’08

Plan para el Summercase 2008 al que voy mañana:

Summercase 08

Seguramente “sacrifique” a Los Campesinos! a favor de The Breeders y a Biffy Clyro en favor de Kings of Leon ya que a Biffy los vi en el Electric Festival. Los que no me pierdo por nada en el mundo, y la principal razón por la que voy a este festival, es a Mogwai que van a estar tocando el disco Young Team en su totalidad. Con verlos a ellos ya solo me quedaría por ver a los Smashing Pumpkins para completar mi Top 5 de last.fm.

Los más observadores se darán cuenta de que no voy el sábado. Del cartel solo me interesaban dos bandas… pasando.

Por cierto, la idea del post ha sido descaradamente copiada a Alejandro (aka Nordic) que también va a ir, y además con un plan similar al mio. ¡Capaz que nos encontramos!


11
Jul 08

Batman vs. Superman

Genial animación de una pelea entre Superman y Batman.

I grew up in Gotham, kids, and in a town like Gotham when you see an epileptic having a seizure in a bathtub, you throw your laundry in.

Visto en el LinkLog.


10
Jul 08

Inauguración

Mi hermanita acaba (bueno, hace unas semanas, todavía está de pruebas) de abrir su propio blog: The Passenger, en inglés y en español. Con un poco de suerte posteara más a menudo que yo. Y cosas más interesantes.