Install FreeBSD

To install FreeBSD we will use the standard FreeBSD image (FreeBSD-13.1-RELEASE-amd64-disc1.iso) with a ZFS setup. Power down the virtual machine via the control panel and upload the FreeBSD image via SFTP to the /cdrom folder (FTP will not work, it will break after around 300 seconds).

Make sure you set optimization in control panel to BSD and keyboard to de. Delete the complete harddisc from control panel under Medien.

Now insert the FreeBSD image as media and start the machine. The FreeBSD installer starts.

Switch off the machine from the control panel, remove the image and start the machine again.

Configure the network by editing /etc/rc.conf

zfs_enable="YES"
keymap="de.kbd"

hostname="xxxxxx"
ifconfig_vtnet0="inet xxx.xxx.xxx.xxx netmask 255.255.252.0"
defaultrouter="xxx.xxx.xxx.x"
ifconfig_vtnet0_ipv6="inet6 xxxx:xxxx:xxxx:xxxx::x/64"
ipv6_defaultrouter="fe80::1%vtnet0"

local_unbound_enable="YES"
sshd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"

Now copy your SSH keys to the server, as we restrict as next SSH access to key only. To restrict to key access, edit /etc/ssh/sshd_config:

echo "UsePAM no" >> /etc/ssh/sshd_config
service sshd restart

Verify that ssh login with password fails and only key authentication is working.

Install pkg:

pkg install -y pkg

Configure pkg to use latest and not quarterly branch:

mkdir -p /usr/local/etc/pkg/repos
cp /etc/pkg/FreeBSD.conf /usr/local/etc/pkg/repos

Edit /usr/local/etc/pkg/repos/FreeBSD.conf

  url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",

Update:

pkg update
pkg upg

Netcup