FreeBSD 14.0 Installation on Xneelo Dedicated Server
Introduction
Lets walk through the steps of installing FreeBSD 14.0 on a dedicated server from Xneelo.
Xneelo is a South African hosting provider with dedicated servers and a rescue system, similar to Hetzner.
FreeBSD is not available as an operating system to install, however, it can installed from the rescue console using the depenguin.me installer.
Prepare ssh
Public Key
Setup your ssh
public key in a web-accessible location, such as a text file in a webserver root.
This would be the contents of id_rsa.pub
, or the contents of .ssh/authorized_keys
from an existing server.
For example: https://your.host/keys.txt
Set Up Your Xneelo User
Register on the Xneelo control panel, and configure 2FA. Consult the Xneelo documentation for more infomation.
If assisting someone on their account, login as your newly created user, then switch account to access servers and rescue console.
Order a Server
Login to the Xneelo control panel and view “Self-managed servers”.
Make a selection from the list for the dedicated servers.
For OS install, choose ‘Linux’ and then ‘Debian’. This will be overwritten, however, you’ll first boot into it and gather some useful information.
Select RAM and drive specifications and add any custom comments.
Continue and complete the process to order a server, providing any necessary payment information.
Login to Provisioned Server
A password-protected PDF will be sent via email when the server is provisioned.
The PDF contains important information, such as:
- IP addressing
- Remote console info
- Initial passwords
If you don’t already have the necessary customer number, login to the Xneelo control panel, switch to the right account, then get the customer number to use as password to open PDF.
On the first ssh
connection to the Debian instance as root user, login with the password provided.
You will immediately be asked to change your password. This involves inputting the password a second time, and then setting a new one.
Since you won’t be keeping Debian, set any password and continue.
Check a few things before rebooting, as below.
Check Disks
Check disks and capacities with lsblk
. Determine which two drives will form your system mirror array.
It might be sda, sdb
, or it might be a sdb, sdc
from a mix of drive capacities over sda, sdb, sdc, sdd
.
Important: This might change between reboots!
Check Interfaces
Check the interfaces with ip addr
and make a note of the MAC address in link/ether
for the connected interface.
Although IP addressing is provided via DHCP, you’ll manually configure addresses later on. You need the IP, netmask and MAC address.
Create a Private IPv6 Address to Use
Use this tool to create a local IPv6 range with the MAC address from the step above.
From the fdxx:xxxx:xxxx:0:/64
range that comes out, jot down fdxx:xxxx:xxxx::1
to use for a local IPv6 address later on.
Get DNS Servers
Get the DNS servers in /etc/resolv.conf
because they need to be included later on.
cat /etc/resolv.conf
Select IPv6 Name Servers
IPv6 is not enabled by default at Xneelo, however we’ll include IPv6 nameservers in the setup later. Cloudflare’s 1.1.1.1 IPv6 nameservers will do for now:
2606:4700:4700::1111
2606:4700:4700::1001
Prepare to Reboot
You’re done with checking out the information that may be needed. You will reboot after first activating the rescue console.
Activate Rescue Console
Please refer to the Xneelo rescue docs for latest information!
Open the Xneelo Control Panel and log in.
Under ‘Products’ in the side menu, select ‘Self-Managed Servers’.
Click on the server you would like to access.
On the ‘Product Overview’ screen, click on the ‘Linux Rescue System’ icon.
Select ‘Activate’.
Important: Make a note of the one time password, you will need this to login.
Now you can reboot the Debian instance at the console. You must do this within 10 minutes of activating the rescue console.
Once rebooted, your server will PXE boot and load the rescue system.
Log Into Rescue Console
On your own computer, make sure the old server keys are removed from your .ssh/known_hosts
with the following command:
ssh-keygen -R <xneelo-server-ip>
Then connect to your server, now in rescue console mode.
Log in with the username and password provided at activation time, either from the console or via ssh
access.
Installation
Unattended Installation With depenguin.me Script
Download And Run The Installer Script
The Xneelo rescue system doesn’t like the ssh
certificate from https://depenguin.me and needs the --no-check-certificate
to work reliably.
wget --no-check-certificate https://depenguin.me/run.sh
chmod +x run.sh
./run.sh https://your.host/keys.txt
Wait for the packages to install and Qemu to load. You’ll be prompted with connection details when ready.
Connect To The mfsBSD Instance On Port 1022
In a new terminal session connect to the mfsBSD instance on port 1022 and change to root:
ssh -p 1022 mfsbsd@your-host-ip
sudo su -
Check Disks Again
Make sure you have the correct disks for the settings below with the following command:
geom disk list
If you want a mirror setup (Raid1) and have two disks, make sure it’s ada0 ada1
, or whatever matches your setup. Xneelo servers change the disk names between boots.
If you want a four disk setup with Raid10, you can configure that too, as long as all drive capacities match.
For mixed capacity setup with four disk systems, find the correct two drives for your root array. (In a four-disk system this is ada0 ada2
on some boots.)
Wipe Disks
Wipe disks as follows:
./mfsbsd_clean.sh zroot ada0 ada1
YOU ARE ABOUT TO DESTROY ZPOOL 'zroot' AND PARTITIONS ada0 ada1
THIS OPERATION MEANS DATA LOSS AND CANNOT BE UNDONE
Please type 'ACCEPTDATALOSS' and press enter to continue.
ACCEPTDATALOSS
...
DONE
Create Settings File
cp depenguin_settings.sh.sample depenguin_settings.sh
Then edit the settings file with your information
nano depenguin_settings.sh
conf_hostname="depenguintest"
conf_interface="igb0"
conf_ipv4="1.2.3.4"
conf_ipv6="fdxx:xxxx:xxxx::1"
conf_gateway="6.7.8.9"
conf_nameserveripv4one="196.22.142.222"
conf_nameserveripv4two="41.203.18.183"
conf_nameserveripv6one="2606:4700:4700::1111"
conf_nameserveripv6two="2606:4700:4700::1001"
conf_username="myusername"
conf_pubkeyurl="http://url.host/keys.txt"
conf_disks="ada0 ada1"
conf_disktype="mirror"
run_installer="1"
Run The Installer
./depenguin_bsdinstall.sh
The process will exit automatically when complete.
Deactive The Rescue System
If the Xneelo system is still active (10mins) you must deactivate it before rebooting. It might still be active because installation is fast.
In Other Session: Reboot
Back in the rescue console, reboot with:
reboot
This will exit the rescue console and boot into FreeBSD.
Connect To Your Server
After a few minutes to boot up, connect to your server via ssh
:
ssh YOUR-USER@ip-address
sudo su -
Check DNS is available and then perform initial system configuration such as:
freebsd-update fetch
freebsd-update install
pkg update -f
pkg upgrade
pkg install python39 sudo bash rsync jq unzip
Your server is ready for provisioning with an ansible
script such as A Beginner’s Guide to Building a Virtual Datacenter on FreeBSD with Ansible, Pot and More or Run Your Own Mastodon Server on FreeBSD in a Potluck Container.
Optional: Enable Password On Account For Console Access
Set a password on your user account if you want to login to the console via the Xneelo remote management interface.
sudo su -
passwd <your username>