Install FreeBSD with disk encryption on VPS using mfbsd

Primary tabs

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 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

Screenshot-2020-01-29-at-18.05.32.png

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.1-RELEASE-amd64.img
update-grub2
reboot

mfbsd version needs to match release version of freebsd what will be installed.

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

Screenshot-2020-01-29-at-18.07.40.png

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

Next prepare mfsroot for installation

pkg install curl
mkdir /usr/freebsd-dist/
cd /usr/freebsd-dist/
curl -O https://download.freebsd.org/ftp/releases/amd64/12.1-RELEASE/base.txz
curl -O https://download.freebsd.org/ftp/releases/amd64/12.1-RELEASE/kernel.txz
curl -O https://download.freebsd.org/ftp/releases/amd64/12.1-RELEASE/lib32.txz
curl -O https://download.freebsd.org/ftp/releases/amd64/12.1-RELEASE/MANIFEST

Now issue command:

bsdinstall

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

bsdinstall.png

Tags 
freebsd geli vps


QR Code for https://setupexample.com/install-freebsd-with-disk-encryption-vps-using-mfbsd