PXE boot with grub2-efi.

Hi,

I am trying to setup a PXE server to install openSUSE 13.2. I am using cobbler and my existing setup is working fine with booting in bios and uefi mode. I am stuck at grub prompt, as it failed to find the kernel and initrd file. I tried to follow this thread https://forums.opensuse.org/showthread.php/499052-PXE-Boot-in-UEFI-mode but no success.

I have tried both copying the boot64.efi from the ISO as well as using the grub-mknetdir command to generate the necessary files for tftp.

The content of my grub.cfg is similar to the one in the aforementioned thread:

menuentry “openSuSE 13.1 Installer” {
linux /openSuSE/13.1.64/linux splash=silent showopts install=nfs://fhserver.fhotz.de/data/nfs/openSuSE/13.1.64/
initrd /openSuSE/13.1.64/initrd
}

Except that I changed the path of linux and initrd according to the path inside the file pxelinux.cfg/default.

Thanks.

If it really failed to find them (as opposed to failing to download them) then you need to place them in a directory where TFTP server can serve them. Your menu entry gives no indication whether path /openSUSE is actually available from TFTP server.

Please execute commands from menu entry manually and attach screenshot of errors you get.

ISO of openSUSE 13.2 is mounted on /opensuse. The actual content of my grub.cfg is as follows:

menuentry "openSuSE 13.2 Installer" {
  linux /grub2/x86_64-efi/linux splash=silent showopts install=http://192.168.0.10/sles/opensuse
  initrd /grub2/x86_64-efi/initrd
}
# ls /opensuse/boot/x86_64/loader/linux
/opensuse/boot/x86_64/loader/linux
# ls /opensuse/boot/x86_64/loader/initrd
/opensuse/boot/x86_64/loader/initrd

I am redoing it all over again. Inside /var/lib/tftpboot/grub2/ is everything that has been generated from grub-mknetdir. There is no bootx64.efi and grub.efi in it, so should I be copying it from /opensuse/EFI/BOOT/? That is what I did earlier.

Execute commands from the menu entry as in from the grub prompt? Sorry for the question, I am just not so familiar with grub.

The last time I did for UEFI clients, I placed linux and initrd in the same directory with everything else. I tried this as well, by copying linux and initrd from the ISO into /var/lib/tftpboot/grub2/x86_64-efi/.

# tftp 192.168.0.10
tftp> get grub2/x86_64-efi/linux
tftp> 
# ll linux
-rw-r--r-- 1 root root 5425352 May 15 18:29 linux 

Excerpt from my dhcp.template:

group {
        filename "grub2/x86_64-efi/bootx64.efi";
        next-server 192.168.0.10;
        host test { hardware ethernet 40:F2:E9:A5:49:F8; fixed-address 192.168.0.150; option host-name test; }
}

Thanks.

Stuck here now.

http://i.imgur.com/qEm4Lodh.jpg

So it is mounted on /opensuse, your menu entries show /openSuSE and your TFTP directory is /var/lib/tftpboot/grub2/. Do you think it is OK?

The actual content of my grub.cfg is as follows:

menuentry "openSuSE 13.2 Installer" {
  linux /grub2/x86_64-efi/linux splash=silent showopts install=http://192.168.0.10/sles/opensuse
  initrd /grub2/x86_64-efi/initrd
}

What do you mean “my grub.cfg”? Where this grub.cfg is located? What is your TFTP server root directory (if it runs in restricted mode)?

# ls /opensuse/boot/x86_64/loader/linux
/opensuse/boot/x86_64/loader/linux

How content of /opensuse directory is related to booting using TFTP from /var/lib/tftpboot/grub2/?

Inside /var/lib/tftpboot/grub2/ is everything that has been generated from grub-mknetdir. There is no bootx64.efi and grub.efi in it

Why should there be? grub-mknetdir generates core.efi for x86_64-efi platform and actually tells you that.

so should I be copying it from /opensuse/EFI/BOOT/?

If you already did grub-mknetdir it should be enough - assuming you set up TFTP server correctly. Of course you probably can use grub.efi that comes with openSUSE - advantage is that it does not require any external modules. But then you may need to put grub.cfg in different directory.

Execute commands from the menu entry as in from the grub prompt? Sorry for the question, I am just not so familiar with grub.

You said when you boot you end up in grub command line (stuck in grub prompt). So enter these commands in this grub prompt. Additionally execute “set” to show current environment settings. You may want to use “set pager=1” before as this output usually exceeds one screen.

The last time I did for UEFI clients, I placed linux and initrd in the same directory with everything else.

Paths in grub are always relative to root device (value of variable $root in above output of “set”). If you do PXE boot, root is most likely set to (x.y.z.w,tftp), meaning TFTP server at address x.y.z.w. It is this TFTP server that interprets path. You should know how you set it up and where to place files.

I tried this as well, by copying linux and initrd from the ISO into /var/lib/tftpboot/grub2/x86_64-efi/.

# tftp 192.168.0.10
tftp> get grub2/x86_64-efi/linux
tftp> 

Good. So if you have linux and initrd there your grub.cfg should work. If it does not most likely grub does not find grub.cfg itself. It is still completely unclear what happens from your description. Please show screenshot immediately after PXE booting your system into grub to see what happens.