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