# pxeboot not trying to mount default /pxeroot share



## cakersq (Dec 29, 2011)

I am quite familiar with PXE booting, and have a working setup now.  What I am trying to do is have a menu based PXE system, from PXELinux/SysLinux, to select different OS's to boot from.

For FreeBSD, I want to have the option of booting from different mount points by choice from the menu, either a Live OS, or an installer, for either amd64 or i386 architecture.

By default pxeboot will try to mount from the DHCP set *next-server:/pxeroot*.  In the past I accomplished this by compiling pxeboot different times, each with a different value of *PXENFSROOTPATH* (set in /usr/src/sys/boot/i386/libi386/pxe.h ), then with PXELinux, I will choose which file to chain load from and boot. 


```
pxelinux.cfg/default

LABEL freebsd-live-32
        PXE /freebsd/pxeboot-live32
        MENU LABEL FreeBSD Live i386
LABEL freebsd-live-64
        PXE /freebsd/pxeboot-live64
        MENU LABEL FreeBSD Live amd64
```

The problem is *pxeboot* is trying to mount *next-server:/* every time, instead of the value of the internal default PXENFSROOTPATH path.  This should be *192.168.1.200:/pxeroot* by default.


```
Output from PXE Boot Attempt:

pxe_open: server addr: 192.168.1.200
pxe_open: server path: /
pxe_open: gateway ip: 192.168.1.1
NFS MOUNT RPC error: 13
...
```

I have gotten this working in the past, but now I can't get it anymore.  I have looked in the binaries of my *pxeboot*, and validated the new values for PXENFSROOTPATH is included.

I have tried this with the *pxeboot* from 7.4, 8.2 and 9.0-prerelease.  No *pxeboot* binary tries to mount from /pxeroot or from my custom path.

Any ideas?


```
dhcpd.conf:

filename "pxelinux.0";
next-server 192.168.1.200;
# option root-path not used, because that will override the default PXEBOOT values.
```


```
/etc/exports

/pxeroot -ro -maproot=0 -alldirs
```

Troubleshooting notes:
- I have tried specifying the default pxeboot file directly from dhcpd.conf, but that has the same problem, so it's not a SysLinux issue.
- I can specify *option root-path* in dhcpd.conf, and pxeboot will honor that setting each time, regardless of what *PXENFSROOTPATH* is set to internally.


----------



## cakersq (Dec 30, 2011)

After some debugging, it looks like something is setting *rootpath* to "/", but I don't know what, it's not done by the DHCP server, I have done packet captures to make sure.

I have a temporary solution to edit /usr/src/sys/boot/i386/libi386/pxe.c to force it to use a an internal path always, instead of checkig to see if a path is externally defined, by:
	
	



```
//if (!rootpath[0])
//    strcpy(rootpath, PXENFSROOTPATH);
strcpy(rootpath,"/pxeroot/live-i386");
```


----------

