December 29, 2020
FreeBSD at Hetzner on AMD Ryzen
FreeBSD is an operating system which focuses on features, speed, and stability. It provides robust network services under the heaviest loads and uses memory efficiently to maintain good response times for thousands of simultaneous user processes. FreeBSD/amd64 supports the AMD64 platform which is expected to be production quality with respects to all aspects of the FreeBSD operating system, including installation and development environments.
Thankfully to Hetzner’s idea to reuse hardware of terminated products it is possible to find an economic yet powerful system.
Inspired by BOINC Projects with FreeBSD support I run a BOINC rig on AMD Ryzen Threadripper 2950X processor with maximum possible load on the system.
The ordered server is delivered in rescue system. Connecting over SSH with tunneling of VNC port makes the whole installation easy.
# ssh root@46.4.23.49 -L 6900:localhost:5900;
Note down the DNS resolvers, the default gateway, IP and IPv6 addresses, and ethernet driver.
# cat /etc/resolv.conf;
# ip route show;
# ifconfig eth0;
# lspci | grep Ethernet;
Install QEMU. It is a generic and open source machine emulator and virtualizer.
# apt-get install qemu;
Download FreeBSD ISO image to install a new system from.
# wget https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/12.2/FreeBSD-12.2-RELEASE-amd64-disc1.iso;
Boot dual proccessor virtual machine with 2GB of memory and first disk attached to it. The ISO image is mounted as a CD-ROM and there is a VNC enabled.
# qemu-system-x86_64 -smp cpus=2 -m 2048 -hda /dev/sda -net nic -boot d -vnc localhost:0 -cdrom /root/FreeBSD-12.2-RELEASE-amd64-disc1.iso;
Connect the VNC client to localhost:6900 and continue installation normally. Refer to the official handbook of Installing FreeBSD.
ZFS configuration for pool type is “stripe: 1 disk” with encrypted swap. More hard drives can be enabled in Qemu by
# [...] -hda /dev/sda -hdb /dev/sdb -hdd /dev/sdc [...]
The FreeBSD installer will ask to configure em0 virtual network device. Use DHCP to change that later for Intel(R) Gigabit Ethernet Network Driver.
At the end of installation open a shell in the new system to make final manual modifications. Add networking configuration to /etc/rc.conf for igb0.
# ee /etc/rc.conf;
Verify the final SSH daemon configuration.
# ee /etc/ssh/sshd_config;
Halt the QEMU virtual machine and reboot the rescue system.
Next SSH connection to the IP will offer a new SSH keys and connects to the newly installed FreeBSD.
# uname -a;