Hero Image

Install FreeBSD with disk encryption on VPS using mfbsd

This method should work with all vendors where VNC is available. It is based on mfsbsd image. mfsbsd is freebsd floppy image what works in ram. Also solution where freebsd is availabe from template install but you want GELI disk encryption. This method uses grub image boot with ubuntu

First install Ubuntu

This has been tested with ubuntu 18.04. Write down network information. GW, Netmask and IP (route -n and ip addr show).

Then prepare grub to boot mfsbsd image.

vi /etc/default/grub

Comment out GRUB_TIMEOUT_STYLE and change GRUB_TIMEOUT to 5
Set GRUB_TIMEOUT=5 also in file /etc/default/grub.d/50-cloudimg-settings.cfg
If 50-cloudimg-settings.cfg is not available then change only /etc/default/grub

Now prepare grub for image boot:

apt install grub-imageboot -y
mkdir /boot/images
cd /boot/images
curl -O https://mfsbsd.vx.sk/files/images/12/amd64/mfsbsd-se-12.2-RELEASE-amd64.img
update-grub2
reboot

Open VNC connection. In grub boot select: Bootable Floppy Image: mfsbsd-se-12.2-RELEASE-amd64

mfbsd is set to auto network dhcp. with most vendors it will get ip via dhcp just fine. If some vendors do not support dhcp then you can set ip and route manually.

Login credentials for mfbsd:

username: root
password: mfsroot

You can manage mfbsd via VNC and SSH

Prepare mfsroot for installation

mkdir /usr/freebsd-dist/
cd /usr/freebsd-dist/
fetch https://download.freebsd.org/ftp/releases/amd64/12.3-RELEASE/base.txz
fetch https://download.freebsd.org/ftp/releases/amd64/12.3-RELEASE/kernel.txz
fetch https://download.freebsd.org/ftp/releases/amd64/12.3-RELEASE/lib32.txz
fetch https://download.freebsd.org/ftp/releases/amd64/12.3-RELEASE/MANIFEST

Now issue command:

bsdinstall

This is standard freebsd installation. Choose from menu ZFS and disk encryption

bsdinstall

Other Related Posts:

Get back PHP7.4 on FreeBSD

Recently freebsd did drop (reason: eol) php7.4 support in FreeBSD and it is not available via packages or latest ports anymore. This guide will get back php7.4 from ports using help of git commit log. Last ports php7.4 related (update to php 7.4.33) commit was in git 27ac371f93d36f77f00b8da261e496...

Read more

17th Jan 2023