Installation

The OpenBSD team makes a new release every six months with target release dates in May and November. OpenBSD 3.9 was released on May 1 2006.

What follows is a demonstration of an OpenBSD installation on an i386 computer. Your installation process will vary, that being said I do not have the time or space to cover every area where problems might arise. If you have problems do a Google search for help that's what I do and it should work for you also.

This simple demonstration will show a clean install, meaning any operating system or information already on the computer will be erased. You can dual-boot OpenBSD with Linux, Windows or other operating systems but that type of setup will not be discussed here.

Note:  This demo assumes you are a first time OpenBSD user and not a first time user of UNIX-like operating systems.


My Setup

  • CPU: Intel Pentium-IV 2GHz
  • RAM: 512MB
  • HD: 26GB
  • CD-ROM: Mitsumi FX240S
  • FD: 1.44MB
  • NIC: Netgear FA311 10/100 Ethernet Card
  • Monitor: SyncMaster 912N
  • css card: nVidia GF4 MX440SE 64MB
  • Sound card: none
  • Linksys router: connected to a DOCSIS modem
  • Online connection: 5Mb (DOCSIS cable modem)


Step 1 - Obtaining OpenBSD

There are 3 popular methods for obtaining OpenBSD:
  • Purchase a hard copy
  • Using OpenBSD's installer
  • Ask Santa


  • Since I'm always naughty and never nice I prefer to purchase OpenBSD. I get my copies from Fry's Electronics but there are many other places to do so. You actually pay for something that is free? Yes I do, and how many people purchase bottled water?

    If you purchase a hard copy of OpenBSD you will get the entire OS, along with the source code, installation instructions and other miscellaneous things on 3 CDs.

    But if you are a first time user just download the installer and take OpenBSD out for a test drive before you decide to buy.


    Step 2 - Installer program

    In order to install OpenBSD an installation program from openbsd.org must be used. This installation program will be loaded onto a computer using either a floppy disk or CD-R, the CD-R being created by an ISO image.

    There are different ISO images and floppy files for laptops, servers and desktop pcs. Go here to determine which file is right for you.

    If you are using a desktop pc you will more than likely use one of these:
    openbsd39s.iso:
    ——————
    ANNOUNCEMENT
    HARDWARE
    PACKAGES
    PORTS
    README
    SIZES
    i386/
    ports.tar.gz

    openbsd39.iso:
    —————–
    ANNOUNCEMENT
    Changelogs/
    HARDWARE
    PACKAGES
    PORTS
    README
    SIZES
    XF4.tar.gz
    ftp-src.tar.gz
    ftp-sys.tar.gz
    i386/
    ports.tar.gz

    I'm not going into detail on the proper way to copy these files to a floppy or CD-R so they are bootable. But briefly:
    • To create a bootable floppy disk using Windows XP (NTFS) you will need the program, ntrw.exe.
      Next create the floppy with the following command: ntrw <image file> <floppy drive> [ example: ntrw floppy39.fs a: ]
    • To create a bootable floppy disk using Linux use the following command: cp floppy39.fs /dev/fd0
    • To create a bootable CD-R from an ISO image with Windows XP a tutorial can be found here.
    • To create a bootable CD-R from an ISO image with Linux a tutorial can be found here.
    Note:  If you are a Linux user and have downloaded an entire Linux distro on a set of ISOs (such as Fedora and Slackware) then you will notice the bootable ISO for OpenBSD is different. The OpenBSD ISO is 4 meg in size and acts as an installation program that will go on-line to download the entire operating system after the initial system setup.



    Step 3 - Starting the installation

    Okay now we have either a bootable floppy disk or a bootable CD-R which contains the installation program.

    You should also remember to have your computer connected on-line unless the OpenBSD sets are located locally. This connection will be configured during the installation process in order to do a remote install.

    Boot your computer up using the install floppy or CD-R.

    The first screen below starts after the boot process and shows the start of the installation program, red text is user input:
    erase ^?, werase ^W, kill ^U, intr ^C, status ^T
    (I)nstall, (U)pgrade or (S)hell? i

    Welcome to the OpenBSD/i386 3.9 install program.

    This program will help you install OpenBSD in a simple and rational way. At
    any prompt except password prompts you can run a shell command by typing
    '!foo', or escape to a shell by typing '!'. Default answers are shown in []'s
    and are selected by pressing RETURN. At any time you can exit this program by
    pressing Control-C and then RETURN, but quitting during an install can leave
    your system in an inconsistent state.

    Specify terminal type: [vt220] <enter>
    kbd(8) mapping? ('?' for list) [none] <enter>

    IS YOUR DATA BACKED UP? As with anything that modifies disk contents, this
    program can cause SIGNIFICANT data loss.

    It is often helpful to have the installation notes handy. For complex disk
    configurations, relevant disk hardware manuals and a calculator are useful.

    Proceed with install? [no] y
    Cool! Let's get to it...

    You will now initialize the disk(s) that OpenBSD will use. To enable all
    available security features you should configure the disk(s) to allow the
    creation of separate filesystems for /, /tmp, /var, /usr, and /home.

    Available disks are: wd0.
    Which one is the root disk? (or done) [wd0] <enter>
    Do you want to use *all* of wd0 for OpenBSD? [no] y
    Putting all of wd0 into an active OpenBSD MBR partion (type 'A6')...done.

    You will now create an OpenBSD disklabel inside the OpenBSD MBR
    partition. The disklabel defines how OpenBSD splits up the MBR partition
    into OpenBSD partitions in which filesystems and swap space are created.

    The offsets used in the disklabel are ABSOLUTE, i.e. relative to the
    start of the disk, NOT the start of the OpenBSD MBR partition.

    disklabel: no disk label
    WARNING: Disk wd0 has no label. You will be creating a new one.

    # using MBR partition 3: type A6 off 63 (0x3f) size 53464257 (0x32fccc1)

    Treating sectors 65-53464320 as the OpenBSD portion of the disk.
    You can use the 'b' command to change this.


    Step 4 - Partitioning

    Looking at the table below, notice that my hard drive is already sliced up into 6 partitions (partition C is not counted).

    Initial label editor (enter '?' for help at any prompt)
    > p m

    device: /dev/rwd0c
    type: ESDI
    disk: ESDI/IDE disk
    label: WDC WD273BA
    bytes/sector: 512
    sectors/track: 63
    tracks/cylinder: 16
    sectors/cylinder: 1008
    cylinders: 16383
    total sectors: 53464320
    free sectors: 0
    rpm: 3600

    16 partitions:
    #        size   offset    fstype   [fsize bsize   cpg]  
      a:    80.2M     0.0M    4.2BSD     2048 16384   162
      b:   300.2M    80.2M      swap 
      c: 26105.6M     0.0M    unused        0     0 
      d:    80.2M   380.5M    4.2BSD     2048 16384   164
      e:    80.2M   460.7M    4.2BSD     2048 16384   164
      g:  2048.0M   540.9M    4.2BSD     2048 16384   328
      h: 23516.7M  2588.9M    4.2BSD     2048 16384   328

    At this point I'm going to delete all partitions (except for partition C, which represents the entire disk) for a clean install. Remember that this type of installation will erase any information already on the hard drive.

    > d a
    > d b
    > d d
    > d e
    > d g
    > d h
    > p m
    device: /dev/rwd0c
    type: ESDI
    disk: ESDI/IDE disk
    label: WDC WD273BA
    bytes/sector: 512
    sectors/track: 63
    tracks/cylinder: 16
    sectors/cylinder: 1008
    cylinders: 16383
    total sectors: 53464320
    free sectors: 0
    rpm: 3600

    16 partitions:
    #        size   offset    fstype   [fsize bsize   cpg]  
      c: 26105.6M     0.0M    unused        0     0

    Now let's create the partitions that will be used to install OpenBSD.

    > a a
    offset: [63] <enter>
    size: [53464257] 640m
    FS type: [4.2BSD] <enter>
    mount point: [none] /
    > a b
    offset: [1310400] <enter>
    size: [52153920] 300m
    FS type: [swap] <enter>
    > a d
    offset: [1925280] <enter>
    size: [51539040] 640m
    FS type: [4.2BSD] <enter>
    mount point: [none] /tmp
    > a e
    offset: [3235680] <enter>
    size: [50228640] 640m
    FS type: [4.2BSD] <enter>
    mount point: [none] /var
    > a g
    offset: [4546080] <enter>
    size: [48918240] 16g
    FS type: [4.2BSD] <enter>
    mount point: [none] /usr
    > a h
    offset: [38100384] <enter>
    size: [15363936] <enter>
    FS type: [4.2BSD] <enter>
    mount point: [none] /home
    > w
    > q
    No label changes.
    Mount point for wd0d (size=320k)? (or none or done) [/tmp] <enter>
    Mount point for wd0e (size=320k)? (or none or done) [/var] <enter>
    Mount point for wd0g (size=16777018k)? (or none or done) [/usr] <enter>
    Mount point for wd0h (size=9954000k)? (or none or done) [/home] <enter>
    Mount point for wd0d (size=320k)? (or none or done) [/tmp] done
    No more disks to initialize.

    OpenBSD filesystems:
    wd0a /
    wd0d /tmp
    wd0e /var
    wd0g /usr
    wd0h /home

    The next step *DESTROYS* all existing data on these partitions!
    Are you really sure that you're ready to proceed? [no] y
      /dev/rwd0a:     1310336 sectors in 1300 cylinders of 16 tracks, 63 sectors
              639.8MB in 4 cyl groups (328 c/g, 161.44MB/g, 20608 i/g)
      /dev/rwd0d:     1310400 sectors in 1300 cylinders of 16 tracks, 63 sectors
              639.8MB in 4 cyl groups (328 c/g, 161.44MB/g, 20608 i/g)
      /dev/rwd0e:     1310400 sectors in 1300 cylinders of 16 tracks, 63 sectors
              639.8MB in 4 cyl groups (328 c/g, 161.44MB/g, 20608 i/g)
      /dev/rwd0g:     33554304 sectors in 33288 cylinders of 16 tracks, 63 sectors
              16383.9MB in 102 cyl groups (328 c/g, 161.44MB/g, 20608 i/g)
      /dev/rwd0h:     15363936 sectors in 15242 cylinders of 16 tracks, 63 sectors
              7501.9MB in 47 cyl groups (328 c/g, 161.44MB/g, 20608 i/g)
      /dev/wd0a on /mnt type ffs (rw, asynchronous, local, ctime=Sun Jan 10 21:
      50:36 2005)
      /dev/wd0h on /mnt/home type ffs (rw, asynchronous, local, nodev, nosuid,
       ctime=Sun Jan  10 21:50:36 2005)
      /dev/wd0d on /mnt/tmp type ffs (rw, asynchronous, local, nodev, nosuid, 
      ctime=Sun Jan  10 21:50:36 2005)
      /dev/wd0g on /mnt/usr type ffs (rw, asynchronous, local, nodev, ctime=Su
      n Oct 10 21:50:36 2005)
      /dev/wd0e on /mnt/var type ffs (rw, asynchronous, local, nodev, nosuid, 
      ctime=Sun Jan 10 21:50:36 2005)


    Step 5 - Network configuration

    My computers are connected to a Linksys router, the router is connected to a DOCSIS cable modem and why I'm using Class C IP addressing. Your setup will vary here but this is a typical configuration for any network connection, so you shouldn't have any problems figuring things out.

    System hostname (short form, e.g. 'foo'): openbsd
    Configure the network? [yes] <enter>
    Available interfaces are: sis0.
    Which one do you wish to initialize? (or 'done') [sis0] <enter>
    Symbolic (host) name for sis0? [openbsd] <enter>
    The media options for sis0 are currently
          media: Ethernet autoselect (100baseTX full-duplex)
    Do you want to change the media options? [no] <enter>
    IPv4 address for sis0? (or 'none' or 'dhcp') 192.168.1.7
    Netmask? [255.255.255.0] <enter>
    No more interfaces to initilaize.
    IPv6 address for sis0? (or 'rtsol' or 'none') <enter>
    No more interfaces to initialize.
    DNS domain name? (e.g. 'bar.com') [my.domain] openbsd101
    DNS nameserver? (IP address or 'none') [none] <enter the ip address for your nameserver here>
    Use the nameserver now? [yes] <enter>
    Default IPv4 route? (IP address, 'dhcp' or 'none') 192.168.1.1
    add net default: gateway 192.168.1.1
    Edit hosts with ed? [no] <enter>
    Do you want to do any manual network configuration? [no] <enter>
    Password for root account? (will not echo) ILikeMonkeys
    Password for root account? (again) ILikeMonkeys



    Step 6 - Retrieval of sets

    Now I'm asked where the installer should find the sets or "parts" of the operating system. There are several locations to pick from, so I've decided to get the sets from a remote FTP server.

    You will now specify the location and names of the install sets you want to
    load. You will be able to repeat this step until all of your sets have been
    successfully loaded. If you are not sure what sets to install, refer to the
    installation notes for details on the contents of each.

    Sets can be located on a (m)ounted filesystem; a (c)drom, (d)isk or (t)ape
    device; or a (f)tp, (n)fs or (h)ttp server.
    Where are the install sets? f

    Let's install the sets!
    Location of sets? (cd disk ftp http or 'done') [cd] f
    HTTP/FTP proxy URL? (e.g. 'http://proxy:8080', or 'none') [none] <enter>
    Display the list of known ftp servers? [yes] y

    At this point a list of FTP servers will be displayed, pick a server near you, which will obviously speed up your download time. Next the installer asks me what sets I want to install.

    Server? (IP address, hostname, list# or 'done') [q] 61
    Using ftp5.usa.openbsd.org/pub/OpenBSD Redwood City, CA, USA
    Server? (IP address, hostname , list#, 'done' or '?') [ftp5.usa.openbsd.org] <enter>
    Does the server support passive mode ftp? [yes] <enter>
    Server directory? [pub/OpenBSD/3.9/i386] <enter>
    Login? [anonymous] <enter>
    ......
    The following sets are available. Enter a filename, 'all' to select
    all the sets, or 'done'. You may de-select a set by prepending a '-'
    to its name.
    
              [X] bsd
              [X] bsd.rd
              [ ] bsd.mp
              [X] base39.tgz
              [X] etc39.tgz
              [X] misc39.tgz
              [X] comp39.tgz
              [X] man39.tgz
              [X] game39.tgz
              [ ] xbase39.tgz
              [ ] xetc39.tgz
              [ ] xshare39.tgz
              [ ] xfont39.tgz
              [ ] xserv39.tgz
    
    File Name? (or 'done') [bsd.mp] all
    
    The following sets are available. Enter a filename, 'all' to select
    all the sets, or 'done'. You may de-select a set by prepending a '-'
    to its name.
    
              [X] bsd
              [X] bsd.rd
              [X] bsd.mp
              [X] base39.tgz
              [X] etc39.tgz
              [X] misc39.tgz
              [X] comp39.tgz
              [X] man39.tgz
              [X] game39.tgz
              [X] xbase39.tgz
              [X] xetc39.tgz
              [X] xshare39.tgz
              [X] xfont39.tgz
              [X] xserv39.tgz
    
    File Name? (or 'done') <enter>
    Ready to install sets? [yes] <enter>
    Getting bsd ...
    100% |**************************************************|  5332 KB    00:26    
    Getting bsd.rd ...
    100% |**************************************************|  4622 KB    00:25    
    Getting bsd.mp ...
    100% |**************************************************|  5374 KB    00:23    
    Getting base39.tgz ...
    100% |**************************************************| 39523 KB    02:39    
    Getting etc39.tgz ...
    100% |**************************************************|  1126 KB    00:08    
    Getting misc39.tgz ...
    100% |**************************************************|  2222 KB    00:14    
    Getting comp39.tgz ...
    100% |**************************************************| 73524 KB    03:36    
    Getting man39.tgz ...
    100% |**************************************************|  7258 KB    00:30    
    Getting game39.tgz ...
    100% |**************************************************|  2538 KB    00:12    
    Getting xbase39.tgz ...
    100% |**************************************************| 10313 KB    00:51    
    Getting xetc39.tgz ...
    100% |**************************************************| 90404       00:04    
    Getting xshare39.tgz ...
    100% |**************************************************|  2029 KB    00:10    
    Getting xfont39.tgz ...
    100% |**************************************************| 32456 KB    02:41    
    Getting xserv39.tgz ...
    100% |**************************************************| 19410 KB    01:26    
    
    Sets can be located on a (m)ounted filesystem; a (c)drom, (d)isk or (t)ape
    device; or a (f)tp, (n)fs or (h)ttp server.
    Where are the install sets? (or 'done') [done] <enter>
    
    Location of sets? (cd disk ftp http or 'done') [done] <enter>
    

    Total time was just under 12 minutes for a 137 meg download. Making me appreciate cable modems more and more.

    And now we finalize the installation:

    Start sshd(8) by default? [yes] <enter>
    Start ntpd(8) by default? [no] <enter>
    Do you expect to run the X Window System? [yes] <enter>
    Change the default console to com0? [no] <enter>
    Saving configuration files......done.
    Generating initial host.random file ......done.
    What timezone are you in? ('?' for list) [Canada/Mountain] ? Asia/Shanghai
    Setting local timezone to 'America/Los_Angeles' ...done.
    Making all device nodes...done.
    Installing boot block...
    boot: /mnt/boot
    proto: /usr/mdec/biosboot
    device: /dev/rwd0c
    /usr/mdec/biosboot: entry point 0
    proto bootblock size 512
    /mnt/boot is 3 blocks x 16384 bytes
    fs block shift 2; part offset 63; inode block 208, offset 3368
    using MBR partition 3: type 166 (0xa6) offset 63 (0x3f)
    done.

    CONGRATULATIONS! Your OpenBSD install has been successfully completed!
    To boot the new system, enter halt at the command prompt. Once the
    system has halted, reset the machine and boot from the disk.
    # halt
    syncing disks... done

    The operating system has halted.
    Please press any key to reboot.

    Remove the bootable floppy disk or bootable CD-R, then reboot.

    Have fun and enjoy.


    If you notice any errors, please let me know.


    Other OpenBSD tutorials

    OpenBSD is a registered trademark of Theo de Raadt. No affiliation between this site and the OpenBSD project exists or is implied.