OpenBSD

From PrgmrWiki


prgmr.com officially supports installing OpenBSD via the installer ISO.

Ordering

Select None (HVM) as the 'Pre-installed distribution' during checkout.

Starting the Installer

  1. Start by logging into the Management Console.
  2. Select set bootloader, rescue mode, or netboot installer.
  3. Select BSD installers. If this option is not available, please contact support for assistance.
  4. Select OpenBSD. If this option is not available, please contact support for assistance.
  5. Return to the main menu.
  6. Select shutdown.
  7. Select create/start.

Installing

The OpenBSD project has their own installation guide.

At the initial question (I)nstall, (U)pgrade, (A)utoinstall or (S)hell, if you have an autoinstall script available, type A when prompted. Otherwise, type I and press enter. Answer the prompted questions, typing enter without any other input to leave the answer at the default. The following list of selections is a guide:

  • Terminal type? Use the default, vt220. You may change this.
  • System hostname? By default, use the hostname for the VPS. You may change this. Fix mistakes here post-install by editing /etc/myname.
  • Which network interface do you wish to configure? Use the default, xnf0. It will not work with anything different.
  • IPv4 address for xnf0? Use the default, dhcp. A static IP will be configured later.
  • IPv6 address for xnf0? Use the default, none. A static IP will be configured later.
  • DNS domain name? If you don't have another domain to use, use '.xen.prgmr.com'. It will be combined with the system hostname to form the Fully Qualified Domain Name (FQDN.) Fix mistakes here post-install by editing /etc/myname.
  • Change the default console to com0? Use the default, yes. It will not work with anything different.
  • Which speed should com0 use? Use 115200. It should still work with the default 9600.
  • Which disk is the root disk? Use the default, sd0. It will not work with anything different.
  • Use (W)hole disk MBR, whole disk (G)PT or (E)dit? - If you do not wish to configure this, use whole.
  • Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout? If you do not wish to configure this, use a.
  • Location of sets? Use the default, cd0. You may change this.
  • Set name(s)? You can use the default.

If you selected cd0 as the set location, you will be prompted by: Directory does not contain SHA256.sig. Continue without verification? Per the OpenBSD FAQ, the install ISOs do not include a signature file. You may safely use yes here. Alternately, use an http mirror.

The actual installation will occur at this point. The stage Relinking to create unique kernel... may take a long time to complete.

At the prompt Exit to (S)hell, (H)alt or (R)eboot? [reboot] Use h to halt, then press any key.

When the installation is complete, you will be returned to the management console main menu. Next:

  1. Select set bootloader, rescue mode, or netboot installer.
  2. Select Boot from disk.
  3. Return to the main menu.
  4. Select shutdown.
  5. Select system details and record the list of IPs returned.
  6. Select create/start.

The VPS should boot into a brand new installation of OpenBSD, and you will eventually be greeted by a login prompt.

Post-Installation Network Configuration

This step is optional, but highly recommended. As configured above, the installation is using dhcp for IPv4 and no IPv6 address. Instead, it can use both a static IPv4 and static IPv6 address.

IP Addresses

With a text editor such as vi or nano (pkg_add nano), open the file /etc/hostname.xnf0. Remove the line dhcp and replace it with the following, where MY_IPV4_ADDRESS and MY_IPV6_ADDRESS are the IP addresses recorded earlier:

inet MY_IPV4_ADDRESS 255.255.255.0
inet6 MY_IPV6_ADDRESS 64
-autoconf
-autoconfprivacy
-soii

The last two lines prevent OpenBSD from using randomized link-local addresses. Without them, IPv6 will either completely fail to work or performance will be negatively impacted.

Save the file and exit.

Routes

Open the file /etc/mygate in a text editor. Right now it is empty. Here we'll add the IPv4 and IPv6 gateways.

The IPv4 gateway is the first three octets of the IPv4 address combined with '.1' at the end. For example, for an IP address of A.B.C.D, the IPv4 gateway is A.B.C.1.

The IPv6 gateway is the first 4 segments of the IPv6 address combined with with '::1' at the end. For example, for an IP address of A:B:C:D:E:F:G:H, the IPv6 gateway is A:B:C:D::1.

Add the following lines, where MY_IPV4_GATEWAY and MY_IPV6_GATEWAY are the IPv4 and IPv6 gateway addresses:

MY_IPV4_GATEWAY
MY_IPV6_GATEWAY

Save the file and exit.

DNS Resolvers

You may edit the file /etc/resolv.conf, but it is not necessary. Here is a sample file:

nameserver 71.19.145.215
nameserver 71.19.155.120
lookup file bind


Finalizing

Apply the new network configuration:

sh /etc/netstart

Test with:

ping -c1 he.net
ping6 -c1 he.net

Rescue

The shell in the installer may be used to rescue an OpenBSD install.