FreeBSD 8.0 headless pxe install

Installing and upgrading FreeBSD.

FreeBSD 8.0 headless pxe install

Postby loppefaaret » 20 Feb 2010, 13:54


I'm trying to do a headless install over PXE

i got a soekris 5501 that im trying to install freebsd 8 to.

im PXE booting it from a windows server 2008.
with tftpd32.exe wich controls the tftp & dhcp part, then i have a NFS share on the windows 2008 that allows anonymous connections, to serve the root of the tftp directory.
my DHCP is working correctly
my TFTP is working correctly
my NFS is working correctly

ive got a custom build "pxeboot" file, that was made with [CMD=" "]make BOOT_PXELDR_ALWAYS_SERIAL=1 BOOT_COMCONSOLE_SPEED=115200[/CMD] on a running freebsd 8.0 release i386 system.

ive copied the [FILE]/boot[/FILE] directory from the [FILE]8.0-FreeBSD-RELEASE-i386-bootonly.iso[/FILE] into the root of my TFTP/NFS share.

ive created a boot.config in the root of the share, with [CMD=" "]/boot/loader -h -S115200 -Dh[/CMD]
ive edited [FILE]/boot/loader.conf[/FILE] to contain:
Code: Select all

ive unpacked [FILE]/boot/mfsroot.gz[/FILE] to [FILE]/boot/mfsroot[/FILE]

now, when i boot the soekris using PXE, i get the PXE loading, followed by the FreeBSD boot menu. (default, no-acpi etc.) then it starts booting kernel and there is no more output to the serial console..

Code: Select all
/boot/kernel/kernel text=0x88d680 data=0xdb0f4+0xa3104 -
Hit [Enter] to boot immediately, or any other key for command prompt.
Booting [/boot/kernel/kernel]...

maybe my problem is that the kernel switches the baud rate ? is there additional options that i have to set somewhere ? or is the problem something different ?
Junior Member
Posts: 4
Joined: 08 Oct 2009, 09:23

Postby J65nko » 21 Feb 2010, 00:05

IIRC the default baudrate for a Soekris is 19200.Why do go for such an insane speed of 115200?

The official doc for serial console is at
Maybe you could double check ;)
Posts: 422
Joined: 17 Nov 2008, 00:06
Location: Budel, Netherlands

Postby loppefaaret » 21 Feb 2010, 12:12


soekris default serial speed is indeed 19200...

ive decided i was a fool for going with 115200...
just stick to 9600 like the rest of the world :)

so i set the soekris to conspeed=9600

ive got the DHCPD & TFTPD through tftpd32.exe(to be honest, i dont know if the DHCP works as it should, but i have previously booted freebsd 7.2 and netbsd 4.0.1 with it, so i assume it works)
ive got NFS shared by builtin file sharing in server 2008, with anonymous access allowed, and have added the anonymous user group to the security tab of /pxeroot/ so anon can access and read files.

then i went back to the machine running freebsd 8.0 release, and did:
Code: Select all
rm -rf /usr/obj/* && cd /sys/boot && make BOOT_PXELDR_ALWAYS_SERIAL=1 BOOT_COMCONSOLE_SPEED=9600

i then copy pxeboot into /pxeroot/boot/ on my windows machine.

i extract the contents of 8.0-RELEASE-i386-bootonly.iso /boot/* into /pxeroot/boot/

i direct my DHCP to point to /boot/pxeboot as bootfile

i make /pxeroot/boot.config to look like this:
Code: Select all
/boot/loader -h -S9600

i edit /pxeroot/boot/loader.conf to look like:
Code: Select all

i did not modify /pxeroot/boot/device.hints as it allready loads uart0 with 0x10 flag as default.

that should do it ?

now it doesnt even show the pxeboot loading on the serial console... before with the 115200 compiled pxeboot, i got pxeboot telling me console was serial, that the harddrive was disk0 etc.. then i had the freebsd boot choice with default, no-acpi etc, then it would load kernel, and output would halt... now output halts imidiatly after pxeboot has been loaded from tftp...

Code: Select all
comBIOS ver. 1.33  20070103  Copyright (C) 2000-2007 Soekris Engineering.


0512 Mbyte Memory                        CPU Geode LX 500 Mhz

Pri Mas  FUJITSU MHT2080BH               LBA Xlt 1024-255-63  78 Gbyte

Slot   Vend Dev  ClassRev Cmd  Stat CL LT HT  Base1    Base2   Int
0:01:2 1022 2082 10100000 0006 0220 08 00 00 A0000000 00000000 10
0:06:0 1106 3053 02000096 0117 0210 08 40 00 0000E101 A0004000 11
0:07:0 1106 3053 02000096 0117 0210 08 40 00 0000E201 A0004100 05
0:08:0 1106 3053 02000096 0117 0210 08 40 00 0000E301 A0004200 09
0:09:0 1106 3053 02000096 0117 0210 08 40 00 0000E401 A0004300 12
0:20:0 1022 2090 06010003 0009 02A0 08 40 80 00006001 00006101
0:20:2 1022 209A 01018001 0005 02A0 08 00 00 00000000 00000000
0:21:0 1022 2094 0C031002 0006 0230 08 00 80 A0005000 00000000 15
0:21:1 1022 2095 0C032002 0006 0230 08 00 00 A0006000 00000000 15

comBIOS Monitor.   Press ? for help.

> show

ConSpeed = 9600
ConLock = Enabled
ConMute = Disabled
BIOSentry = Enabled
PCIROMS = Enabled
PXEBoot = Enabled
FLASH = Secondary
BootDelay = 5
FastBoot = Disabled
BootPartition = Disabled
BootDrive = 80 81 F0 FF
ShowPCI = Enabled
Reset = Hard
CpuSpeed = Default

> boot f0

Intel UNDI, PXE-2.0 (build 082)
Copyright (C) 1997,1998,1999  Intel Corporation
VIA Rhine III Management Adapter v2.43 (2005/12/15)


and thats it x(

i guess ill mess a bit around with the different options like /boot/loader -h -Dh -S9600 and the loader.conf comconsole... maybe try and compile pxeboot without BOOT_COMCONSOLE_SPEED=9600, as this should be default, and therefor not needed, and by defining it in the make command, i mess up things ? but it is stated that when 1 bootstage has a serial setup, the next bootstage would detect it, and adopt the settings by itself. would that mean that by compiling pxeboot, settings in boot.config and/or loader.conf is obsolete ?

PS: thanks to dutchdemon for cleaning up my mess.
Junior Member
Posts: 4
Joined: 08 Oct 2009, 09:23

Postby loppefaaret » 21 Feb 2010, 12:19

in a shortage of edit button!

just wanted to clear up, that first i copy contents of the iso to /boot, then i copy the compiled pxeboot into /pxeroot/boot , and not the other way around as stated above...
Junior Member
Posts: 4
Joined: 08 Oct 2009, 09:23

Postby loppefaaret » 28 Feb 2010, 19:01


alot of this is creditted

so ditched windows..
went with freebsd as hosting pc.
get ur self a fresh install of freebsd 8, and make sure u add the base and kernel src code, along with developer tools to compile.

first thing i install is the nano editor, as this is my favorite editor.
Code: Select all
cd /usr/ports/editors/nano
make install clean clean-depends
hash -r

then i setup DHCP daemon
Code: Select all
cd /usr/ports/net/isc-dhcp31-server
make install clean clean-depends

this will put the dhcpd.conf config script in /usr/local/etc/dhcpd.conf
Code: Select all
nano /usr/local/etc/dhcpd.conf

my dhcpd.cong contains the following:
Code: Select all
option domain-name "local.domain";
option domain-name-servers;
default-lease-time 6000;
max-lease-time 60000;
ddns-update-style none;
subnet netmask {
   option domain-name-servers;
   option domain-name "loca.domain";
   option routers;
   option broadcast-address;
   default-lease-time 600;
   max-lease-time 7200;
   filename "pxeroot/boot/pxeboot";
   option root-path "/usr/local/pxeroot";

next step is the tftp server, that is hosted through inetd, nano /etc/inetd.conf:
look for 1 particular line that starts with #tftp dgram udp
carefull not to mix it up with the line #tftp dgram udp6.
delete the leading # so the line looks like:
Code: Select all
tftp   dgram   udp   wait   root   /usr/libexec/tftpd   tftpd -l -s /usr/local/pxeroot

notice the ending of the line, thats the actual command, and in it we specify the directory to serve over tftp, /usr/local/pxeroot
since tftp is anonymous, the directory has to allow access to all, but we get to that later

next thing is the nfsd, wich is network file sharing daemon, to serve the install media.
nfs shares are defined in the /etc/exports file, go ahead and edit it: nano /etc/exports
and input following
Code: Select all
/usr/local/pxeroot   -network 192.168.137 -mask

there is more to it, to enable nfsd completely, but ill cover that part later.

so now we have our dhcp server, tftp server and nfs server.
now we let them run at boot time, as services.
that is done through the /etc/rc.conf file, in this file we also set a static IP for the network interface we going to be connecting to the booting client.
my ethernet interface is called em0, yours might be different
go ahead and edit it: nano /etc/rc.conf
input the following lines at the bottom:
Code: Select all
ifconfig_em0="inet netmask"




tftp is served through inetd, and the last 4 lines are for nfs to work proberly.

now we go ahead and create the folders for booting and installing.
Code: Select all
mkdir /usr/local/pxeroot

in this we have to put the files from the 8.0-RELEASE-i386-disc1.iso
we are going to download it and extract it with the following commands:
Code: Select all
tar -C /usr/local/pxeroot -pxvf 8.0-RELEASE-i386-disc1.iso

next step is to recompile the pxeboot file, so that it will direct output to serial console
Code: Select all
rm -fr /usr/obj/*
cd /sys/boot
make clean
cp /sys/boot/i386/pxeldr/pxeboot /usr/local/pxeroot/boot
cd /sys/boot
make clean

then we need to create /usr/local/pxeroot/boot.config with the following line inside:
nano /usr/local/pxeroot/boot.config
Code: Select all
/boot/loader -h -S9600

next step we control it through the file /usr/local/pxeroot/boot/loader.conf
go ahead and edit it: nano /usr/local/pxeroot/boot/loader.conf
Code: Select all

as i said earlier, we need to let anonymous access these files, so we do the following to let anyone access it:
Code: Select all
find /usr/local/freebsd8 -type d -print0 | xargs -0 chmod 0755
find /usr/local/freebsd8 -type f -print0 | xargs -0 chmod 0644

finally do a:
Code: Select all

now hook up the serial, and pxeboot the headless computer
Junior Member
Posts: 4
Joined: 08 Oct 2009, 09:23

Return to Installing & Upgrading

Who is online

Users browsing this forum: No registered users and 1 guest