{"id":13702996,"url":"https://github.com/paulc/hcloud-freebsd","last_synced_at":"2025-07-28T23:31:25.331Z","repository":{"id":146117317,"uuid":"242172104","full_name":"paulc/hcloud-freebsd","owner":"paulc","description":"Hetzner Cloud auto-provisioning for FreeBSD","archived":false,"fork":false,"pushed_at":"2023-12-30T14:05:25.000Z","size":92,"stargazers_count":29,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-13T10:37:48.291Z","etag":null,"topics":["cloud-config","freebsd","hetzner","hetzner-cloud"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paulc.png","metadata":{"files":{"readme":"README-ARM64.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-02-21T15:36:19.000Z","updated_at":"2024-11-11T14:28:16.000Z","dependencies_parsed_at":"2023-12-30T15:23:57.179Z","dependency_job_id":"19524c79-47a6-4cdf-ab95-d85a7d6e6003","html_url":"https://github.com/paulc/hcloud-freebsd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulc%2Fhcloud-freebsd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulc%2Fhcloud-freebsd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulc%2Fhcloud-freebsd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulc%2Fhcloud-freebsd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paulc","download_url":"https://codeload.github.com/paulc/hcloud-freebsd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227962265,"owners_count":17847912,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-config","freebsd","hetzner","hetzner-cloud"],"created_at":"2024-08-02T21:00:48.344Z","updated_at":"2024-12-03T17:12:55.072Z","avatar_url":"https://github.com/paulc.png","language":"Shell","funding_links":[],"categories":["Integrations"],"sub_categories":["Rust"],"readme":"\n# Installing on ARM64 servers\n\nHetzner Cloud now suports ARM64 (AARCH64) servers (currently only in\nFalkenstein DC) however it isn't currently possible to install FreeBSD directly\nfrom CDROM (the system boots but there is no video output in the EFI console),\nand (afaik) it also doesn't currently appear to be possibe to boot MfsBSD on\nArm64/EFI.\n\nThere are however a couple of other options we can use (both use the Linux\nrescue system).\n\n# FreeBSD VM image\n\nWe can use the official FreeBSD VM image to install the system - however we do\nneed to patch this before writing to thw VM disc (see\nhttps://gist.github.com/pandrewhk/2d62664bfb74a504b7f4a894fc85eb97) \n\nTo patch the image you will need an existing FreeBSD host (any architecture).\n\na.  On the existing FreeBSD host download the appropriate FreeBSD raw VM image \n\n    curl https://download.freebsd.org/releases/VM-IMAGES/13.2-RELEASE/aarch64/Latest/FreeBSD-13.2-RELEASE-arm64-aarch64.raw.xz)\n\nb.  Mount the image as a loopback device \n\n    unxz FreeBSD-13.2-RELEASE-arm64-aarch64.raw.xz\n    mdconfig -u1 FreeBSD-13.2-RELEASE-amd64.raw \n    mount /dev/md1p4 /mnt\n    printf 'sshd_enable=\"YES\"\\nsshd_flags=\"-o PermitRootLogin=yes\"\\ndevmatch_blacklist=\"virtio_random.ko\"\\n' | tee -a /mnt/etc/rc.conf\n    umask 077\n    mkdir /mnt/root/.ssh\n    echo \"${SSH_PUB_KEY?}\" \u003e /mnt/root/.ssh/authorized_keys\n\n(Note: you need to set the SSH_PUB_KEY env var to your ssh public key - eg. contents of .ssh/id_ed25519.pub)\n\nc.  Make any other necessary changes to the base image (eg. growfs_enable=\"NO\" if you want to add a ZFS partition instead of expanding the UFS partition))\n\nd.  Unmount the image and recompress\n\n    umount /mnt\n    mdconfig -d -u 0\n    xz FreeBSD-13.2-RELEASE-amd64.raw \n\ne.  Make sure that the image available (http/ftp) - (eg. python3 -m http.server)\n\nf.  Boot the Hetzner ARM64 server into rescue mode and connect via SSH\n\ng.  Download and write the image directly to the VM disc \n\n    curl http://.... | unxz \u003e /dev/sda\n\nh.  Reboot and connect to the server using SSH \n\ni.  Remove buggy virtio_random driver\n\n    sysrc devmatch_blacklist=\"virtio_random.ko\" # Avoid virtio_random.ko bug\n\nj.  Follow normal installation instructions in config.sh\n\n    fetch -o /tmp/config.sh https://raw.githubusercontent.com/paulc/hcloud-freebsd/master/config.sh\n    sh -v /tmp/config.sh\n\n#### Note: another option is to just install the distribution image directly onto the disc and then use the QEMU option below (dont attach ISO drive) to configure the system (this avoids having to patch the image first)\n\n# QEMU install\n\n#### _Note: This method doesnt boot with UFS install (looks like generated FS is corrupt but difficult to diagnose as console doesnt work) - for a UFS install you currently need to use the FreeBSD VM image option (see above). (ZFS install appears to work fine)_\n\nThe QEMU install option is a bit more complex however does allow you to customise the install (in particular if you want to install on ZFS root)\n\na.  Boot the VM into rescue mode and connect using SSH\n\nb.  Install qemu-system-arm\n\n    apt install -y qemu-system-arm qemu-efi-aarch64\n\nc.  Download ARM installer \n\n    curl -Lo freebsd.iso https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/13.2/FreeBSD-13.2-RELEASE-arm64-aarch64-bootonly.iso\n\nor\n\n    curl -Lo freebsd.iso https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/13.2/FreeBSD-13.2-RELEASE-arm64-aarch64-disc1.iso\n\nd.  Create EFI flash images\n\n    dd if=/dev/zero of=efi.img bs=1M count=64\n    dd if=/dev/zero of=efi-varstore.img bs=1M count=64\n    dd if=/usr/share/qemu-efi-aarch64/QEMU_EFI.fd of=efi.img conv=notrunc\n\ne.  Boot installer from QEMU\n\n    qemu-system-aarch64 \\\n      -machine virt,gic-version=max \\\n      -nographic \\\n      -m 1024M \\\n      -cpu max \\\n      -device virtio-net-pci,netdev=nic \\ \n      -netdev user,id=nic,hostfwd=tcp:127.0.0.1:2022-:22 \\ # Only really needed for booting live image\n      -drive file=efi.img,format=raw,if=pflash \\\n      -drive file=efi-varstore.img,format=raw,if=pflash \\\n      -drive file=/dev/sda,format=raw,if=none,id=drive0,cache=writeback \\\n      -device virtio-blk,drive=drive0 \\\n      -drive file=freebsd.iso,if=none,id=drive1,cache=writeback \\\n      -device virtio-blk,drive=drive1,bootindex=0\n\nf.  Follow installer prompts as normal - when done drop into shell \n\n    sysrc devmatch_blacklist=\"virtio_random.ko\" # Avoid virtio_random.ko bug\n\ng.  Follow normal installation instructions in config.sh\n\n    fetch -o /tmp/config.sh https://raw.githubusercontent.com/paulc/hcloud-freebsd/master/config.sh\n    sh -v /tmp/config.sh\n\nh.  Shutdown and exit QEMU (C-a x)\n\ni.  Smapshot the instance\n\n# Rescue system \n\nYou can also use QEMU as a rescue system (use the Live CD rather than Installer\noption when the ISO boots) or to boot the VM directly (remove the ISO\ndevice/drive).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulc%2Fhcloud-freebsd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulc%2Fhcloud-freebsd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulc%2Fhcloud-freebsd/lists"}