# PXE network boot with grub2, root variable empty

## Ginta

I was running syslinux for network booting, configured tftp and dhcp correctly. Everything runs correctly, and I can boot from network, but I now I am trying to do the same and replace syslinux in favor to grub2.

I therefore ran the command: grub-mknetdir --net-directory=/warehouse/TFTProot/ and modified the file to send in dhcpd.conf

grub starts from network, but it complains about missing root variable, and enters in rescue mode.

I realized that there are some basic variables empty: prefix, pxe_default_server, root.

I looked all over the internet and did not find any way to set them, and it does not even read the grub.cfg file, so I have no idea what is happening here.

Is this a bug, or did I miss something in server's config? I would like some advice as every pages I looked around do not say anything about this.

Thanks

EDIT:

Inside grub rescue (on the client, once booted with PXE), I can manually type:

```

set root=(tftp,10.50.1.10)

set prefix=(tftp,10.50.1.10)/boot/grub

insmod normal

normal

```

And then, I have my grub menu and all is working, but.... how to fill those variables automatically?

----------

## gerdesj

Do you have a particular reason for migrating from syslinux to grub2 for network boot?

If not then I would revert, if so I would find the support system provided by grub2 and ask your question there.

----------

## Ginta

 *gerdesj wrote:*   

> Do you have a particular reason for migrating from syslinux to grub2 for network boot?
> 
> If not then I would revert, if so I would find the support system provided by grub2 and ask your question there.

 

The reason is that syslinux' memdisk does not work good with EFI boot, tried Windows install iso, and works good in non efi, but hangs in EFI boot mode. Unless I can find another workaround for this, then I can not use syslinux correctly (But I would prefer it as it is more simple)

----------

