LUGBZ logo LBSBZ logo


OpenBSD

for Linux Geeks

2005-07-09





(C) 2005 Chris Mair <chris@1006.org>
http://www.1006.org/pd/2005_openbsd_for_linux_geeks/




Index


  1. Installing OpenBSD
  2. First steps
  3. The base system / differences to Linux
  4. Installing application packages




Installing OpenBSD


The OpenBSD installer is a very simple installation program (think Debian, but without asking a zillion questions and nagging all the time ;) The hardest part is partitioning, as that works a bit differently from what you're used to!

What Linux calls /dev/hda - your first IDE disk - is called /dev/wd0 here:

wd0

You need to set up just one MBR partition for use with OpenBSD! It must be called "OpenBSD" and its type must be A6:

fdisk

Inside that single MBR partition you'll create so-called disk labels (think about them as sub-partitions) were you'r going to mount your stuff. Here's a good article about BSD disk labels from on onlamp.com.

labeleditor

Ok, go ahead adding disk labels. Note that by convention a is mounted under / and b is the swap space. The c label is special - it represents the whole partition - leave it alone. Here is a typical set of disk labels:

labeleditor-ready

The installer proceeds asking a few (simple) questions. Network hardware is detected reliably under OpenBSD and set up easily.

Finally, you're about to install OpenBSD itself which is devided into install sets. You probably should get all the sets unless you're not interested in graphical applications so you can leave out the x-stuff. bsd.mp is a kernel for multi-processor boxes. Note that these sets are not in any way like the packages you know from Linux distributions.

installsets




First steps


  1. Login as root: you'll find that the C Shell is the default shell under OpenBSD. As a Linux user you're typically not going to like that, because you fell in love with the Bourne Shell. No problem. Just issue chsh(1). Change the line that says /bin/csh to /bin/sh and the day is saved :)

  2. You shouldn't work as root all the time. Set up an unprivileged account now:
     useradd -m -G wheel chris
     passwd chris
    
    Note that adding chris to group wheel is necessary for him to be able to use su(1).

  3. Next, read the afterboot man page:
     man afterboot
    
    You'll find OpenBSD man pages are very well written. Often better than their GNU counterparts! There's also a complete list of FAQ.

  4. Try to start X11 by issueing startx. There should be some safe default configuration for X.org.
    If it doesn't work you need to set up X.org by editing /etc/X11/xorg.conf. You can start by doing X -configure to generate an autodetected configuration file and make adjustments manually. If you happen to do all this on an iBook G4, here is my xorg.conf for it.

    The base system's window manager of choice is good-old fvwm2. Chances are you're not going to like it (honestly it's not set up very well) - we're going to install something better soon...




The base system / differences to Linux


Included software.
OpenBSD contains a wealth of software audited and often patched by the OpenBSD team to improve security and quality: X.org, GCC (with ProPolice), Perl, Apache (chrooted by default), OpenSSL, Groff, Sendmail, BIND, Lynx, Sudo, Ncurses, KAME, Heimdal, Arla, OpenSSH, gdb and many more.
Unlike Linux distributions these are considered part of the OS together with the OpenBSD kernel.

Services.
OpenBSD does not use SystemV style init scripts (/etc/rc.d) and run levels. Edit the files /etc/rc.conf and /etc/inetd.conf to control which services are started at boot time.

File system.
OpenBSD's "native" file system is FFS (the "fast file system"). To increase its performance soft updates are recommended. Add an option softdep to /etc/fstab.

Kernel parameters
To set a kernel parameter at boot time, enter -c at the boot prompt (FAQ 5.8 and FAQ 5.9) and you'll end up in an interactive shell like Grub's. For example, currently you must issue disable apm, to run OpenBSD on qemu.




Installing application packages


Lots of open source software not available in OpenBSD itself is available as addon in a collection of precompiled packages. Note that the packages collection does not go through the thorough security audit that OpenBSD follows!

To use packages, root should define an environment variable pointing to a package repository. For example, you might want to put the following statement into root's .profile to point to the i386 port of the 3.7 package collection:

export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/3.7/packages/powerpc/
(if you're using the Bourne Shell .profile is sourced at login). Watch out for the right architecture! i386 is the standard PC architecture, powerpc is for Apple's boxes, etc...

The rest is easy: use pkg_add(1) to download a package (and automatically, all dependences too). Let's install a good editor:

pkg_add vim-6.3.61-no_x11.tgz

Now it's time to get rid of fvwm2! Xfce is a good desktop environment, that's not as bloated as Gnome or KDE:

pkg_add xfce-mcs-manager-4.0.6.tgz xfce-utils-4.0.6.tgz \
        xfce4-panel-4.0.6.tgz xfdesktop-4.0.6.tgz xfwm4-4.0.6.tgz 

To make xfce the default desktop, edit /etc/X11/xinit/xinitc. Put startxfce4 where it says fvwm || xterm towards the end of the file. Talking about xinitrc: on my iBook G4 at first the backspace key behaved as a delete key. I fixed that by adding the following line to xinitrc too:

xmodmap -e "keysym  Delete = BackSpace"

Note that you need to give the exact package name to pkg_add. You might find it handy to download the package index (HTML), so you can grep for names. It's the poor man's apt-cache search ;)



Puffy
Happy OpenBSD-ing :)




Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.0 Italy License.