NETBOOT Alpine Linux using Alpine Linux! PXE Boot Server Setup

Sdílet
Vložit
  • čas přidán 13. 09. 2024

Komentáře • 62

  • @Mikesco3
    @Mikesco3 Před 2 lety +8

    This channel is so underrated

  • @joshpatten
    @joshpatten Před 2 lety +5

    Really cool to see you taking this to the next level, I'll definitely be looking out for your next video to get all the details for getting this set up!

    • @apalrdsadventures
      @apalrdsadventures  Před 2 lety +2

      Thanks! Your client program has certainly been very useful for this

  • @gearboxworks
    @gearboxworks Před rokem +1

    Watching your videos is like taking a sip from a fire hydrant! I am in awe of your knowledge.
    But keep em' coming, if I watch enough of them I'm sure I will eventually be able to follow it all!!! 😮

  • @jeffbrl
    @jeffbrl Před 5 měsíci

    Great video. Alpine's APK overlay seems like an interesting alternative to NFS root for persistence.

    • @apalrdsadventures
      @apalrdsadventures  Před 4 měsíci

      It's a way to initialize the system to a known and configurable state, but doesn't have long-term persistence. Every reboot goes back to the overlay.

  • @W1ldTangent
    @W1ldTangent Před 2 lety

    Noice, now we're talking 😎 I look forward to further adventuring into the world of network-booted appliances and infrastructure.

    • @apalrdsadventures
      @apalrdsadventures  Před 2 lety +1

      Well up next in this series is the PVE VDI Client, and I'm thinking Remmina seems like a popular thin client appliance as well (for RDP).

    • @W1ldTangent
      @W1ldTangent Před 2 lety

      @@apalrdsadventures and I am absolutely here for it. Keep it up, I like where this is going, Remina is one I've not used very much but I have colleagues that swear by it. It is extremely flexible and configurable.

    • @apalrdsadventures
      @apalrdsadventures  Před 2 lety

      I've used it a bit, but normally I just use ssh for Linux management anyway. It would pair well with my terminal server though, less resources than a VM per user.

  • @blevenzon
    @blevenzon Před 2 lety +1

    Did I mention I love this channel

  • @przemek831
    @przemek831 Před 4 měsíci

    Love it. I am planning to set something similar to what you did with RPi and different usernames. I need to figure out first how to boot the system with home directories on NAS so nothing is stored on a local system or possibly boot RPi thin client without SD card.

  • @ruijieyu9035
    @ruijieyu9035 Před rokem +2

    14:23 you said that tftp is running as root and chroot’d under /var/tftpboot. I haven’t tested this, but if it can mount /proc, I believe it can also do something like “chroot /proc/1/root” to escape the chroot?

  • @callisoncaffrey
    @callisoncaffrey Před rokem +2

    You confuse me. You do the git hub and the scripting, but then you use nano and opensense.

  • @jfairplane8520
    @jfairplane8520 Před rokem

    This is quite great. I wonder if you may also share the proxmox backup of this lxc ? That can be quite handy and fully working directly ;)

  • @Cynyr
    @Cynyr Před rokem

    riny nitpick here, but i'm pretty sure that alpine install came with Vi out of the box. no "need" to install nano. I found alpine a few months back and it feels a lot like gentoo from the mid 00's, super small, super fast, nice and small and customizable.

    • @apalrdsadventures
      @apalrdsadventures  Před rokem

      I didn't even try vi, just went to nano expecting it to be smaller and more Alpine's style

  • @DiyintheGhetto
    @DiyintheGhetto Před 2 lety +2

    My question is are you installing the OS on the disks that are on each thin client, or running a diskless boot?

    • @apalrdsadventures
      @apalrdsadventures  Před 2 lety +4

      Purely diskless. Kernel + initrd + modloop + apkovl all get downloaded into RAM over HTTP, then Alpine re-installs any packages that should be installed by going out to the repository. So the entire system is in RAM, there isn't even an NFS mount backend.
      Alpine has a boot mode where it does the same thing off disk, it loads the kernel and initrd and then only var and home are actually mounted from disk. Changes made to the system have to be committed back manually. The program that does this commit (lbu) can also generate a .tar.gz of the system, which is the APK Overlay I'm using here and will walk through the creation of in the next video.

  • @leschi1112
    @leschi1112 Před 7 měsíci

    Hi, great tutorial. but i have sadly one problem, if i boot from a vm i get the error "/sbin/init not found in new root". Do you have any idea about this?

  • @singaravelanpalani3713
    @singaravelanpalani3713 Před 2 měsíci

    Dear apalrd's adventures,
    thanks for sharing your Knowledge Here..
    I also followed your videos , i setup dhcp in same server itself, client system also booted.
    after boot i got a only CLI.
    I am looking for GUI open Firefox browser with Kiosk Mode. How to achieve.
    I tried multiple way not up after boot its crash..

    • @apalrdsadventures
      @apalrdsadventures  Před 2 měsíci

      This video only shows the server setup, so you get a default Alpine system. I have another video which shows how I setup a client to use an 'apk overlay' file to pre-configure the client when it boots up. In that video, I set it up as a remote desktop client, but you could install and launch Firefox instead by changing the script.

  • @tcovos
    @tcovos Před 2 lety +2

    Eu tenho um sistema assim utilizando o LTSP com debian e os terminais com raspberry’s

    • @apalrdsadventures
      @apalrdsadventures  Před 2 lety +1

      LTSP works well if you need network storage, but for appliances where there should be no change to the filesystem this method is simpler and avoids NFS entirely. Alpine also uses less RAM in general, vs Debian.

  • @navedwaris2363
    @navedwaris2363 Před rokem

    Hello brother,u did a very good job,but got stuck in making pxe boot over http in clonezilla as it supports both tftp & http,As of now in ubuntu i made pxe boot on tftp but it takes a lot of time i want to make it over http please respond & help me

  • @Konrad_Adenauer
    @Konrad_Adenauer Před rokem

    Hello, I have a question:
    Can I rent a dedicated server and boot the alpine Linux OS from home, using netboot?

    • @apalrdsadventures
      @apalrdsadventures  Před rokem +1

      In general TFTP (which is needed in the early boot process) doesn't do well over the internet. That said, if you can host the TFTP part on your local network, the rest of it could be booted over HTTP over the internet.

  • @62AliCan
    @62AliCan Před rokem

    How would I go about, instead of downloading the image everytime I start the machine from the defined repo, I would make it available on the netboot server and get it from there - 18:55 is what Im talking about

    • @apalrdsadventures
      @apalrdsadventures  Před rokem

      If you have a local copy of the repo you can change the repo to point to your own HTTP server. The entire Alpine repo isn't small, so you might be better using an HTTP caching server.

    • @62AliCan
      @62AliCan Před rokem

      @@apalrdsadventures i have yet to figure out how to do it correctly, first how can I get an copy of the whole 3.17 repo, maybe you give me a bit of an guidance of where to look. thank you in advance

    • @apalrdsadventures
      @apalrdsadventures  Před rokem

      You can setup a basic http cache to point to their repo, and it will cache on demand. The whole repo is over 100G, so you probably don't want the whole thing, just what you are using.

  • @IBITZEE
    @IBITZEE Před 2 lety

    wouldn't be more performant if we install all the stuff we need in a thin vm...
    then collect all the installed stuff into a initrd/initramfs file (makecpio/dracut)...
    in the ipxe boot process push this into memory (from the ipxe script,,,)
    and launch vmlinuz against this memory image...

    • @apalrdsadventures
      @apalrdsadventures  Před 2 lety

      It depends on what your goals are. If you want to run the system entirely out of RAM, then it will have to be loaded at some stage. Alpine specifically has some additional tools (apkovl namely) to make this easier, which I relied on here.
      So in this setup, we are loading vmlinuz and a basic initrd over http (which is fast), then Alpine is loading the apkovl over http (which is fast), then it's installing all of the packages to rebuild the system using apk (going out to the mirror). It would boot faster if the mirror was faster, so caching the mirror locally would speed up the process without adding any extra steps, and a local Alpine mirror would mean we can use multiple apkovl's to configure multiple systems with their own tiny images and they would all share the same mirror.
      If you don't want to run entirely from RAM, then mounting a root filesystem over nfs would make more sense.

  • @maka5955
    @maka5955 Před 2 lety

    Some 64bit system have 32bit efi. Example Linx7 tablet.

    • @apalrdsadventures
      @apalrdsadventures  Před 2 lety

      Can you force them into legacy BIOS boot? AFAIK legacy BIOS always loads as 32-bit protected mode (or even 16-bit real mode) and then it's up to the OS to switch into long mode, whereas EFI will already be in long mode if the OS is 64 bit

    • @W1ldTangent
      @W1ldTangent Před 2 lety

      Those are thankfully rare beasts, but found more often in thin-client or other low-end hardware. I had an Asus Transformer with the same issue, and it wouldn't even do BIOS fallback.

    • @maka5955
      @maka5955 Před 2 lety

      On those Linx7 tablets, the only option was to add bootia32.efi to 64-bit Linux. But as mentioned, these are thankfully not very many.

  • @chkpwd
    @chkpwd Před 2 lety

    Can iPXE be used to image custom windows 10 images? Like an image with already installed applications? Or will batch scripts always have to be used post install?

    • @apalrdsadventures
      @apalrdsadventures  Před 2 lety +2

      You can do it, but not using iPXE alone.
      The steps would basically be:
      1. Install Windows in a VM, set it up as you want
      2. Run sysprep to convert it to a template (removing machine-specific details for the next boot)
      3. Convert the VM disk image to a raw image so it can be copied onto the client
      4. Load something via iPXE such as Linux which can load the disk image and copy it to the local disk
      5. Boot into the system and expand the filesystem to fill the whole disk

    • @chkpwd
      @chkpwd Před 2 lety

      @@apalrdsadventures Thank you for all the great work! Looking forward to more stuff and your channel growing!

    • @apalrdsadventures
      @apalrdsadventures  Před 2 lety

      Thanks! For anything Linux based I'm sure I could help more, but Windows does things its own way.

    • @ChrisAnderson23
      @ChrisAnderson23 Před 2 lety

      There is a PXE boot and install system that is rolled into Windows Server called Windows Deployment Server.

  • @ultronzeon1759
    @ultronzeon1759 Před 2 lety

    Sir i would like to create a remmina kiosk..
    I searched a lot but reached any where.
    Please can you help me?

    • @apalrdsadventures
      @apalrdsadventures  Před 2 lety

      Part 2 of this video is setting up the thin client using Alpine, and generating the aplovl file. So I finish producing / editing that, it'll include more of the information you need to get an Alpine system setup and running as a kiosk (but for PVE-VDIClient instead of Remmina). From there I can help you substitute the VDI client for Remmina.

    • @ultronzeon1759
      @ultronzeon1759 Před 2 lety

      @@apalrdsadventures thank you sir!

  • @AdrianuX1985
    @AdrianuX1985 Před 2 lety

    +1

  • @sukardiLayarda
    @sukardiLayarda Před 2 lety

    it a good video tutorial but i got problem.. when netbooting i got error message wget: server returned error http/1.1 404 not found how to solve this problem thank you...

    • @apalrdsadventures
      @apalrdsadventures  Před 2 lety

      Not finding the apkovl file? There's a whole video on how to generate that file

    • @sukardiLayarda
      @sukardiLayarda Před 2 lety

      @@apalrdsadventures I will more specific,
      Apkovl://192.xxx.xx /thinclient.opkovl.tar.gz
      Http;//192.xx.xx/boot/vmlinux-lts.. ok
      Http:/192.XXX/inittramfs-lts.. ok
      Udhcpc: started
      .
      .
      Wget: server returned error
      This the problem
      grep: /sysroot/etc/inittab: no such file or directory
      /sbin/init not found in new root
      I searched in internet n not found the solution..
      maybe u can help.. thank you..

  • @idjdbrvvskambvvv9007
    @idjdbrvvskambvvv9007 Před rokem

    im on alpine now apk is ffin fasst

  • @SkiTuMTuM
    @SkiTuMTuM Před rokem

    hi im getting stuck at building ipxe. this the error im getting
    " [BUILD] bin-i386-pcbios/gdbserial.o
    [BUILD] bin-i386-pcbios/gdbstub.o
    [BUILD] bin-i386-pcbios/gdbudp.o
    In file included from include/string.h:23,
    from core/gdbudp.c:27:
    In function '__constant_memcpy',
    inlined from 'memcpy' at arch/x86/include/bits/string.h:168:10,
    inlined from 'gdbudp_send' at core/gdbudp.c:206:2,
    inlined from 'gdbudp_send' at core/gdbudp.c:163:13:
    arch/x86/include/bits/string.h:94:44: error: array subscript 'const union [0]' is partly outside array bounds of 'uint8_t[6]' {aka 'unsigned char[6]'} [-Werror=array-bounds]
    94 | dest_u->u32[0] = src_u->u32[0];
    | ~~~~~~~~~~^~~
    core/gdbudp.c: In function 'gdbudp_send':
    core/gdbudp.c:53:16: note: object 'dest_eth' of size 6
    53 | static uint8_t dest_eth[ETH_ALEN];
    | ^~~~~~~~
    In function '__constant_memcpy',
    inlined from 'memcpy' at arch/x86/include/bits/string.h:168:10,
    inlined from 'gdbudp_send' at core/gdbudp.c:206:2,
    inlined from 'gdbudp_send' at core/gdbudp.c:163:13:
    arch/x86/include/bits/string.h:95:44: error: array subscript 'const union [0]' is partly outside array bounds of 'uint8_t[6]' {aka 'unsigned char[6]'} [-Werror=array-bounds]
    95 | dest_u->u16[2] = src_u->u16[2];
    | ~~~~~~~~~~^~~
    core/gdbudp.c: In function 'gdbudp_send':
    core/gdbudp.c:53:16: note: object 'dest_eth' of size 6
    53 | static uint8_t dest_eth[ETH_ALEN];
    | ^~~~~~~~
    In function '__constant_memcpy',
    inlined from 'memcpy' at arch/x86/include/bits/string.h:168:10,
    inlined from 'gdbudp_recv' at core/gdbudp.c:137:4:
    arch/x86/include/bits/string.h:94:32: error: array subscript 'union [0]' is partly outside array bounds of 'uint8_t[6]' {aka 'unsigned char[6]'} [-Werror=array-bounds]
    94 | dest_u->u32[0] = src_u->u32[0];
    | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
    core/gdbudp.c: In function 'gdbudp_recv':
    core/gdbudp.c:53:16: note: object 'dest_eth' of size 6
    53 | static uint8_t dest_eth[ETH_ALEN];
    | ^~~~~~~~
    In function '__constant_memcpy',
    inlined from 'memcpy' at arch/x86/include/bits/string.h:168:10,
    inlined from 'gdbudp_recv' at core/gdbudp.c:137:4:
    arch/x86/include/bits/string.h:95:32: error: array subscript 'union [0]' is partly outside array bounds of 'uint8_t[6]' {aka 'unsigned char[6]'} [-Werror=array-bounds]
    95 | dest_u->u16[2] = src_u->u16[2];
    | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
    core/gdbudp.c: In function 'gdbudp_recv':
    core/gdbudp.c:53:16: note: object 'dest_eth' of size 6
    53 | static uint8_t dest_eth[ETH_ALEN];
    | ^~~~~~~~
    cc1: all warnings being treated as errors
    make: *** [Makefile.housekeeping:952: bin-i386-pcbios/gdbudp.o] Error 1"
    any help is appreciated

    • @apalrdsadventures
      @apalrdsadventures  Před rokem

      Does it build the 64-bit EFI binaries if you try just that one? I wonder if it's an issue with a newer version of GCC having better error checking. It looks like that particular file (gdbudp.c) hasn't been modified in 8 years, so it's definitely not a code issue.

    • @SkiTuMTuM
      @SkiTuMTuM Před rokem

      @@apalrdsadventures returning an error
      netboot:/srv/ipxe/src# make bin-x86_64-efi/ipxe.efi EMBED=netboot.ipxe
      [BUILD] bin-x86_64-efi/gdbudp.o
      In file included from include/string.h:23,
      from core/gdbudp.c:27:
      In function '__constant_memcpy',
      inlined from 'memcpy' at arch/x86/include/bits/string.h:168:10,
      inlined from 'gdbudp_send' at core/gdbudp.c:206:2,
      inlined from 'gdbudp_send' at core/gdbudp.c:163:13:
      arch/x86/include/bits/string.h:94:44: error: array subscript 'const union [0]' is partly outside array bounds of 'uint8_t[6]' {aka 'unsigned char[6]'} [-Werror=array-bounds]
      94 | dest_u->u32[0] = src_u->u32[0];
      | ~~~~~~~~~~^~~
      core/gdbudp.c: In function 'gdbudp_send':
      core/gdbudp.c:53:16: note: object 'dest_eth' of size 6
      53 | static uint8_t dest_eth[ETH_ALEN];
      | ^~~~~~~~
      In function '__constant_memcpy',
      inlined from 'memcpy' at arch/x86/include/bits/string.h:168:10,
      inlined from 'gdbudp_send' at core/gdbudp.c:206:2,
      inlined from 'gdbudp_send' at core/gdbudp.c:163:13:
      arch/x86/include/bits/string.h:95:44: error: array subscript 'const union [0]' is partly outside array bounds of 'uint8_t[6]' {aka 'unsigned char[6]'} [-Werror=array-bounds]
      95 | dest_u->u16[2] = src_u->u16[2];
      | ~~~~~~~~~~^~~
      core/gdbudp.c: In function 'gdbudp_send':
      core/gdbudp.c:53:16: note: object 'dest_eth' of size 6
      53 | static uint8_t dest_eth[ETH_ALEN];
      | ^~~~~~~~
      In function '__constant_memcpy',
      inlined from 'memcpy' at arch/x86/include/bits/string.h:168:10,
      inlined from 'gdbudp_recv' at core/gdbudp.c:137:4:
      arch/x86/include/bits/string.h:94:32: error: array subscript 'union [0]' is partly outside array bounds of 'uint8_t[6]' {aka 'unsigned char[6]'} [-Werror=array-bounds]
      94 | dest_u->u32[0] = src_u->u32[0];
      | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
      core/gdbudp.c: In function 'gdbudp_recv':
      core/gdbudp.c:53:16: note: object 'dest_eth' of size 6
      53 | static uint8_t dest_eth[ETH_ALEN];
      | ^~~~~~~~
      In function '__constant_memcpy',
      inlined from 'memcpy' at arch/x86/include/bits/string.h:168:10,
      inlined from 'gdbudp_recv' at core/gdbudp.c:137:4:
      arch/x86/include/bits/string.h:95:32: error: array subscript 'union [0]' is partly outside array bounds of 'uint8_t[6]' {aka 'unsigned char[6]'} [-Werror=array-bounds]
      95 | dest_u->u16[2] = src_u->u16[2];
      | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
      core/gdbudp.c: In function 'gdbudp_recv':
      core/gdbudp.c:53:16: note: object 'dest_eth' of size 6
      53 | static uint8_t dest_eth[ETH_ALEN];
      | ^~~~~~~~
      cc1: all warnings being treated as errors
      make: *** [Makefile.housekeeping:952: bin-x86_64-efi/gdbudp.o] Error 1
      netboot:/srv/ipxe/src#

    • @apalrdsadventures
      @apalrdsadventures  Před rokem

      For the benefit of everyone who might find this in the future: GCC 12 (released with Alpine 3.17 and later) is triggering errors with iPXE. The iPXE devs consider these errors to be false positives (thus a bug in GCC) and haven't pushed any changes on their end yet.
      The workaround with GCC 12 is to add NO_WERROR=1 before make - I've added a node to the blog post with the new commands.
      See ipxe's issue here: github.com/ipxe/ipxe/issues/620

    • @ihatemicrosoftsobadly3188
      @ihatemicrosoftsobadly3188 Před 11 měsíci

      @@apalrdsadventuresfirst of all thank you very much for creating this tutorial. i tried following this tutorial myself for booting the nodes of my home cluster and it unfortunately didn't work for me... probably a stupid mistake on my part but still i can't seem to figure it out so any help would be greatly appreciated! Firstly i am getting an error when attempting to build iPXE for efi. this error is not fixed through the means decribed in your comment unfortunately. specifically the error is:
      [LD] bin-x86_64-efi/ipxi.efi.tmp
      ld:--defsym:2: undefined symbol ''obj_ipxi" referenced in expression
      make: *** [Makefile.housekeeping: 1233: bin-x86_64-efi/ipxi.efi.tmp] Error: 1
      also even when i try to boot a BIOS device(compilation for pcbios worked) from the server i still get an error on the client: PXE E53.
      running tcpdump on the server whilst trying to boot a client from it shows a total of 113 packets captured from the exact output it is fair to assume that the basic DHCP is working.i checked everything i did and even tried redoing the entire thing but after that i am still stuck with this problem. Any hekp would be greatly appreciated! Thanks in advance!

  • @paulmaydaynight9925
    @paulmaydaynight9925 Před 2 lety

    a 'net booted' Pi 4 with PiMox images/openwrt/21.02/arm64/default/20220427_11:58 lxd files for a fun tutorial

    • @apalrdsadventures
      @apalrdsadventures  Před 2 lety

      I'm going to expand this to handle multiple client architectures in a future video, aarch64 / Pi 4 is definitely going to be a tutorial eventually