Ubuntu PXE install via Windows

Posted by reto on 23 December, 2006 23:10

This article expains in step by step instruction how to install Ubuntu over the network (although it's easy to adapt the how-to to other linux distros) via a Windows 2000/XP client.

Introduction

The Preboot Execution Environment (PXE) is nothing new, but rarely used in home office environments because it's most of the time easier to install any operating system from a CD, DVD or even a USB storage device. But what, if you have neither optical drives nor USB storage devices? The only requisites for a PXE installation are a working computer (any OS with TFTP Servers available will do) and Internet access.

The Problem

With the new Intel Southbridge (ICH8R) parallel ATA Drives are no longer supported by the chipset natively, which means most motherboard manufacturers add third party controllers on their boards to provide p-ata interfaces. These third party controllers however are not well supported on Linux at the moment. Especially not directly in the kernel, which means you would have to pre-compile your own installer to access any p-ata CD-Rom. Another reason for using PXE might be subnotebooks without CD/DVD-ROM. The only option you have there is an installation via USB or over the network (PXE).

Step 1: Prerequisites

First get yourself a copy of the free TFTP server by Philippe Jounin. Second we need the ubuntu installer files. Of course it doesn't make much sense to download one of the ubuntu CD images if we only need the small installer. The installer will choose the nearest mirror and download all the files needed automatically during the installation.
The browsable Ubuntu archives are at http://archive.ubuntu.com/ubuntu/dists/. But as we only need the installer, we can ftp to ftp://archive.ubuntu.com/ubuntu/dists/edgy/main/installer-i386/current/images/ and download the folder netboot (ignore any symlinks, they may give you errors during the download).
That's all we need to boot our Ubuntu installer over the network. Let's setup the TFTP server.

Step 2: Setting up a TFTP Server on WindowsTFTP32 DHCP Settings

  1. Create a directory, preferably on your C Drive. We'll name it tftp for now.
  2. copy the tftpd32.exe to c:tftp
  3. Start the server by clicking on the exe
  4. switch to the tab "DHCP Server" and fill in your network setup. Note that the PC you want to boot must be in the same Subnet. Enter pxelinux.0 as the boot file. The Screenshot on the right shows my setup.

Now we need to copy the Ubuntu netboot installer over to our tftp root directory:

  1. copy the folder ubuntu-installer to c:tftp
  2. copy the folder pxelinux.cfg from ubuntu-installer/i386/ to c:tftp
  3. copy the file pxelinux.0 from ubuntu-installer/i386/ to c:tftp

This is how your tftp folder should look like:

c:tftppxelinux.cfgdefault
c:tftpubuntu-installeri386<some more files/folders>
c:tftppxelinux.0
c:tftptftpd32.exe

Step 3: Booting Ubuntu

To boot from tftp you may need to activate booting from the network interface in the BIOS. This may be done in the boot sequence settings or directly in the onboard ethernet device settings. After that, restart, lean back and watch the activities in the log viewer tab of the tftpd.


Note: Ubuntu will let you choose a mirror and download all the files you need. The whole procedure will work with any other debian flavour almost identically. There is a nice how to on doing a PXE install via Linux instead of windows at the CCC Wiki

Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Related Articles
Optimizing PNG Compression
Totally Unrelated Post
Mercedes-Benz Mixed Tape 16
Easy Audio Stream Recording with Streamripper
Slashdot Readers on Windows Viruses

 


Comments

@Peter

reto | 09/12/2007, 15:43

I guess you would need either a local http or ftp server to set up a mirror for your installation (copying into the tftp folder won't help here, sorry). Setting up a mirror for a local network installation of ubuntu is explained in detail at the ccc wiki.

Ubuntu PXE

Victim | 15/12/2007, 18:55

Hi,

how can I open the .deb file of apt-mirror at win xp?!?

Please help!

TIMEOUT waiting for ACK block ...

tarik | 30/12/2007, 18:57

... but i worked well after i checked the "PXE Compatibility" option in the server settings.

Thanks !

Almost there!

Victor | 06/01/2008, 22:56

OK, I'm almost there. I booted the target machine and the installer screen showed up. I hit ENTER and the initrd.gz loaded and i saw some text fly by just as in a regular CD or DVD installation. Then, the screen faded out to black and everything just hung. I've tried about 10 times but I'm always getting stuck at this point. Any help would be greatly appreciated!! I'm working with a very old machine (Compaq Armada M300 w/192MB of RAM).

Re: Ubuntu PXE install via Windows

reto | 07/01/2008, 00:09

@victor: Do you know of anybody successfully running Linux on that specific hardware of yours (googling might help)? Because it sounds like your PXE setup is working, but the installer crashes...

windows 2000 no go

chris | 19/01/2008, 23:22

I'm trying to run this on Windows 2000 Pro via a crossover cable. The target/boot machine has Intel Boot Agent 4.0.18, and errors out with error PXE-E52.

The tftp log shows:

Rcvd DHCP Discover Msg for IP 0.0.0.0, Mac 00:00:39:E8:B1:E8 [19/01 14:18:25.118]

00:00:39:E8:B1:E8: statically assigned to address 0.0.0.0 [19/01 14:18:25.118]

Any ideas?

Everything works up until....

Greg | 31/01/2008, 19:42

Figured I try this since I got a laptop with a faulty CD-Rom driver. Everything worked fine until it gets to donwloading the components. EVERY ARCHIVE for some reason is not available or does not have a valid release file on it. This is according to the installer anyways. I've tried almost every single one. Just wondering if nyone's had this problem and what was done to fix it.

THANK YOU!!!

Omar Uddin | 08/03/2008, 10:04

I would just like to say thank you very much!!! I successfully installed Ubuntu on my Fujitsu B2562 laptop (no cd, no floppy, no usb boot) after weeks of trying to find a way!

I really appreciate your time and effort of developing the tutorial!

Re: Ubuntu PXE install via Windows

reto | 08/03/2008, 10:59

hi Omar,
I'm glad the article helped! :)
Thank you for the feedback. Have fun with your Ubuntu Laptop.

PXE ISO

Bruno Lopes F. Cabral | 26/03/2008, 15:44

Hello there.
I tried your instructions to PXE boot Fluxbuntu 7.10RC on a ALIX1C board that I cannot make a usb cdrom work into. Unfortunately the ISO doesnt come with netinstall dir so I grab it from Gutsy instead.
I add a httpd server to my box and publish the ISO root as my local mirror. PXE boot works flawlessly until I choose my mirror to be informed manually.
No mather what I tried, it says in vty4 the following, after starting to grab files:
gpgv: Signature made Fri Oct 26 17:49:51 2007 UTC using DSA key ID B6A4EB33
gpgv: Cant check signature: public key not found
I noticed another folk asked how to install Xubuntu, I think this is exactly my case also. Do you know how to import the Fluxbuntu signature on Gutsy netinstall or have any other hint for me?
Thanks
!3runo
from Brazil

Re: Ubuntu PXE install via Windows

meaulnes | 26/03/2008, 23:39

Dear reto,

this seems to work great, but while at "configure the network" there is a problem: "no default route was set" - and so no internet, no download.

How can I set a default route?

Or even better - how can I install complete ubuntu with PXE via windows without internet-connection?

Thanks

Re: Ubuntu PXE install via Windows

reto | 31/03/2008, 21:58

@meaulnes: have you set your "Default router" in the "DHCP Server" Tab? And does this gateway have internet access? That's what I'd check next.
For offline PXE installs you can base your work on the linux setup described in the CCC Wiki. You can of course install Apache on Windows. But you need a locale Web-/FTP-Server to implement a locale mirror.

Where's Ubuntu Mirror

sunbqto | 17/04/2008, 09:53

I tried n different ways, but I can not found Ubuntu Mirror. I do not want install Ubuntu via Lan.

PXE install went like a dream

Falk | 24/04/2008, 16:20

Thank you for the step by step guide - a laptop with a corrupt Windows XP that could not even boot up anymore, no CD ROM and USB ports that did not recognise an external drive has a new lease of life as a Xubuntu Linux laptop! (Toshiba Portege) Perfect!!!

Ubuntu is here

sunbqto | 27/04/2008, 08:45

Thank you, step by step live is most chevere!

Re: Ubuntu PXE install via Windows

Arman | 20/06/2008, 19:51

I'm having the same problem as 'Greg' above. When downloading the components reach 50% it will stop. Archive for some reason become not available or does not have a valid release file on it. I've tried several times with different mirrors and the same problem appear.

Failed at first but then worked

Rodrigo | 09/07/2008, 15:07

The option "PXE compatibility" did the trick for me. The boot was failing but after I enabled this option it worked like a charm.

dude!

matt | 31/07/2008, 04:22

worked well, few errors. on 2nd attempt i stuck the whole iso in the directory, no problems. now if only you can tell me how to do the same with VMWare ESX Server

Ubuntu PXE Install

AAAle | 18/08/2008, 16:41

I want to say thanks for this how-to.
I was able to install ubuntu and debian at the first time.
great :)

Multiple DHCP server?

batman cannot fly | 28/08/2008, 19:53

Hi! I am wondering if you could explain something for me. When the tftp program sets up a dhcp server, wouldn't it have to compete with the local network's dhcp server? (i.e. some dsl router or something). How do you know that tftp would win?

Re: Multiple DHCP server?

reto | 28/08/2008, 22:32

Good question. I deactivated my cheap router/dhcp box for the installation if I remember correctly. Not sure, though.
With a *real* DHCP server you wouldn't need the TFTP servers DHCP functionality but use the DHCP to point any PXE boot client to the right address in the network.

windows renamed file

Peter | 08/09/2008, 11:35

This is a great guide and works

But i found windows renamed the defualt file on the folder pxelinux.cfg to "defualt.txt" - i had to manually deleat the .txt from the filename

then it worked a dream

I do up computers for charity and wast donated some cl51 same as acer tm 290. and they had no cd drives and it will not boot linux by usb thumb driv

Many thanks

Ubuntu Server Boot

Josh | 11/09/2008, 09:56

Anyone know how to use this method to install ubuntu server instead of the desktop version?

Thanks for the guide anyway!

Fix if seeing black screen initial boot menu

Josh | 16/09/2008, 07:54

Victor,
try copying all of the contents of ubuntu-installer folder int the c:tftp directory. I had the same problem and this got me going

copy files

Felix | 17/09/2008, 22:34

I'm sorry, but I've got as far as copy ubuntu-installer, pxelinux.cfg and etc.. to c:tftp. where do I get these files any way? I click on the link before that, but it didn't link me to any where. Can you please provide me more information. Thanks in advance.

Felix

«Previous   1 2 3  Next»