Diskless Booting: Difference between revisions

m
Bot: Replace deprecated source tag with syntaxhighlight
[unchecked revision][unchecked revision]
m (Reverted edits by Melina148 (talk) to last revision by Khaledhammouda)
m (Bot: Replace deprecated source tag with syntaxhighlight)
 
Line 29:
To create a GRUB PXE bootable image, you can follow the advice in the [http://www.gnu.org/software/grub/manual/grub.html#Network GRUB manual's Network chapter]. Several of the options to <tt>grub-mkimage</tt> did not exist in past versions and you need to upgrade if they aren't supported. If you compile from source, you can get all the <tt>*.{lst,mod,img}</tt> files you need in the source directory. In the case you compile your own GRUB you do not need to install it, just do commands like this:
 
<sourcesyntaxhighlight lang="text">
./grub-mkimage -d . --format=i386-pc --output=core.img --prefix="(pxe)/boot/grub" pxe pxecmd
cat pxeboot.img core.img > grub2pxe
</syntaxhighlight>
</source>
 
The final thing you need to do is setup a DHCP/BOOTP/TFTP server. I used <tt>dnsmasq</tt> which came preinstalled on my workstations, and seems to be widely available in distributions. It can easily be configured on the command line or in <tt>/etc/dnsmasq.conf</tt> which uses the same syntax as the long-form command-line options but without the leading dashes. You will need the following options:
 
<sourcesyntaxhighlight lang="text">
interface=... # be careful what interface the dhcp server runs on!
bind-interfaces # *really* only bind that interface
Line 44:
enable-tftp
tftp-root=/tftp # or wherever
</syntaxhighlight>
</source>
 
and there are other options to explore as well. Now make sure that you take <tt>grub2pxe,*.lst,*.mod</tt> from the GRUB source and put them in <tt>/tftp/boot/grub</tt> or equivalent. Also put your <tt>grub.cfg</tt> file there. The format of that is fairly simple. Here's the essence of what I use:
 
<sourcesyntaxhighlight lang="text">
set timeout=0
set default=0
Line 57:
module /test
}
</syntaxhighlight>
</source>
 
Make sure your kernel and modules appear in the tftp root, and you should be set to boot using your gPXE media, over a private network connection hooked up between workstations.