Tip: Install OS via netboot.xyz without ISO support

ehabehab Content Writer
edited March 2022 in LES Talk

It can happen your vm provider has a broken iso mount or does not support it at all. You can install your OS using netboot.xyz the following way:

1- Have your vm already installed with one of the provided templates e.g: debian 9. ssh into your vm as root install the ipxe package:

# apt-get install ipxe
# update-grub

Get your ip, gateway from your vm info email, provider cp or on debian this way and store it as it will be needed later.

# cat /etc/network/interfaces
or
# ip r

# reboot

2- From your vnc or console, you should be able to see similar grub menu

after you press enter then quickly keep pressing CTRL+B ,or you can set to boot from CD only in you cp... then you should

enter your ip info you stored from the above step 1 like show in next image

if your vm supports ipv6 then it may try to configure it so you press enter like shown:

let it boot and should be good :)

I wrote this article when i got a HH vm and uploading iso is broken at time of this article.

References :
1- https://unix.stackexchange.com/questions/190865/is-it-possible-to-add-some-pxe-network-boot-option-to-grub
2- http://www.panticz.de/Install-GRUB-iPXE-netboot

Comments

  • ehabehab Content Writer
    edited December 2020

    @AnthonySmith @vyas @Ympker @Not_Oles @Mason

    hopefully this will help all the HH iso lost souls.

  • YmpkerYmpker OGContent Writer

    Looking nice mate :)

    Thanked by (1)ehab
  • ehabehab Content Writer

    wish i knew how to do this since 3 years ago.

  • vyasvyas OGRetired
    edited December 2020

    @ehab said:
    wish i knew how to do this since 3 years ago.

    Don't we all ?
    :-)
    Nice and short How To btw

    p.s

    Upgraded to Debain Bullseye while moving from Debian 9, lack of coffee is my excuse

    Thanked by (1)ehab
  • InceptionHostingInceptionHosting Hosting ProviderOG
    edited December 2020

    @ehab said:
    wish i knew how to do this since 3 years ago.

    I wish I knew how to do this 3 days ago...

    Thanked by (2)ehab Asim

    https://inceptionhosting.com
    Please do not use the PM system here for Inception Hosting support issues.

  • Not_OlesNot_Oles Hosting ProviderContent Writer

    I like it! :) Congrats!

    Thanked by (1)ehab
  • InceptionHostingInceptionHosting Hosting ProviderOG

    Thanks for the guide @ehab

    https://inceptionhosting.com
    Please do not use the PM system here for Inception Hosting support issues.

  • Thanks for the guide. It is illustrative and done easy step by step

    Thanked by (1)ehab

    Dentistry is my passion

  • mikhomikho AdministratorHosting ProviderOG

    thanks alot!
    This finally made it possible for me to install my OS on an old Dedicated server.

    Follow up tip, if you have a IPMI or iLo that messes with you.
    I installed Centos, selected the text-based installation and was then asked if I wanted a VNC server started instead of running the text-based installation.

    Much faster and more stable then my "broken" IPMI.

    Thanked by (1)ehab
  • aRNoLDaRNoLD OG
    edited December 2020

    Imgur

    Unlucky, that's what I experience from Vultr.

    System halt...

  • ehabehab Content Writer

    @aRNoLD said:

    did you try another booting another os?

  • @ehab said:

    @aRNoLD said:

    did you try another booting another os?

    No, I copied from the thread. Debian OS is my fav and recently deployed. If Debian fails, users around the globe may encounter the same issue. Probably Vultr has sth. wrong.

  • Arch won't work out it seems

  • cybertechcybertech OGBenchmark King

    is there a Centos version of this?

    I bench YABS 24/7/365 unless it's a leap year.

  • ehabehab Content Writer

    @cybertech said:
    is there a Centos version of this?

    not sure, but you can add the kernel and update the grub yourself.

    Thanked by (1)cybertech
  • cybertechcybertech OGBenchmark King

    @ehab said:

    @cybertech said:
    is there a Centos version of this?

    not sure, but you can add the kernel and update the grub yourself.

    Thanks, used Debian 9 instead and followed this guide. Works pefect :D

    Thanked by (1)ehab

    I bench YABS 24/7/365 unless it's a leap year.

  • aRNoLDaRNoLD OG
    edited March 2021

    @cybertech said:
    is there a Centos version of this?

    guess the following two lines could do the job ( and the third to finalize the boot menu). you may have to adjust the GRUB_TIMEOUT value, making it larger so the screen may stop for a while rather than splash away when you get into the VNC.

    sudo wget https://boot.netboot.xyz/ipxe/netboot.xyz.lkrn -O /boot/netboot.xyz.lkrn
    
    sudo sed -i '$a menuentry "Boot from http://netboot.xyz" {\n\ \ \ \ linux16 /boot/netboot.xyz.lkrn\n}' /etc/grub.d/40_custom
    
    sudo grub2-mkconfig -o /boot/grub2/grub.cfg && sudo reboot
    
    Thanked by (1)ehab
  • it looks CloudCone's VPS/KVM doesn't support this booting method. have updated grub and menu but when rebooting there's no ipxe item on the screen. guess theirs are not compatible.

  • ehabehab Content Writer
    edited March 2021

    @aRNoLD said:

    install debian
    then

    # apt-get install ipxe
    # grub-reboot "Network boot (iPXE)"
    # reboot
    

    have vnc open and this should get into the ipxe boot, try it.

  • apt install ipxe produce the following output

    Unpacking ipxe (1.0.0+git-20190125.36a4c85-1) ...
    Setting up ipxe (1.0.0+git-20190125.36a4c85-1) ...
    Searching for GRUB installation directory ... found: /boot/grub
    Searching for default file ... found: /boot/grub/default
    Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
    Searching for splash image ... none found, skipping ...
    Found kernel: /boot/vmlinuz-4.19.0-14-amd64
    Found kernel: /boot/vmlinuz-4.19.0-5-amd64
    Updating /boot/grub/menu.lst ... done
    

    the second line, grub-reboot "Network boot (iPXE)" produced the following

    Searching for GRUB installation directory ... found: /boot/grub
    Probing devices to guess BIOS drives. This may take a long time.
    
        GNU GRUB  version 0.97  (640K lower / 3072K upper memory)
    
           [ Minimal BASH-like line editing is supported.   For
             the   first   word,  TAB  lists  possible  command
             completions.  Anywhere else TAB lists the possible
             completions of a device/filename. ]
    grub> savedefault --once --default=Network boot (iPXE)
    
    Error 23: Error while parsing number
    grub> quit
    
    Do you want to reboot now? [y/N]
    

    then from the splash screen, it said "Falling back to Grub Legacy" and then gave only four options of original OS/Debian booting, but without ipxe options.

    guess CloudCone doesn't support ipxe booting?

  • ehabehab Content Writer

    @aRNoLD is it a kvm? just asking since you grabbed all the text! how did you do that :)

  • aRNoLDaRNoLD OG
    edited March 2021

    @ehab said:
    @aRNoLD is it a kvm? just asking since you grabbed all the text! how did you do that :)

    https://imgur.com/a/AQf6272

    Yes, the control panel shows its platform is KVM. That's one point that I feel weird.

    the text is copied from SSH terminal.

  • ehabehab Content Writer

    i have some credit with them, when i get time i will try to have me some fun.

  • I noticed that some Live CDs or even network boot won't really boot at all and just stucks at the initramfs fallback terminal or even kernel panic
    on static IP configuration, must be something, or probably they need DHCP to work

  • ehabehab Content Writer

    @valkyrie said:

    if the provider does not have DHCP you must manually add those in the boot menu command line "press e" or at the seed file. But if you get a kernel panic then either ram is not enough or you are an unlucky b* :) j/k

  • @ehab said:

    @valkyrie said:

    if the provider does not have DHCP you must manually add those in the boot menu command line "press e" or at the seed file. But if you get a kernel panic then either ram is not enough or you are an unlucky b* :) j/k

    Okay will def trying that later to see it works

  • @cybertech said:
    is there a Centos version of this?

    yum install ipxe-bootimgs
    

    or maybe, it depends

    yum install efibootmgr
    

    but I am not sure how to run them, the specific commands.

    from URL: https://rpmfind.net/linux/RPM/centos/7.9.2009/x86_64/Packages/ipxe-bootimgs-20180825-3.git133f4c.el7.noarch.html , and you'll see there are several files

    /usr/share/doc/ipxe-bootimgs-20180825
    /usr/share/doc/ipxe-bootimgs-20180825/COPYING
    /usr/share/doc/ipxe-bootimgs-20180825/COPYING.GPLv2
    /usr/share/doc/ipxe-bootimgs-20180825/USAGE
    /usr/share/ipxe
    /usr/share/ipxe/ipxe-snponly-x86_64.efi
    /usr/share/ipxe/ipxe.dsk
    /usr/share/ipxe/ipxe.efi
    /usr/share/ipxe/ipxe.iso
    /usr/share/ipxe/ipxe.lkrn
    /usr/share/ipxe/ipxe.usb
    /usr/share/ipxe/undionly.kpxe

  • Holy Necro!

    Thanked by (1)bdl

    It wisnae me! A big boy done it and ran away.
    NVMe2G for life! until death (the end is nigh)

  • edited December 2022

    @AlwaysSkint said:
    Holy Necro!

    ... but a very timely one for me! I am so happy it appeared! I have been working on this exact same problem all week.

    -> Check out the netboot.xyz website. They have automated many of the steps described above. It is one of the "projects" that I have been working on for the past week.

    GOALS:
    My goal is to boot the Debian 11 installer in a KVM VPS (to install Debian), where the installer is booted over the internet from another of my VPSs. I can do it now, but with the installer booted from netboot.xyz's server, not my server.
    Once I have that figured out, I want to integrate the solution with the dropbear ssh server, to see if there is a way to perform a Debian installation from my own trusted source without using the provider's VNC console. It is not clear that it can be done, but I want to see for myself.

    WHAT WORKS FOR ME SO FAR:

    • I have already tested unlocking a whole-disk-encrypted KVM VPS through the dropbear ssh server. Tested on a local virtual machine testbed and a KVM VPS.
    • I have also tested booting a Debian installer over the internet using netboot.xyz's website and method. Also tested on a local virtual machine testbed and a KVM VPS. See the procedure, next.

    WORKING PROCEDURE THAT I FOLLOWED - THIS WILL WORK FOR YOU TOO:
    Go to this website:
    https://netboot.xyz
    Look at Docs -> Booting Methods -> Booting from Grub:
    https://netboot.xyz/docs/booting/grub
    NOTE: To make this procedure work on a KVM VPS, I had to use the provider's VNC console. My ultimate goal is to bypass the VNC console and do everything over SSH, but for now, it works.
    STEPS:

    • Install a throwaway Debian on your target system. Nothing fancy, just enough to boot. (NOTE: Write down your target system's IP address, netmask, gateway, and DNS server configuration. You may need it later.)
    • Follow the steps in the "grub" link above. When you reboot, you will see a new menu item in grub: "*Bootable ISO Image: netbook.xyz"
    • Press the "m" key at the appropriate time to load the menu.
    • You may have to enter your system's IP address, netmask, gateway, and DNS settings manually. I tested that too, and it is easy.)
    • A new menu should appear from the netboot.xyz website. Choose Linux Network Installs (64-bit).
    • Choose the distro you want (for me: Debian), and follow the sub-menus, if any (e.g., Debian->Debian 11.0 (bullseye))->[type of install - Text, Graphical, etc.]
    • The installer runs and you're on your way.

    NEXT STEPS:
    I am lost in the weeds, trying to figure out how to create and configure my own version of the netboot.xyz.iso menu that appears in grub, but one that points to my own server instead of netboot.xyz. I would not mind eliminating options I do not need, too.

    I built the netboot.xyz website (without changing any configuration files) on my server, following the Self Hosting (Ansible) instructions on the netboot.xyz website. The generic netboot.xyz website webpage appears on my server, but not yet customized with my settings.

    So ... thanks for resurrecting this thread.

    -> Any help or suggestions from others will be appreciated.

    P.S. I understand the security aspects of this, but I still want to figure out how to make it work. Yes, I know that the VPS provider has ultimate power over my VPS and can do anything they want without detection. I get it. I hope this discussion stays on track about how to make this work. If you want to talk about the security aspects, please open a new thread.

    P.P.S. The original "necro'd" comment that triggered this post has disappeared, but I would still appreciate the help from others. Any hints and ideas about how to bring my work to fruition would be appreciated.

  • Bump. The weekend is past us, and maybe someone will notice this thread and show interest or take pity.

    See my post above. Feel free to join in or send me a PM if you have experience (with netboot.xyz and iPXE in particular) and are willing to answer basic questions. Thanks!

Sign In or Register to comment.