Decided to write up a quick post on a hacky workaround I came up with for custom distros Oracle free tier and thought I’d share. Don’t rely on Oracle, but definitely do leverage as much of their free compute as you can for non-critical workloads!

    • StarkZarn@infosec.pubOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      20 hours ago

      I am not well versed with kexec but I always understood it to be a kernel reboot without power cycling the “metal.” Please enlighten us with an example! I don’t see how you’d replace the entire userspace (and possibly filesystem) with simply kexec.

      • InnerScientist@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        19 hours ago

        Kexec can be used to load a new kernel and “reboot” quickly, it can also be used to load a new kernel, an initrd and never touch the disk. Such a system lives completely in ram and allows you to modify the disk in any way you want without breaking you running Linux (which is in ram)

        Any distro that has a network boot installer that can be passed to kexec can be installed this way, any that don’t can still kexec any Linux distro and then install any other distro by passing the disk to a VM and installing linux through that.

        You can also kexec the netboot.xyz image and get any distro supported there.

        • StarkZarn@infosec.pubOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          17 hours ago

          The “gotcha” with Oracle free tier is that you can’t install from arbitrary media, so the typical netboot.xyz or any iPXE workflow is out. No console access, no pre-bootloader access, nothing.

          I’ve been fiddling with kexec, but it doesn’t seem like a supported method of loading the lkrn file from netboot…

          This is super interesting to me, so by all means, if you have the kung-fu to show how this works I would happily read through that!

          • InnerScientist@lemmy.world
            link
            fedilink
            English
            arrow-up
            3
            ·
            edit-2
            14 hours ago

            Yeah I tried just now and it diesn’t seem to be working (anymore?) could’ve sworn that worked.

            You can still kexec the installiers directly, I followed the netboot.xyz scripts and got the links they use. Here’s Debian as an example:

            From the scripts: https://deb.debian.org/debian/dists/stable/main/installer-amd64/current/images/netboot/ looking at the boot config debian-installer/amd64/grub/grub.cfg

            submenu '... KDE Plasma desktop boot menu ...' {
                set gfxpayload=keep
                menuentry '... Install' {
                    set background_color=black
                    linux    /debian-installer/amd64/linux desktop=kde vga=788 --- quiet
                    initrd   /debian-installer/amd64/initrd.gz
            

            so we need to download those two files and take the netboot.xyz cmdline arguments then

            $ kexec --command-line="desktop=kde vga=788 mirror/suite=stable initrd=initrd.magic console=ttyS0,115200n8"  --initrd=initrd.gz -l linux´
            $ systemctl kexec
            

            and it boots.

            also here’s an example for the nixos netboot commands, more on that in the nixos manual:

            $ kexec --load bzImage \
              --initrd=initrd.gz \
              --command-line "init=/nix/store/n37nmcvbrblk9ahfzj9nxy01axs7zsf6-nixos-system-nixos-kexec-25.11pre-git/init nohibernate loglevel=4 lsm=landlock,yama,bpf"
            $ systemctl kexec
            

            Edit:

            No console access

            If that means that you can only connect to SSH and have no VGA/video then this will be limited, you could setup an automated install but that requires a lot more knowledge than what your guide requires.

            • StarkZarn@infosec.pubOP
              link
              fedilink
              English
              arrow-up
              2
              ·
              11 hours ago

              Okay this is excellent content, thank you!

              I went through and fiddled with some more stuff to try and get this working to no avail. However, it inspired me to take apart netboot.xyz a bit more, and I was able to grab an efi and get next boot to load the efi file. It took me too long to realize you need the console tty arguments as part of the boot cmdline to get it working interactively, but after I got there I got it netbooted. Sadly though, it almost immediately runs into an OOM condition and thus isn’t practical on a free tier x86 asset. It would probably work on an aarch64 node, but I already have my allotted arm node spun up and working so I don’t have a free one to practice with.

              Solid write-up though, thank you for putting that together!

    • StarkZarn@infosec.pubOP
      link
      fedilink
      English
      arrow-up
      12
      ·
      22 hours ago

      Certainly! As others have said, don’t hang anything worth value on it without an out of band backup strategy, they’re famous for unscrupulously deleting things with no warning. Oracle is a miserable company.

      Free is free though!

      • non_burglar@lemmy.world
        link
        fedilink
        English
        arrow-up
        6
        ·
        edit-2
        18 hours ago

        I haven’t had my instances deleted, but they do some kind of maintenance blip everyday that my monitoring sees as 3 seconds of downtime, so maybe keep that in mind.

        • StarkZarn@infosec.pubOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          20 hours ago

          Interesting. I’ve had two instances running for over 2 years and haven’t noticed that. It might be that I just don’t notice it though. I’m not scrutinizing it much.

          • non_burglar@lemmy.world
            link
            fedilink
            English
            arrow-up
            4
            ·
            18 hours ago

            I’m not scrutinizing it much.

            Same. I just run a Minecraft server for my kid and his friends and a static HTML blog, so I’m ok with it.

            I’m fairly sure it’s a background migration task, and I have a feeling it depends on your region.

    • cmnybo@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      16
      arrow-down
      1
      ·
      1 day ago

      They’ve had it for years. It can be difficult to sign up for though.

      You get a lot of resources for free, but don’t use them for anything important. They can nuke your account for any reason.

    • BlueÆther@no.lastname.nz
      link
      fedilink
      English
      arrow-up
      6
      ·
      1 day ago

      I run my lemmy instance on their free tier, although I do have full account so I can expand for for full backups during upgrade, and also on the pure free tier I couldn’t get all 4 free cores at the closest DC