Jump to content

So I have 2 computers. I want to use my 1st PC as a server which has the Arch Linux ISO and my 2nd PC which will boot through the ethernet connection between them. I am not into networking and never done this before, so I sneakily went to our AI overlords for help but I got ChatGPT'ed. https://chat.openai.com/share/e5b326ab-54f8-4df5-8656-7f3cb344e3ca 

 

I have a feeling I am missing something. I have the dnsmasq service running, but how do I actually start the PXE sever, or is it already online? The 2nd PC is still asking to start the PXE boot. I tried both IPv4 and 6.

PLEASE MARK COMMENTS AS SOLUTION IF SATISFIED!!

bigger number better, makes me look cooler.

Link to comment
https://linustechtips.com/topic/1568932-trying-to-setup-pxe-boot-on-linux/
Share on other sites

Link to post
Share on other sites

@whispous

 

Geez, I am not a newbie. I know ChatGPT can get stuff wrong, but most of the time when I just want to get something done it knows what to do. I use it when I want to do stuff rather than learn it. Time isn't free for learning everything.

 

Also, there is no reason to do this except for tinkering. I just asked ChatGPT because there are so many ways to do this so I thought it might have a unified solution. Still though, I think I can make it work for whatever it has said. I just don't know what exactly I need to do to get my PXE server running.

PLEASE MARK COMMENTS AS SOLUTION IF SATISFIED!!

bigger number better, makes me look cooler.

Link to post
Share on other sites

As a person who has setup a ISC-KEA based PXE service, I feel I have some good knowledge to put here.

 

When you are creating a PXE server, you need 3 components (or 2 if you decide to host storage locally on the machine)

 

1) A DHCP server

2) A TFTP server

3) A NFS server (optional if you wish to use local storage)

 

 

Steps to set it up:

1) start a DHCP server (which you seem to have already done with dnsmasq)

    a) This service should be configured for DHCP only first as to make sure the extra device can even get an IP

2) setup the TFTP server with a PXELINUX firmware image from the syslinux set of bootloaders (you can find details here: https://wiki.syslinux.org/wiki/index.php?title=PXELINUX)

    a) from the looks of this website (https://docs.oracle.com/en/operating-systems/oracle-linux/6/install/ol-dnsmasq-conf.html), it appears that dnsmasq already has a built-in tftp server.

3) extract the kernel and ramdisk image from your ISO (there is no way to boot your ISO from PXE without being a massive PITA) into the tftp root

4) in the DHCP server, set the PXE option (in your case, `dhcp-host` ) to be the IP address of the TFTP server (in this case, the IP of PC1)

5) you should be able to boot at this point, and will probably be able to boot into the ramdisk shell

 

From this point, you can dink around with kernel parameters and NFS roots if you decide that you want that machine to be diskless (or are using the ISO as your install medium)

 

The other option is to find a netboot package that you can have the `dhcp-boot` and `tftp-root` point to instead.

Link to post
Share on other sites

This one may be of interest.

https://www.youtube.com/watch?v=4btW5x_clpg

On a very low spec machine.server, have my router , netboot and a few other low spec containers.

The main OS is a hypervisor called proxmox.

There is an LXC container with ubuntu.
On there, installed netboot.
I have a few local assets - rescuezilla, bootrepair, systemrescue & ubuntu 22.04.

My router is opnsesne, where there are a few minor config alterations in there to use it.

Main Machine: CPU: 5800X3D  RAM: 64GB  GPU: RTX 3080  M/B: ASUS B550-E Storage: 2 x 256GB NVME boot, 4 TB NVME OS: Windows 10, Ubuntu 22.04

Server1:  Dell optiplex 3060  micro  CPU: i5-8500T  RAM: 32GB OS: Proxmox  Virtual Machines: Opnsense,  Ubuntu, Windows LXC containers: netboot server, jellyfin, lancache

Server2: CPU: i7-3770  RAM: 32GB M/B Z77 extreme6   OS:  Truenas scale (16TB logical storage)

Link to post
Share on other sites

@soccermomisqueen

 

Okay look, I am being overwhelmed. Lets do this slowly.

 

These are my alterations in my /etc/dnsmasq.conf -

Spoiler

interface=eth0
dhcp-range=192.168.0.50,192.168.0.150,12h
dhcp-boot=pxelinux.0
enable-tftp
tftp-root=/srv/tftp

 

I am planning to use the inbult TFTP server in dnsmasq. The Oracle docs show that the Kernel and the initramfs should be under my <tftp-root>/<dhcp-boot>/? So would that be /srv/tftp/pxelinux/vmlinuz-linux and initrd.img?

 

According to ChatGPT I did nothing like this, and that is why it is not working of course. I just copied my iso to srv/tftp and that's it.

 

EDIT - Wait a second, I am trying to use the UEFI based network boot. So do I still need SysLinux according to the Oracle docs? Like I need some firmware, no?

PLEASE MARK COMMENTS AS SOLUTION IF SATISFIED!!

bigger number better, makes me look cooler.

Link to post
Share on other sites

49 minutes ago, Gat Pelsinger said:

According to ChatGPT

Stop using autocomplete as a primary source, you're only going to run yourself in circles.

 

Read some real documentation and guides written by humans who actually know what they're doing. 

I sold my soul for ProSupport.

Link to post
Share on other sites

41 minutes ago, Needfuldoer said:

Stop using autocomplete as a primary source, you're only going to run yourself in circles.

 

Read some real documentation and guides written by humans who actually know what they're doing. 

Yeah so I am trying to do that. I don't know why you people hate ChatGPT that much. You would probably know that I am not with that mindset like "Oh ChatGPT said that so it must be correct". When I do not know anything about something, of course I would go to ChatGPT. You have no idea how much helpful it has been to me since its release, and I think for you too. It's just sometimes it can get stuff wrong and that is understandable. But it is always worth it to use it as a first step.

PLEASE MARK COMMENTS AS SOLUTION IF SATISFIED!!

bigger number better, makes me look cooler.

Link to post
Share on other sites

@Gat Pelsinger

Sorry about my late reply, I fell off of the face of the earth looking for a new job.

 

On 5/3/2024 at 6:07 AM, Gat Pelsinger said:

These are my alterations in my /etc/dnsmasq.conf -

Looks to be pretty standard alterations. to the DNSMasq config.

 

I am planning to use the inbult TFTP server in dnsmasq. The Oracle docs show that the Kernel and the initramfs should be under my <tftp-root>/<dhcp-boot>/? So would that be /srv/tftp/pxelinux/vmlinuz-linux and initrd.img? 

This would be correct. You need to extract the kernel (which is the vmlinuz-linux) and the ramdisk (initramfs) into the folder that you specified (/srv/tftp/pxelinux/).

 These files will be referenced in the bootloader configuration file (which is PXELINUX for BIOS, or if you decide to netboot GRUB for UEFI)
 

Quote

EDIT - Wait a second, I am trying to use the UEFI based network boot. So do I still need SysLinux according to the Oracle docs? Like I need some firmware, no?

The BIOS implementation Should work (tm), but if that does not work, then you will have to use a firmware file that can PXE boot for a UEFI system (GRUB is the most common). This "firmware" file (it is really your bootloader) is the pxelinux.0 file that you specified in the DNSMasq config file.

 

The PXE part is only half of the battle. Since you are trying to boot from an ISO, you have to do a TON of manual work to get all of the related files onto an accessible network-based medium. Most of it is going to be making sure that the files are properly extracted from the ISO (or you could try and mount it to the server, and attempt to get the files that way,  but that can just cause a world of pain with mismatched permissions).

 

Quote

According to ChatGPT I did nothing like this, and that is why it is not working of course. I just copied my iso to srv/tftp and that's it

1) this technology is very sparsely used on the internet, and it is not something that I would put a candle to ChatGPT to (especially when you are dealing with a DHCP server that could be conflicting with the one built in on your router).

2) you cannot pass the ISO through tftp as the PXE client is looking for a file that it can use as a bootloader, and the ISO file is just seen as a random file with no specific meaning (yes I do realize that you can boot from the ISO, but your computer has no friggin clue what to do with it).

 

 

Further steps:

1) try and see if you can get a standard netboot image working first (before going to extracting the arch ISO). I would use debian for this (here is a ink to download it under the network boot section: https://www.debian.org/distrib/netinst)

2) once you get this to work, make an attempt to replace the OS files for Debian with the ones for Arch, and possibly alter the configuration file to work with the linux kernel parameters that you need

 

My current PXELINUX file structure

 

tftp root: `/srv/tftp/`

dhcp-boot: `pxelinux.0`

tftp configuration file (this is baked into the PXELINUX firmware): /srv/tftp/pxeelinux.cfg/default

// this is for RS-232 Serial output of the terminal. specifies port 1 and baud rate of 115200
SERIAL 1 115200
// this is the location of the additional firmware files for PXELINUX relative to the tftp root (AKA the *.c32 files)
PATH boot/isolinux/
// load the UI file for a simple menu
UI boot/isolinux/menu.c32
// set the no-action timeout
TIMEOUT 100
// if the timeout gets hit, then boot into the "linux" menu option
ONTIMEOUT linux

// define the "linux" menu option
LABEL linux
	MENU LABEL Debian Linux
    // this is the path to the linux kernel relative to the tftp root
    KERNEL debian/vmlinuz
    // this will append these kernel parameters onto the startup of the kernel. NOTE: I am using NFS as my storage root, but that may be different for you
    // the initrd path is relative to the TFTP root
    APPEND root /dev/nfs initrd=debian/initrd.img nfsroot=[nfs_share] ip=dhcp rw

This should at least get you started, and let you have a good idea on where you are going.

Link to post
Share on other sites

On 5/3/2024 at 11:07 AM, Gat Pelsinger said:

@soccermomisqueen

 

Okay look, I am being overwhelmed. Lets do this slowly.

 

These are my alterations in my /etc/dnsmasq.conf -

  Reveal hidden contents

interface=eth0
dhcp-range=192.168.0.50,192.168.0.150,12h
dhcp-boot=pxelinux.0
enable-tftp
tftp-root=/srv/tftp

 

I am planning to use the inbult TFTP server in dnsmasq. The Oracle docs show that the Kernel and the initramfs should be under my <tftp-root>/<dhcp-boot>/? So would that be /srv/tftp/pxelinux/vmlinuz-linux and initrd.img?

 

According to ChatGPT I did nothing like this, and that is why it is not working of course. I just copied my iso to srv/tftp and that's it.

 

EDIT - Wait a second, I am trying to use the UEFI based network boot. So do I still need SysLinux according to the Oracle docs? Like I need some firmware, no?

Incidentally if you ARE trying to boot an ISO this way, there is https://www.iventoy.com/en/index.html

ASUS B650E-F GAMING WIFI + R7 7800X3D + 2x Corsair Vengeance 32GB DDR5-6000 CL30-36-36-76  + ASUS RTX 4090 TUF Gaming OC

Router:  Intel N100 (pfSense) Backup: GL.iNet GL-X3000/ Spitz AX Switches: Netgear MS510TXUP, MS510TXPP, GS110EMX
WiFi6: Zyxel NWA210AX (1.7Gbit peak at 160Mhz) WiFi5: Ubiquiti NanoHD OpenWRT (~500Mbit at 80Mhz)
ISPs: Zen Full Fibre 900 (~930Mbit down, 115Mbit up) + Three 5G (~1200Mbit down, 115Mbit up, variable)
Upgrading Laptop/Desktop CNVIo WiFi 5 cards to PCIe WiFi6e/7

Link to post
Share on other sites

10 minutes ago, Alex Atkin UK said:

Incidentally if you ARE trying to boot an ISO this way, there is https://www.iventoy.com/en/index.html

If only I knew about this 2 years ago before I started the 40 hour venture down network booting (there is really no information about PXE that is easy to follow)...

 

 

You have caused me to learn something new today 🙂

Link to post
Share on other sites

22 minutes ago, soccermomisqueen said:

If only I knew about this 2 years ago before I started the 40 hour venture down network booting (there is really no information about PXE that is easy to follow)...

 

 

You have caused me to learn something new today 🙂

To be fair I think its only existed for a year and I only found out about it a few months ago, haven't gotten it setup yet.

ASUS B650E-F GAMING WIFI + R7 7800X3D + 2x Corsair Vengeance 32GB DDR5-6000 CL30-36-36-76  + ASUS RTX 4090 TUF Gaming OC

Router:  Intel N100 (pfSense) Backup: GL.iNet GL-X3000/ Spitz AX Switches: Netgear MS510TXUP, MS510TXPP, GS110EMX
WiFi6: Zyxel NWA210AX (1.7Gbit peak at 160Mhz) WiFi5: Ubiquiti NanoHD OpenWRT (~500Mbit at 80Mhz)
ISPs: Zen Full Fibre 900 (~930Mbit down, 115Mbit up) + Three 5G (~1200Mbit down, 115Mbit up, variable)
Upgrading Laptop/Desktop CNVIo WiFi 5 cards to PCIe WiFi6e/7

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×