FreeBSD on dedibox XC 2016

#1

Hello !

I would like to install FreeBSD on an dedibox XC 2016.
I was found http://bin.jvallee.fr/freebsd.sh to automatize install from FreeBSD’s rescue partition via https://forum.online.net/index.php?/topic/5879-en-2016-freebsd-prend-ses-aises/?hl=freebsd,, but no tutorial to use it.
Any suggestion?

1 Like
#2

Hi,

Yes you should be able to install FreeBSD on a Dedibox XC 2016 with this script :slight_smile:

However it was designed for our old SC offer (Via Nano) and uses 10.2 and not 10.3. It also uses a 32 Bit OS.
So you might improve the script at some points :wink:

To use it

  • Boot the server into FreeBSD rescue mode
  • Launch the script
  • CHROOT yourself into the partition once the script has finished
  • Create a user to login with SSH (or enable SSH access as root and set a password for it)

Don’t forget to enable the serial console of your server to have full access to all its features: https://documentation.online.net/en/dedicated-server/hardware/configure-ipmi-server/serial-console-suchard

1 Like
#3

Hi!

Thanks for all, you rocks!
However, i’m a noob with FreeBSD in this context (i installed it on desktop or on server totally under my control usually), so, can you give me some details about CHROOT and the reboot procedure after install?

#4

Ok, this is my version of the script:

#!/bin/sh -x
pkg install gpart wget
gpart destroy -F ada0
gpart create -s gpt ada0
gpart add -t freebsd-boot -l boot -s 512K /dev/ada0
gpart add -t freebsd-swap -l swap -s 1g -a 1m /dev/ada0
gpart add -t freebsd-ufs -l root -s 5g -a 1m /dev/ada0
gpart add -t freebsd-ufs -l tmp -s 1g -a 1m /dev/ada0
gpart add -t freebsd-ufs -l var -s 5g -a 1m /dev/ada0
gpart add -t freebsd-ufs -l usr -a 1m /dev/ada0
gpart bootcode -b /boot/pmbr /dev/ada0
gpart bootcode -p /boot/gptboot -i 1 /dev/ada0
newfs -j -L root /dev/gpt/root
newfs -j -L tmp /dev/gpt/tmp
newfs -j -L var /dev/gpt/var
newfs -j -L usr /dev/gpt/usr
mount /dev/gpt/root /mnt
mkdir /mnt/var
mkdir /mnt/tmp
mkdir /mnt/usr
mount /dev/gpt/tmp /mnt/tmp
mount /dev/gpt/var /mnt/var
mount /dev/gpt/usr /mnt/usr
cd /mnt && wget "ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/10.3-RELEASE/base.txz"
cd /mnt && wget "ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/10.3-RELEASE/kernel.txz"
tar --unlink -xpJf /mnt/base.txz -C /mnt
tar --unlink -xpJf /mnt/kernel.txz -C /mnt
cat << EOF > /mnt/etc/fstab
/dev/gpt/swap none swap sw 0 0
/dev/gpt/root / ufs rw 1 1
/dev/gpt/tmp /tmp ufs rw 2 2
/dev/gpt/var /var ufs rw 2 2
/dev/gpt/usr /usr ufs rw 2 2
EOF
cat << EOF > /mnt/etc/rc.conf
ifconfig_igb0="DHCP"
sshd_enable="YES"
EOF
cat << EOF > /mnt/boot/loader.conf
boot_multicons="YES"
boot_serial="YES"
comconsole_speed="9600"
console="comconsole"
comconsole_port="0x2F8"
EOF
cat << EOF >> /mnt/etc/ttys
ttyu1   "/usr/libexec/getty std.9600"   vt100   on  secure
EOF

echo "terminated"

To use it:

  1. Boot your server into FreeBSD rescue mode;
  2. Log in it using SSH;
  3. Create file ./freebsd.sh and copy/paste the script;
  4. chmod u+x ./freebsd.sh;
  5. ./freebsd.sh;
  6. chroot /mnt /usr/bin/env -i TERM=$TERM /bin/sh (not sure about /usr/bin/env, do whereis env to check it);
  7. whereis adduser;
  8. path/to/adduser;
  9. Reboot your server using online’s console;
  10. Profit!

Thanks for your help!

1 Like