Operating Systems, Tutorials

How to Install OpenBSD Easily

July 13, 2016


The OpenBSD operating system is notable for its strong security and integration of security features like memory protection, built-in cryptography, and pf packet filter. In 1995, OpenBSD was forked from NetBSD. OpenBSD utilizes the X Window System and therefore is sufficient for desktop usage. The user is able to select and download popular applications through packages such as desktop environments like GNOME and Xfce. More significantly, security is also tightened since OpenBSD essentially is a barebone, stripped of applications right from the start. This decreases security risks and lets the user decide what he wants to install on their system.

Installing OpenBSD (Guide starts here.)

There are many different ways to install OpenBSD on your system. For purposes of this guide, we will be using an ISO image.

1.  To download the ISO imagine, choose the closest download mirror from here.

2. Choose the latest version number folder, “5.9” (Latest at the time of this post.)

3. Choose the appropriate architecture for your system.

4. Select the download file, “install59.iso“.

5. You may now burn this ISO image onto a CD or DVD. Perhaps you may want to use it on VirtualBox.

6. You will be greeted with something like this “Welcome to the OpenBSD/amd64 5.9 installation program. (I)nstall, (U)grade, (A)utoinstall or (S)hell?”

7. Type I and press ENTER to initiate the install process.

8. Select a keyboard layout, such as the United States. (Type in us.) For more keyboard layout choices, type a question mark ?

9. Press ENTER.

10. You will be asked to create a system hostname. Type in your system hostname.

11. You will be shown the list of available network interfaces such as em0 vlan0 and you will be asked which one you would like to configure. The default variant is displayed in square brackets such as {em0}. Thus, let’s configure the em0 interface.

12. With the default variant selected, press ENTER while the string beside the default variant is empty.

13. When asked for the IPv6 address and vlan0, you skip these configurations.

14. You will be asked to create a root password for your root account. Please don’t use something simple like 1234 or abcd. Incorporate letters, numbers, and symbols into your root password for security. You need to type it in twice when asked to confirm that the root password you have set is correct.

15. You will be asked about the default launch of OpenSSH Daemon (sshd), Network Time Protocol daemon (ntpd), and X Window system. If you don’t possess the knowledge of daemons, leave these at their default values. If you know, you may configure this freely as you wish.

16. You will be asked to create a user, thus use a name that you want.

17. You will be asked to set a password for user. Create and enter your desired password.

18. Set a timezone. The system will detect your timezone automatically. You may change the default value. Just type in a question mark and choose your preferred timezone.

19. You will be presented with setting up your partitions. The partition manager is capable of auto-allocated layout. You may edit the auto-allocated layout by typing and entering “E” or you may choose to create your own layout by typing and entering “C“.

IMPORTANT NOTE: Set FFS/UFS (Unix file system).

20. Sets selection. Sets are elements of the system. If you want more sets, you may choose http as location for sets. Type and enter “done” and wait for about a minute. During the installation of sets, you will see numerous installation messages.

21. Installation is now complete. Type and enter “reboot“. Congratulations! You have now successfully installed your OpenBSD system.

Additional Instructions after Installation.

Set your package path environment variable

Type in the following into the terminal in order to set download path for all OpenBSD packages (retype after restart to set PKG PATH again before attempting to install packages again):

export PKG_PATH=http://ftp.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(arch -s)/

Install the nano text editor, one of the easier text editors to use on BSD systems

1. Gain root permissions in order to install packages by typing in su in your terminal. Now enter your root password.

2. Type in terminal: pkg_add -Iv nano

IMPORTANT NOTE: Never login fully as root as it may harm your computer.

To enable PKG_PATH permanently set on your system, edit .profile file in your home directory to be something like this:

1. Type in terminal: nano .profile

You will see something similar like below except I already edited it for you.

# $OpenBSD: dot.profile,v 1.4 2005/02/16 06:56:57 matthieu Exp $


# sh/ksh initialization



PKG_PATH=ftp://ftp.openbsd.or.id/pub/OpenBSD/5.0/packages/`machine -a`/



2. What I basically did was add PKG_PATH into the second line after spacing the export line into the empty third line. Just follow the example above.

3. Now press CTRL + X to save the modified file and exit.

You will now be able to install packages without having to type and enter in your package path environmental variable manually everytime you restart your OpenBSD system.

Install XFCE (Desktop GUI)

1. Type in pkg_add -Iv xfce

You can also install Slim if you’d like using: pkg_add -Iv slim slim-themes   

1. Type in your terminal:  nano /etc/rc.local (to open and edit rc.local)

2. Type in /usr/local/bin/slim -d

3. Press CTRL + X to save the modified file and exit.

Install Firefox (Web Browser)

Type in pkg_add Firefox

VirtualBox (Making your system full screen)

If you run OpenSD on VirtualBox. You will be unable to install Guest Additions since it is not available. Therefore, you can not get the optimal full screen on your OpenBSD system without having to launch the VBoxManage utility on the host system and editing the xorg.config file.

1. You need to set a custom video mode in VirtualBox. Use the VBoxManage utility on your host system. (VBoxManage.exe on Windows, /Applications/VirtualBox.app/Contents/MacOS/VBoxManage on OS XVBoxManage on Linux)

2. Type this into your terminal: VBoxManage setextradata [VM-name] CustomVideoMode1 [WxHxBPP]

Replace [VM-name] with your Virtual Machine’s name and [WxHxBPP] with your resolution and bit-per-pixel currently running on your host OS, such as 1920x1080x32.

Example: If you are on Windows, launch Command Prompt. Then type in cd Program Files\Oracle\VirtualBox and then the command above from step two to set a custom video mode for your virtual machine.

3. Launch OpenBSD in your VirtualBox.

4. Login as superuser by going into the terminal and typing: su

5. Enter your root password.

NOTE: Do not ever login directly as root, notably when a network connection has already been established. This could pose as an extreme security risk and a threat to your system.

6. Change directory by going into the terminal and typing: cd /etc/ X11

7. Create and modify the file xorg.config by typing in the terminal this: nano xorg.conf

Copy and paste the configuration file below (NOTE: Remember to change the Depth, DefaultDepth, and Modes at the end of this configuration file to match the resolution and bit-per-pixel you have already set with VBoxManage. This should force the system to use this mode if it’s supported):

Section "ServerLayout"
 Identifier     "X.org Configured"
 Screen      0  "Screen0" 0 0
 InputDevice    "Mouse0" "CorePointer"
 InputDevice    "Keyboard0" "CoreKeyboard"

Section "Files"
 ModulePath   "/usr/X11R6/lib/modules"
 FontPath     "/usr/X11R6/lib/X11/fonts/misc/"
 FontPath     "/usr/X11R6/lib/X11/fonts/TTF/"
 FontPath     "/usr/X11R6/lib/X11/fonts/OTF"
 FontPath     "/usr/X11R6/lib/X11/fonts/Type1/"
 FontPath     "/usr/X11R6/lib/X11/fonts/100dpi/"
 FontPath     "/usr/X11R6/lib/X11/fonts/75dpi/"

Section "Module"
 Load  "dbe"
 Load  "dri"
 Load  "extmod"
 Load  "glx"
 Load  "freetype"

Section "InputDevice"
 Identifier  "Keyboard0"
 Driver      "kbd"

Section "InputDevice"
 Identifier  "Mouse0"
 Driver      "mouse"
 Option     "Protocol" "wsmouse"
 Option     "Device" "/dev/wsmouse"
 Option     "ZAxisMapping" "4 5 6 7"

Section "Monitor"
 Identifier   "Monitor0"
 HorizSync    31-80
 VertRefresh  30-100
 VendorName   "Monitor Vendor"
 ModelName    "Monitor Model"

Section "Device"
 Identifier  "Card0"
 Driver      "vesa"
 VendorName  "InnoTek"
 BoardName   "VirtualBox Graphics Adapter"
 BusID       "PCI:0:2:0"

Section "Screen"
 DefaultDepth  32
 Identifier "Screen0"
 Device     "Card0"
 Monitor    "Monitor0"
 SubSection "Display"
  Viewport   0 0
  Depth     32
  Modes     "1920x1080"

You Might Also Like

No Comments

Leave a Reply

Back to top
%d bloggers like this: