{"id":1098,"date":"2024-01-14T12:56:20","date_gmt":"2024-01-14T17:56:20","guid":{"rendered":"https:\/\/sunapi386.ca\/wordpress\/?p=1098"},"modified":"2024-01-14T15:44:51","modified_gmt":"2024-01-14T20:44:51","slug":"title-setting-up-a-pxe-boot-server-with-netboot-xyz-on-ubuntu","status":"publish","type":"post","link":"https:\/\/sunapi386.ca\/wordpress\/title-setting-up-a-pxe-boot-server-with-netboot-xyz-on-ubuntu\/","title":{"rendered":"Setting Up a PXE Boot Server with netboot.xyz Using Dnsmasq on Ubuntu"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Introduction<\/h3>\n\n\n\n<p>In this blog post, we&#8217;ll guide you through setting up a PXE (Preboot Execution Environment) boot server with <code>netboot.xyz<\/code> on Ubuntu, leveraging <code>dnsmasq<\/code> for a simplified setup. This configuration allows networked machines to boot various operating systems from a single server, ideal for labs, data centers, or rapid OS deployments.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What is PXE Booting?<\/h3>\n\n\n\n<p>PXE booting enables computers to load and boot an operating system from a network server. This method is extensively used for system installations, recovery, and testing different operating systems without local storage.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why netboot.xyz?<\/h3>\n\n\n\n<p><code>netboot.xyz<\/code> is an open-source initiative that simplifies the PXE boot process with a dynamic boot menu, allowing selection from a range of operating systems and tools. This capability is crucial for efficient network and system management.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why dnsmasq?<\/h3>\n\n\n\n<p>It supports DHCP and TFTP services, which is a more streamlined approach for setting up a PXE boot environment. Alternatively you can use <code>isc-dhcp-server<\/code> and <code>tftpd-hpa<\/code>.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Prerequisites<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>An Ubuntu 22.04 server (referred to as <code>pxehost<\/code>).<\/li>\n\n\n\n<li>Basic Linux and network configuration knowledge.<\/li>\n\n\n\n<li>Root or sudo privileges on the server.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Installing Dnsmasq<\/h3>\n\n\n\n<p>Dnsmasq serves as both the DHCP and TFTP server, streamlining the setup. Install it using:<\/p>\n\n\n\n<p><code>sudo apt-get update sudo apt-get install -y dnsmasq<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Configuring Dnsmasq<\/h3>\n\n\n\n<p>Edit <code>\/etc\/dnsmasq.conf<\/code> to include DHCP and TFTP settings:<\/p>\n\n\n\n<p><code>sudo nano \/etc\/dnsmasq.conf<\/code><\/p>\n\n\n\n<p>Add the following configuration:<\/p>\n\n\n\n<p><code># DHCP Settings dhcp-range=192.168.2.30,192.168.2.200,255.255.255.0,24h dhcp-option=option:router,192.168.2.1 dhcp-option=option:dns-server,localhost,1.1.1.1 dhcp-boot=netboot.xyz.kpxe # TFTP Settings enable-tftp tftp-root=\/var\/lib\/tftpboot<\/code><\/p>\n\n\n\n<p>Restart <code>dnsmasq<\/code> to apply the changes:<\/p>\n\n\n\n<p><code>sudo systemctl restart dnsmasq<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Setting Up netboot.xyz<\/h3>\n\n\n\n<p>Download the <code>netboot.xyz<\/code> boot files into the TFTP directory:<\/p>\n\n\n\n<p><code>sudo mkdir -p \/var\/lib\/tftpboot cd \/var\/lib\/tftpboot sudo wget https:\/\/boot.netboot.xyz\/ipxe\/netboot.xyz.kpxe sudo wget https:\/\/boot.netboot.xyz\/ipxe\/netboot.xyz.efi<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Testing the PXE Boot and Troubleshooting<\/h3>\n\n\n\n<p>Test the PXE boot on a client machine. If issues arise, check the <code>dnsmasq<\/code> logs:<\/p>\n\n\n\n<p>bashCopy code<\/p>\n\n\n\n<p><code>grep dnsmasq \/var\/log\/syslog<\/code><\/p>\n\n\n\n<p>For TFTP issues, attempt a manual TFTP download from another machine:<\/p>\n\n\n\n<p>bashCopy code<\/p>\n\n\n\n<p><code>tftp 192.168.2.5 get netboot.xyz.kpxe quit<\/code><\/p>\n\n\n\n<p>Confirm that the TFTP server is correctly configured and accessible.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n\n\n\n<p>Using <code>dnsmasq<\/code> for PXE booting with <code>netboot.xyz<\/code> offers a streamlined, efficient approach to network booting. This setup is ideal for environments requiring quick and versatile OS deployments and system management.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/sunapi386.ca\/wordpress\/wp-content\/uploads\/2024\/01\/IMG_6774.jpeg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/sunapi386.ca\/wordpress\/wp-content\/uploads\/2024\/01\/IMG_6774-1024x768.jpeg\" alt=\"\" class=\"wp-image-1099\" srcset=\"https:\/\/sunapi386.ca\/wordpress\/wp-content\/uploads\/2024\/01\/IMG_6774-1024x768.jpeg 1024w, https:\/\/sunapi386.ca\/wordpress\/wp-content\/uploads\/2024\/01\/IMG_6774-300x225.jpeg 300w, https:\/\/sunapi386.ca\/wordpress\/wp-content\/uploads\/2024\/01\/IMG_6774-768x576.jpeg 768w, https:\/\/sunapi386.ca\/wordpress\/wp-content\/uploads\/2024\/01\/IMG_6774.jpeg 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/sunapi386.ca\/wordpress\/wp-content\/uploads\/2024\/01\/IMG_6776.jpeg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/sunapi386.ca\/wordpress\/wp-content\/uploads\/2024\/01\/IMG_6776-1024x768.jpeg\" alt=\"\" class=\"wp-image-1100\" srcset=\"https:\/\/sunapi386.ca\/wordpress\/wp-content\/uploads\/2024\/01\/IMG_6776-1024x768.jpeg 1024w, https:\/\/sunapi386.ca\/wordpress\/wp-content\/uploads\/2024\/01\/IMG_6776-300x225.jpeg 300w, https:\/\/sunapi386.ca\/wordpress\/wp-content\/uploads\/2024\/01\/IMG_6776-768x576.jpeg 768w, https:\/\/sunapi386.ca\/wordpress\/wp-content\/uploads\/2024\/01\/IMG_6776.jpeg 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><\/h3>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this blog post, we&#8217;ll guide you through setting up a PXE (Preboot Execution Environment) boot server with netboot.xyz on Ubuntu, leveraging dnsmasq for a simplified setup. This configuration allows networked machines to boot various operating systems from a single server, ideal for labs, data centers, or rapid OS deployments. What is PXE Booting? &hellip; <a href=\"https:\/\/sunapi386.ca\/wordpress\/title-setting-up-a-pxe-boot-server-with-netboot-xyz-on-ubuntu\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Setting Up a PXE Boot Server with netboot.xyz Using Dnsmasq on Ubuntu<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1098","post","type-post","status-publish","format-standard","hentry","category-thoughts"],"_links":{"self":[{"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/posts\/1098","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/comments?post=1098"}],"version-history":[{"count":3,"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/posts\/1098\/revisions"}],"predecessor-version":[{"id":1104,"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/posts\/1098\/revisions\/1104"}],"wp:attachment":[{"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/media?parent=1098"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/categories?post=1098"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/tags?post=1098"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}