private-schrijfsels-en-noti.../2025/FreeBSD 14.2-RELEASE on a S...

81 lines
3.1 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## Online.net account
On your Online.net account via [console.online.net](https://console.online.net/), go to:
- **“Server”** dropdown menu, then **“Servers list”**.
- Click on **“Manage”** on the right.
- **“Rescue”** button.
- As operating system select **“Ubuntu 20.04 amd64”**.
- Then start the operation, you server will boot on the Ubuntu live CD.
## Dedibox server
- Log in the rescue live system through ssh with the provided ip/credentials.
- The provided Ubuntu version is outdated (Ubuntu Saucy), so the apt repositories have to be modified before Qemu could be installed:
```
$ sudo -s
# apt update
# apt install qemu-kvm
```
Fetch a FreeBSD Installer ISO image:
```shell
# cd /tmp
# wget https://download.freebsd.org/releases/ISO-IMAGES/14.2/FreeBSD-14.2-RELEASE-amd64-bootonly.iso
# wget https://download.freebsd.org/releases/ISO-IMAGES/14.2/CHECKSUM.SHA256-FreeBSD-14.2-RELEASE-amd64
# sha256sum FreeBSD-14.2-RELEASE-amd64-bootonly.iso
d063e48b81b99005c8097e60377c23fb07e4116c5f0c0b41a5dc368fc4df6bf9 FreeBSD-14.2-RELEASE-amd64-bootonly.iso
# cat CHECKSUM.SHA256-FreeBSD-14.2-RELEASE-amd64 | grep FreeBSD-14.2-RELEASE-amd64-bootonly.iso
SHA256 (FreeBSD-14.2-RELEASE-amd64-bootonly.iso) = d063e48b81b99005c8097e60377c23fb07e4116c5f0c0b41a5dc368fc4df6bf9
```
For the post-install network configuration step _(`/etc/rc.conf`)_, try to figure out now what is your NIC model ([Handbook: Locating the correct driver](https://www.freebsd.org/doc/handbook/config-network-setup.html))
```
# lspci -v | grep Ethernet
00:14.0 Ethernet controller: Intel Corporation Ethernet Connection I354 2.5 GbE Backplane (rev 03)
Subsystem: Intel Corporation Ethernet Connection I354 2.5 GbE Backplane
```
Setup NAT on the Linux host by creating a tap interface
```
ip tuntap add tap0 mode tap
ip addr add 192.168.100.1/24 dev tap0
sysctl net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -o enp0s20 -j MASQUERADE
```
Start the FreeBSD installer through Qemu, attached to the physical server disk, with the curses UI:
```
# qemu-system-x86_64 -hda /dev/sda -cdrom FreeBSD-14.2-RELEASE-amd64-bootonly.iso -netdev tap,id=nd0,ifname=tap0,script=no,downscript=no -device virtio-net-pci,netdev=nd0 -curses -boot d
```
Configure IPv4 static IP (as there is no DHCP server on the Linux host)
- IP Address: `192.168.100.2`
- Subnet Mask: `255.255.255.0`
- default router: `192.168.100.1`
- IPv4 DNS #1: `8.8.8.8` ([Googles public DNS](https://developers.google.com/speed/public-dns), you can check yours in `/etc/resolv.conf`)
Then
- On the **partitioning** dialog, choose **Auto (ZFS) Guided Root-on-ZFS**
- Follow installer up to the end, and when asked for **Manual Configuration**, choose **yes** to open a shell before exiting the installer.
- Configure the network, modify the files accordingly to your network setup/nic driver:
```
# /etc/rc.conf
ifconfig_igb0="DHCP"
# /etc/resolv.conf
nameserver x.x.x.x
```
## See also
* https://loicpefferkorn.net/2015/10/freebsd-10.2-release-on-a-dedibox-xc-server-online.net-with-root-on-zfs/
* https://wiki.qemu.org/Documentation/Networking