# PXE Boot FreeBSD 8.1



## atwinix (Dec 9, 2010)

Hello All,

I am currently experimenting with PXE Booting under FreeBSD.  I have been trying to get mine to work since last week and so far I haven't had much luck.

I have mounted the filesystem from the memstick version to a directory on my hard-drive which I am using for PXE-boot.

If I tell my DHCP server to serve boot/pxeboot, I get an error along the lines of "tftp download complete, but unable to load file."  I hence implemented a linux pxeboot-loader using syslinux files.  With that I manage to get the FreeBSD kernel loaded and it boots until it gets stuck at something like "NFS ROOT: 192.168.1.1:/pxe/tftpboot/images/freebsd".  I thought there was a problem with my NFS mounts.  I tried to loopback mount them and they work fine.

So, I tried with using another approach -- the one specified in the FreeBSD Handbook's chapter 31.7 Diskless Operation.  With this image it gets stuck at "Timecounters tick every 10.000 msec" while loading.


```
dhcpd.conf

subnet 192.168.1.0 netmask 255.255.255.0 {
        option routers 192.168.1.1;
        range 192.168.1.100 192.168.1.150;
        next-server 192.168.1.1;

        filename "gpxelinux.0";
        #filename "pxeboot";
        option root-path "192.168.1.1:/pxe/tftpboot/images/freebsd"; # NFS Root
}
```


```
/etc/exports

/usr            -alldirs -ro
/pxe/tftpboot   -alldirs -maproot=root  -network 192.168.1.0/24


/root # showmount -e
Exports list on localhost:
/usr                               Everyone
/pxe/tftpboot                      192.168.1.0
```


```
#Menu to load kernels: /pxe/tftpboot/pxelinux.cfg/default

ui menu.c32
menu title Utilities

label freebsd
        menu label FreeBSD LiveFS
        pxe  tftp://192.168.1.1/images/freebsd/boot/pxeboot

label reboot
        menu label Reboot
        kernel reboot.c32
```
Does anyone have a recent experience in setting up PXE boot that could help? 

Your time and advice are much appreciated,

Cheers,

atwinix


----------



## wblock@ (Dec 9, 2010)

PXE Booting Utilities With FreeBSD has a section on FreeBSD with NFS.


----------



## atwinix (Dec 9, 2010)

That's the tutorial I tried which gets stuck at 
	
	



```
NFS ROOT: 192.168.1.1:/pxe/tftpboot/images/freebsd
```


----------



## wblock@ (Dec 10, 2010)

atwinix said:
			
		

> That's the tutorial I tried which gets stuck at
> 
> 
> 
> ...



What Ethernet controller is in the NFS-booting machine?


----------



## atwinix (Dec 10, 2010)

Server has an Intel Pro/1000 from memory.
Client has an embedded one - Realtek 8111C from what I found in the motherboard doc.


----------



## wblock@ (Dec 10, 2010)

atwinix said:
			
		

> Server has an Intel Pro/1000 from memory.
> Client has an embedded one - Realtek 8111C from what I found in the motherboard doc.



Should be okay.  Try using HTTP instead of TFTP:

```
label freebsd
  menu label FreeBSD LiveFS
  pxe http://192.168.1.1/images/freebsd/boot/pxeboot
```


----------



## atwinix (Dec 10, 2010)

Changed it to http and I am still getting the same problem!  Maybe I should restart from scratch.


----------



## wblock@ (Dec 10, 2010)

Just tested successfully here on a motherboard with a Realtek 8111C and the FreeBSD LiveFS setup.  The server has an Intel gigabit card, and it's going through a 3Com switch.  The software setup is exactly as described in the article.  Your DHCP root path is different from mine; I don't know if FreeBSD's pxeboot can handle a URL-style path.  NFS exports are different, too.


----------



## atwinix (Dec 11, 2010)

Thanks for all your help and time wblock.  I greatly appreciate it.  I shall try installing again.

cheers.


----------



## danbi (Dec 13, 2010)

The FreeBSD Handbook, in Chapter 31 Diskless Operation gives plenty of ideas how to configure working diskless client. I don't think you need any Linux loaders and such.


----------



## rodrigc@ (Jun 11, 2012)

Hi,

I have updated some of the documentation for PXE booting under FreeBSD.  You might want to check it out here: http://www.freebsd.org/doc/handbook/network-pxe-nfs.html

If you install Wireshark, that often can help to debug any problems in your network setup for PXE.


----------

