CloudAtCost Custom OS: Difference between revisions

From eddynetweb's cesspit
Jump to navigation Jump to search
(Moved to new page.)
m (Clarification of procedures.)
 
(8 intermediate revisions by 2 users not shown)
Line 25: Line 25:
* Ubuntu
* Ubuntu
* Many more (check the site)!  
* Many more (check the site)!  
== Script (Broken, will fix later) ==
Simply create and execute this script to boot directly into the generic iPXE kernel without hassle.
Special thanks to [https://www.reddit.com/user/rschulze /u/rschulze] for the script.
'''Update:''' People are reporting that the script is broken again! I'm keeping it here for when I have time to edit it, but just be aware. Feel free to fix it if you have time (I think the lkrn file just needs to be updated).
<source lang="bash">
#!/usr/bin/env bash
cdr2mask ()
{
  # Number of args to shift, 255..255, first non-255 byte, zeroes
  set -- $(( 5 - ($1 / 8) )) 255 255 255 255 $(( (255 << (8 - ($1 % 8))) & 255 )) 0 0 0
  [[ $1 -gt 1 ]] && shift ${1} || shift
  echo "${1-0}.${2-0}.${3-0}.${4-0}"
}
cd /boot || exit 1
wget --continue --output-document=/boot/generic-ipxe.lkrn https://boot.netboot.xyz/ipxe/netboot.xyz.lkrn
_Dev="$(ip route list | awk '/^default/ {print $5}')"
_Gateway="$(ip route list | awk '/^default/ {print $3}')"
_IP="$(ip -o -4 addr show "${_Dev}" | awk '{print $4}')"
_Netmask="$(cdr2mask "${_IP#*/}")"
_IP=${_IP%/*}
cat <<_EOF_ > /boot/netboot.xyz-initrd
#!ipxe
#/boot/netboot.xyz-initrd
imgfree
set net0/ip ${_IP%/*}
set net0/netmask ${_Netmask}
set net0/gateway ${_Gateway}
set dns 208.67.222.222
ifopen net0
chain --autofree https://boot.netboot.xyz
_EOF_
cat <<_EOF_ > /etc/grub.d/09_custom
echo "
menuentry 'netboot.xyz' {
    set root='hd0,msdos1'
    linux16 /generic-ipxe.lkrn
    initrd16 /netboot.xyz-initrd
}
"
_EOF_
chmod +x /etc/grub.d/09_custom
update-grub2 || { grub2-mkconfig -o /boot/grub2/grub.cfg; grub2-set-default 0; }
reboot
</source>


== Prerequisites ==
== Prerequisites ==
Line 42: Line 98:
</source>  
</source>  


'''Note''': This is where you'll need the console. If you're not already on it, do so now.  
'''Note''': This is where you'll need the console. If you're not already on it, go to https://panel.cloudatcost.com/ and open the console.  


3. Reboot your server using Ctrl+Alt+Del (or clicking the blue square in the corner of the console), or using the "reboot" command.  
3. Reboot your server using Ctrl+Alt+Del (or clicking the blue square in the corner of the console), or using the "reboot" command.  


4. When you see the VMWare splash screen, ''quickly'' press the letter "'''C'''".  
4. Right after the VMWare splash screen, the GRUB boot menu will appear. ''Quickly'' press the letter "'''C'''".  


'''Note''': You should now see a "'''grub>'''" prompt. If not, you'll need to reboot and try step 4 again.  
'''Note''': You should now see a "'''grub>'''" prompt. If not, you'll need to reboot and try step 4 again.  
Line 52: Line 108:
5. In the grub prompt, type the following command:  
5. In the grub prompt, type the following command:  


<source lang="bash">linux16 /netboot.xyz.lkrn</source>  
<source lang="bash">linux16 /boot/netboot.xyz.lkrn</source>  


'''Note''': Be prepared to ''quickly'' press "'''M'''" after this next command:  
'''Note''': Be prepared to ''quickly'' press "'''M'''" after this next command:  
Line 62: Line 118:
7. ''Quickly'' press "'''M'''" to bring up the menu.  
7. ''Quickly'' press "'''M'''" to bring up the menu.  


8. Select "manual network setup".
8. Select "Manual network configuration".


9. Now you'll need to provide the following information in order for the script to download the image. This can all be found on the information icon in the CloudAtCost panel:   
9. Now you'll need to provide the following information in order for the script to download the image. This can all be found on the information icon in the CloudAtCost panel:   
Line 74: Line 130:


10. If everything is successful, you should now get a list of OS's which you can choose to your hearts content. Pick the OS you'd like and then follow the instructions. The script will lead you to installing the operating system of your choice.  
10. If everything is successful, you should now get a list of OS's which you can choose to your hearts content. Pick the OS you'd like and then follow the instructions. The script will lead you to installing the operating system of your choice.  
https://netboot.xyz/images/netboot.xyz.gif


That's it!
That's it!
Line 79: Line 137:
----
----


If you have any issues, check the ##CloudAtCost channel on Freenode. Plenty of people there available to help.
If you have any issues, check the ##CloudAtCost channel on Freenode or /r/CloudAtCost on reddit. Plenty of people there available to help.

Latest revision as of 14:14, 9 February 2022

This tutorial attempts to remake the original one present on the original CloudAtCost wiki. The original wiki had become rather overrun with spam, so the owner shut it down.

Supported OS

The following OS's are supported, according to netboot.xyz:

  • Antergos
  • Arch Linux
  • Architect Linux
  • CentOS
  • CoreOS
  • Debian
  • Fedora
  • FreeBSD
  • Gentoo
  • Mageia
  • Manjaro Linux
  • Microsoft Windows
  • MirOS
  • OpenBSD
  • OpenSUSE
  • RancherOS
  • Scientific
  • Tiny Core Linux
  • Ubuntu
  • Many more (check the site)!

Script (Broken, will fix later)

Simply create and execute this script to boot directly into the generic iPXE kernel without hassle.

Special thanks to /u/rschulze for the script.

Update: People are reporting that the script is broken again! I'm keeping it here for when I have time to edit it, but just be aware. Feel free to fix it if you have time (I think the lkrn file just needs to be updated).

#!/usr/bin/env bash

cdr2mask ()
{
   # Number of args to shift, 255..255, first non-255 byte, zeroes
   set -- $(( 5 - ($1 / 8) )) 255 255 255 255 $(( (255 << (8 - ($1 % 8))) & 255 )) 0 0 0
   [[ $1 -gt 1 ]] && shift ${1} || shift
   echo "${1-0}.${2-0}.${3-0}.${4-0}"
}

cd /boot || exit 1
wget --continue --output-document=/boot/generic-ipxe.lkrn https://boot.netboot.xyz/ipxe/netboot.xyz.lkrn

_Dev="$(ip route list | awk '/^default/ {print $5}')"
_Gateway="$(ip route list | awk '/^default/ {print $3}')"
_IP="$(ip -o -4 addr show "${_Dev}" | awk '{print $4}')"
_Netmask="$(cdr2mask "${_IP#*/}")" 
_IP=${_IP%/*}

cat <<_EOF_ > /boot/netboot.xyz-initrd
#!ipxe
#/boot/netboot.xyz-initrd
imgfree
set net0/ip ${_IP%/*}
set net0/netmask ${_Netmask}
set net0/gateway ${_Gateway}
set dns 208.67.222.222
ifopen net0
chain --autofree https://boot.netboot.xyz
_EOF_

cat <<_EOF_ > /etc/grub.d/09_custom
echo "
menuentry 'netboot.xyz' {
    set root='hd0,msdos1'
    linux16 /generic-ipxe.lkrn
    initrd16 /netboot.xyz-initrd
}
"
_EOF_
chmod +x /etc/grub.d/09_custom

update-grub2 || { grub2-mkconfig -o /boot/grub2/grub.cfg; grub2-set-default 0; }

reboot

Prerequisites

I would advise doing this on a fresh CloudAtCost server, preferably using the Debian 8 Jessie image. Make sure your console works, as you'll need it throughout the entire installation.

It appears that the console works much more consistently on DC-2 as opposed to DC-3, so I'd give it a shot there for the most successful installation (plus, DC-2 is probably as stable you're gonna get at the moment).

Steps

1. Login into your fresh server, preferably using the console (SSH will work too).

2. Run the following command:

cd /boot && wget -c "https://boot.netboot.xyz/ipxe/netboot.xyz.lkrn"

Note: This is where you'll need the console. If you're not already on it, go to https://panel.cloudatcost.com/ and open the console.

3. Reboot your server using Ctrl+Alt+Del (or clicking the blue square in the corner of the console), or using the "reboot" command.

4. Right after the VMWare splash screen, the GRUB boot menu will appear. Quickly press the letter "C".

Note: You should now see a "grub>" prompt. If not, you'll need to reboot and try step 4 again.

5. In the grub prompt, type the following command:

linux16 /boot/netboot.xyz.lkrn

Note: Be prepared to quickly press "M" after this next command:

6. Then boot into it using the following command:

boot

7. Quickly press "M" to bring up the menu.

8. Select "Manual network configuration".

9. Now you'll need to provide the following information in order for the script to download the image. This can all be found on the information icon in the CloudAtCost panel:

IP address (found in panel)
Subnet mask (if you have issues relating to networking, try leaving this blank)
Default gateway (found in panel)
Set DNS to 8.8.8.8

Note: To avoid HTTP/S timeouts when fetching iPXE bootfiles, avoid inputting netmask while performing the previous steps. If iPXE times out HTTP/s connections, reboot and perform the steps above starting from the grub prompt. This is a handshake bug between CloudAtCost VMs and our iPXE host server that we are currently working on addressing.

10. If everything is successful, you should now get a list of OS's which you can choose to your hearts content. Pick the OS you'd like and then follow the instructions. The script will lead you to installing the operating system of your choice.

netboot.xyz.gif

That's it!


If you have any issues, check the ##CloudAtCost channel on Freenode or /r/CloudAtCost on reddit. Plenty of people there available to help.