{"id":269,"date":"2022-12-05T13:00:00","date_gmt":"2022-12-05T18:00:00","guid":{"rendered":"http:\/\/sycured.127.0.0.1.sslip.io\/?p=269"},"modified":"2024-01-14T12:31:20","modified_gmt":"2024-01-14T17:31:20","slug":"install-freebsd-oracle-cloud","status":"publish","type":"post","link":"http:\/\/10.42.0.68:8080\/blog\/install-freebsd-oracle-cloud","title":{"rendered":"Install FreeBSD 13.1 on Oracle Cloud"},"content":{"rendered":"\n

Oracle Cloud doesn’t propose FreeBSD like a lot of providers so we need to install it using a direct flash<\/em>.<\/p>\n\n\n\n

This is my initial setup phase and everything starts with an Always-Free running Oracle Linux.<\/p>\n\n\n\n

Flashing FreeBSD 13.1<\/h2>\n\n\n\n

Connected using ssh and using root:<\/p>\n\n\n\n

    \n
  1. You need to check that you have wget<\/code> installed otherwise you need to install it: dnf install wget -y<\/code><\/li>\n\n\n\n
  2. Identify your disk with fdisk -l<\/code>, in my case it’s \/dev\/sda<\/strong><\/li>\n\n\n\n
  3. Flashing: It depends on your VM (AMD64 or AARCH64), you need to use the good one<\/li>\n<\/ol>\n\n\n\n
    # AMD64\nwget https:\/\/download.freebsd.org\/ftp\/releases\/VM-IMAGES\/13.1-RELEASE\/amd64\/Latest\/FreeBSD-13.1-RELEASE-amd64.raw.xz -O - | xz -dc | dd of=\/dev\/sda bs=1M cov=fdatasync\n\n# AARCH64\nwget https:\/\/download.freebsd.org\/ftp\/releases\/VM-IMAGES\/13.1-RELEASE\/aarch64\/Latest\/FreeBSD-13.1-RELEASE-arm64-aarch64.raw.xz -O - | xz -dc | dd of=\/dev\/sda bs=1M cov=fdatasync<\/code><\/pre>\n\n\n\n
      \n
    1. Initiate the reboot using the dashboard: https:\/\/cloud.oracle.com<\/li>\n<\/ol>\n\n\n\n

      FreeBSD is now installed<\/p>\n\n\n\n

      Post-install steps<\/h2>\n\n\n\n

      Using the console using the dashboard, let’s do a quick config and enable ssh.<\/p>\n\n\n\n

      Switch from quarterly to the latest repository (optional)<\/h3>\n\n\n\n

      Depending on the version: quarterly is valid for your usage or not.<\/p>\n\n\n\n

      sed -i '' 's\/quarterly\/latest\/' \/etc\/pkg\/FreeBSD.conf<\/code><\/pre>\n\n\n\n

      Update the system<\/h3>\n\n\n\n
      freebsd-update fetch install\npkg update\nreboot<\/code><\/pre>\n\n\n\n

      Install packages<\/h3>\n\n\n\n

      Let’s install a text editor, tmux, a sudo<\/code> alternative, a DHCP client doing IPv4 and IPv6 and OpenSSH<\/p>\n\n\n\n

      pkg install -y doas dual-dhclient-daemon openssh-portable tmux vim<\/code><\/pre>\n\n\n\n

      sudo<\/code> is also available but on FreeBSD, I prefer doas<\/code><\/p>\n\n\n\n

      Config doas<\/code> for group wheel<\/h3>\n\n\n\n
      echo \"permit :wheel\" > \/usr\/local\/etc\/doas.conf<\/code><\/pre>\n\n\n\n

      Config ssh server<\/h3>\n\n\n\n
      vim \/usr\/local\/etc\/ssh\/sshd_config<\/code><\/pre>\n\n\n\n

      In my case, I force post-install (before the configuration management run (ansible\/saltstack)):<\/p>\n\n\n\n