2

Ahoy friends. Today i set up my PXE server using dnsmasq as DHCP proxy as well as tftp server. I wanted to set up a grub menu to be able to run Windows ISO files in EFI and Legacy mode, depending on the client. So i set up my grub pxe folder using:

grub-mknetdir

I have created the grub images using the following commands for EFI and Legacy boot

grub-mkimage -d /usr/lib/grub/i386-pc/ -O i386-pc-pxe -o ./booti386 -p '/var/lib/tftpboot/boot/grub' pxe tftp

grub-mkimage -d /usr/lib/grub/x86_64-efi/ -O x86_64-efi -o ./bootx64.efi -p '/var/lib/tftpboot/boot/grub' efinet tftp

For now i have copied the grub.cfg file from /boot/grub[..] of my server and it's working like the default grub loader from all the linux distros. To check it how it works i set up a generic system on Virtualbox to find out what's wrong.

Now i use option l) for PXE Boot

Now i use option l) for PXE Boot

The Grub loader appears, everything is fine, not modified yet.

The Grub loader appears, everything is fine, not modified yet.

enter image description here

I try to select something e.g. Clonezilla or Debian Netinst Unfortunately i only get a black screen and the following tftp syslog on server.

Oct 13 17:45:05 millenium-fbe48 dnsmasq-tftp[4797]: konnte /var/lib/tftpboot/iso/clonezilla/clonezilla-live-20191009-eoan-amd64.iso nicht an 192.168.2.89 senden "Unable to send the iso to 192.168.2.89"

enter image description here

Do i have to do something to be able to load iso files? I use the loop way to get them running, but is there something like a timeout or something else?

//edit: Now after almost 5 minutes i got the following output. Is there any way to increase the speed? enter image description here

Is there something like a pxe-nfs-loop-iso syntax in grub.cfg for pxegrub?

  • You can increase the speed by rsyncing the ISO file to the client's disk before booting it. To help you with this problem we would need to see your grub.cfg. – Matt Vollrath Oct 13 at 16:54
  • Thanks for your reply. I got the grub.cfg uploaded in here pastebin.com/jZzvbWYt – Fabian Druschke Oct 13 at 17:46
  • none of your grub boot entries tell grub to load the kernel or initramfs (or memdisk and an ISO image) from the network. they all tell grub to try loading a file from a local disk, which either doesn't exist or isn't mounted or both at this stage of the boot process. and if it did exist and was mounted, probably wouldn't have the boot images anyway. your grub cfg for pxe-booted VMs should tell grub to load kernels or boot images via tftp. – cas Oct 15 at 2:03
  • 1
    BTW, I wouldn't use grub for this. I'd configure dnsmasq to boot pxe clients with ipxe or gpxelinux.0 (from syslinux) instead. grub's good for disk booting, but both ipxe and gpxelinux are much better for network booting. – cas Oct 15 at 2:06
0

Thanks for all the replies. I was able to get rid of the nfs problems, but now i'm stuck with some step. The nfs part is running fine, and i'm also able to mount the squashfs file. Unfortunately i get this kernel panic, does someone know what the problem can be?

enter image description here

//edit! Ahoy friends. I was able to get it running. I'm that happy friends, you cannot believe. Check out my current grub.cfg config.

    menuentry "Netroot" {
   echo 'Trying to boot via nfs ...'
   load_video
   insmod gzio
   if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
   insmod part_msdos
   insmod ext2
   echo 'Loading Linux ...'
   linux /programs/clonezilla/live/vmlinuz root=/dev/nfs ip=dhcp rw netboot=nfs fetch=tftp://192.168.2.55/programs/clonezilla/live/filesystem.squashfs nfsroot=192.168.2.55:/var/lib/tftpboot/programs/clonezilla/live/ rw boot=live username=user union=overlay config components noswap edd=on nomodeset nodmraid locales= keyboard-layouts= ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch=no net.ifnames=0 nosplash noprompt 
   echo 'Loading initial ramdisk ...'
   initrd /var/lib/tftpboot/programs/clonezilla/live/initrd.img
}

This way it's running fine, but unfortunately very slow. Any way to improve the data rate?

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.