Solved Installing FreeBSD in Hetzner

Just wanted to ask why dd'ing both sda and sdb disks?
Yeah, perhaps this is an unnecessary precaution and it is enough to write only to the first ( /dev/sda ) disk. But in the server BIOS, you (or previous server user) can change disk/boot the order.
 
I notice they removed mfsBSD the same day it happened and I post it here:


If more people reply to the above thread may they change their mind.

Installing FreeBSD is easy (boot to Linux rescue, load mfsBSD and reboot). The only problem is if a server needs fsck you have to request KVM access.

Few months ago I start migrating my servers from UFS to ZFS and I hope I complete the migration for most of the servers to ZFS by the end of 2022.
 
I notice they removed mfsBSD the same day it happened and I post it here:


If more people reply to the above thread may they change their mind.

Installing FreeBSD is easy (boot to Linux rescue, load mfsBSD and reboot). The only problem is if a server needs fsck you have to request KVM access.

Few months ago I start migrating my servers from UFS to ZFS and I hope I complete the migration for most of the servers to ZFS by the end of 2022.
They removed mfsBSD??
 
The latest FreeBSD Hetzner's rescue image is 13.0, not 11.2. I do not think that there should be problems with the restorathavion of 13.1.
Regarding Java-based KVM: You need "/usr/ports/java/icedtea-web". However, if my memory serves me, Hetzner's KVM can run the console without using Java.
They upgrade most of their KVM and java is not required. Only few times lately they connect a KVM that requires java.
 
UPD 2022-07-15: If you do not have Linux-rescue and want to write the MfsBSD image to a "live/active" disk with Linux OS ( perform an depenguination ;-) then we need to stop most of the system processes so that they do not write to us on the disk and follow these procedures:
Code:
wget https://myb.convectix.com/DL/mfsbsd-13.1.img -q -O -| cat | dd conv=fsync of=/dev/sda
echo b > /proc/sysrq-trigger

then perform a hard reset (without 'reboot' or 'shutdown').

After small tests, including interfering background processes, a clarification was made.

It is best to download the image file to a memory disk and then we write from it to a "live" disk with the system.
The conv=fsync option for dd helps control the write.

The command set now looks like this:

Bash:
mkdir -p /tmp/ramdisk
chmod 777 /tmp/ramdisk
mount -t tmpfs -o size=150m myramdisk /tmp/ramdisk

cd /tmp/ramdisk && wget https://myb.convectix.com/DL/mfsbsd-13.1.img && dd conv=fsync if=/tmp/ramdisk/mfsbsd-13.1.img of=/dev/sda && echo b > /proc/sysrq-trigger
 
Installing FreeBSD is easy (boot to Linux rescue, load mfsBSD and reboot). The only problem is if a server needs fsck you have to request KVM access.


Public cloud does not support custom ISO installation yet, if you want to use custom ISO, just follow this guide.

1) Reboot into rescue mode (Linux based - Debian, Centos or Ubuntu), then ssh to your server and download the iso, I'm using MfsBSD.

2) Copy a statically compiled QEMU/KVM in the /tmp

wget -qO- /tmp https://support.org.ua/Soft/vKVM/orig/vkvm.tar.gz | tar xvz -C /tmp

3) Run QEMU

/tmp/qemu-system-x86_64 -net nic -net user,hostfwd=tcp::1022-:22 -m 1024M -localtime -enable-kvm -cpu host,+nx -M pc -smp 1 -vga std -usbdevice tablet -k en-us -cdrom /mnt/mfsbsd-13.1-RELEASE-amd64.iso -hda /dev/sda -boot once=d -vnc :1
# If you have drives larger than 2 TB, you still need to download the UEFI boot
Options:​
-m 1024M # use so much RAM​
-smp 1 # use 1 CPU core. (leave 1-2 cores CPU for the host machine to work)​
-cdrom /mnt/mfsbsd-13.1-RELEASE-amd64.iso # path to your rescue CD​
-enable-kvm -cpu host,+nx # Use virtualization options if the CPU supports it.​
-hda /dev/sda # attach to guest the first HDD disk (/dev/sda)​
-hdb /dev/sdb # (optional) attach to guest a second HDD drive (/dev/sdb)​
-boot once=d # boot guest from CD​
-vnc :1 # enable support for VNC connections on port 5901 (5900+1)​
hostfwd=tcp::1022-:22 # We forward the external tcp port 1022 to 22 inside the guest.​
For the more security addicted:​
-vnc 127.0.0.1:0​
and SSH to your remote server from your local computer​
ssh root@<your-server-ip> -L 5901:localhost:5901
4) Open VNC client and connect to this address: <your-server-ip>:5901 or localhost:5901

5) Open ssh client and connect to this address: ssh -p 1022 <your-server-ip>

P.S. Based on a note.
 
Good post, click0 however have you tried using "-curses" switch for qemu? It'll bring you virtual monitor output of the emulation (no TCP, VNC, SSH connection needed).

Try something like:

/tmp/qemu-system-x86_64 -hda /dev/sda -cdrom /mnt/mfsbsd-13.1-RELEASE-amd64.iso -curses -boot d -smp 1
 
Good post, click0 however have you tried using "-curses" switch for qemu? It'll bring you virtual monitor output of the emulation (no TCP, VNC, SSH connection needed).

Try something like:

/tmp/qemu-system-x86_64 -hda /dev/sda -cdrom /mnt/mfsbsd-13.1-RELEASE-amd64.iso -curses -boot d -smp 1
Thanks for the "-curses" tip, but I don't see a practical use for this option.
Perhaps this is useful for those who do not have a normal graphical VNC client.

The qemu found on the Internet (and a set of files for it) are based on more than 10 years of the qemu package base.
I also do not have a test environment to make a workable statically linked version of qemu-system-x86_64 based on the latest versions of Qemu.
 
For future reference: Install FreeBSD-13.1 on your dedicated server from within a Linux rescue environment

P.S. Not my work, just wanted to post it to make sure people are aware of it.


This script is not designed for the case when disks are larger than 2TB.
P.S. I'll try to look a later and analyze the script.
 
Hey

Just wanted to chime in with experience to my fellow hetzner residents. I have been running FreeBSD on hetzners dedicated servers since 2014, and can happily report that it still works just fine.

2 months ago I had to resort to installing via a java enabled windows machine, and their KVM with ISO mount. That dosn't work anymore as many has pointed out. It's now a HTML based KVM, so you have to purchase a 16GB USB stick.

What I did, was boot into their normal linux rescue, and issue the following commands, after ordering a KVM and logging into it:

# Log in via SSH
1) wget https://download.freebsd.org/releas.../13.1/FreeBSD-13.1-RELEASE-amd64-memstick.img
# Remember to check if sda is your memstick
2) dd if=FreeBSD-13.1-RELEASE-amd64-memstick.img of=/dev/sda
# Check it wrote it
3) cfdisk /dev/sda
4) reboot
5) In KVM, press DEL to enter BIOS, go to boot and pick "legacy USB" as the first option
6) Reboot
7) Install FreeBSD
8) Reboot
9) Go to BIOS and set "UEFI HDD" as first boot option
10) Done

I have 2 AX101 machines now running FreeBSD 13.1 since they removed unofficial support, and the first one ran great and passed all my stress benchmarks before getting put into service. But, because of an overwhelming user peak, it had a crash after 2 months of service. I'm pretty sure it was because of my misconfiguration, but it was still a bit wierd, because I had to go to robot and see that it just said "Powered off". Normally, machines crashing just triggers a hard reset, not a poweroff. It was also my first machine at hetzner that had crashed.

These are my motherboards on my AX101's:
ASRockRack B565D4-V1L
Asus Pro WS 565-ACE

PS: If you can't get a machine where FreeBSD works, use their second hand market to rent an earlier model. I've had to do that once and the machine still runs after 5 years :)
 
Well when using my Hetzner my recommendation at the moment is to use their data center in Finland, or USA. Both offer much cheaper rates than Germany, because electrical power became very expensive there.
 
After small tests, including interfering background processes, a clarification was made.

It is best to download the image file to a memory disk and then we write from it to a "live" disk with the system.
The conv=fsync option for dd helps control the write.

The command set now looks like this:

Bash:
mkdir -p /tmp/ramdisk
chmod 777 /tmp/ramdisk
mount -t tmpfs -o size=150m myramdisk /tmp/ramdisk

cd /tmp/ramdisk && wget https://myb.convectix.com/DL/mfsbsd-13.1.img && dd conv=fsync if=/tmp/ramdisk/mfsbsd-13.1.img of=/dev/sda && echo b > /proc/sysrq-trigger
This one doesn't even reboot like the older commands.
 
This is a old thread. But I like to say, I was also long years a customer of Hetzner. And I am still there for the domain robot and domain registration.
But as they decide to give me no more a real Internet-IP, but only a local IP 172.16.x.x. I changed to Acitve Servers and been happy there since some years. https://www.active-servers.com/ (German website)
I could boot from a FreeBSD CD image and so I installed my FreeBSD system the fist time. After that I fetched the actual FreeBSD via network. I only used a virtual server without desktop for some services.
 
This is a old thread. But I like to say, I was also long years a customer of Hetzner. And I am still there for the domain robot and domain registration.
But as they decide to give me no more a real Internet-IP, but only a local IP 172.16.x.x. I changed to Acitve Servers and been happy there since some years. https://www.active-servers.com/ (German website)
I could boot from a FreeBSD CD image and so I installed my FreeBSD system the fist time. After that I fetched the actual FreeBSD via network. I only used a virtual server without desktop for some services.
Nothing prevents you from using 100500 other small hosters instead of Hetzner or OVH, including those in the garage or basement.
But the problem is the lack/high cost of IPv4 address.
But for me, in general, ipv6 addresses are enough.

P.S. I plan to complete an offline FreeBSD installer with a custom kernel based on MfsBSD
 
Hi, sorry, late to the party.

Did they revert the decision to drop FreeBSD ? Images are offered on cloud instances (for the x86 architechture).

My Problem is the ARM64 instance. Images are not offered by hetzner but the support did provide a 13.2 .iso and also a 14 snapshot .iso on request. Unfortunately I am stuck at the FreeBSD boot loader.

I see the tianocore and then the FreeBSD bootmenu.

After that (when the system tries to boot so that I can install) the screen gets almost immediately black and it reads "Display output is not active".

I tried to switch to serial but same result.

Any ideas / suggestions more than welcome!
 
Back
Top