OpenBSD Desktop on MSI Wind Laptop


I choose MSI Wind both for its well known quality but also because the chipsets are well supported by OpenBSD 4.5. Ethernet chipset and WLAN chipset are from RealTek and RALink which both are well supported. The Atom CPU is well suited for small laptop computers and the Intel graphics chipsets are configured automatically in the default OpenBSD 4.5 install.

Install xfce

Start xfce on boot using xdm

To boot into xdm simply add the following to /etc/rc.conf.local.


.xsession of the actual user will be executed after user login via xdm. Simply add the following to .xsession for each user that like to start xfce. Note that I also need to execute .profile before xfce is started as this is not taken care of by default. .xsession is run as the chosen user in its home folder. See xdm(1) for more information.

. /root/.profile

WLAN setup

I used the description Using WPA on OpenBSD on the Vinci blog as support to the OpenBSD manual pages.

Check that the wifi driver has been configured correctly at boot up using dmesg. The driver is in my case ral0.

Create a “WPA pre-shared key” using wpa-psk.

wpa-psk <SSID> <password>

Configure network interface ral0 using the created key mapping in hostname.if (in my case /etc/hostname.ral0).

dhcp chan 6 nwid <SSID> wpa wpapsk <wpa-psk output>

WEP and open networks

It is still common that open networks on hotels, cafes and airports are using either WEP encryption or using open wifi access in combination with a login via browser.

Starting with WEP security the corresponding configuration in hostname.if would be. Double quotes shall be used when space is used in values.

dhcp nwid "<SSID>" nwkey <hexadecimal password starting with 0x>

Or as the following for string based WEP keys.

dhcp nwid "<SSID>" nwkey "<WEP string password>"

You may also configure the network manually using ifconfig and dhclient. For example.

sudo ifconfig ral0 nwid "home" nwkey "secret" up
sudo dhclient ral0

For open networks you may just exclude the nwkey. Often it is neccesary to login the a certain webpage before the DNS is opened to external internet.

You may also scan for available networks if you don’t know the SSID.

sudo ifconfig ral0 scan

Dynamic WLAN access

ahem… the tools are ALREADY there, of course, and they’re fantastic (ifconfig, dhclient, and all iwi, iwn, ipw Damien wrote!)

This doesn’t work yet for me. May need some patch of the script to work.


I finally made my own wifi script, called Not production proof but useful in most situations.

Multipath setup

As I have both an wired interface and a wireless interface where both may be available or not available. Sometimes I have wired connection and sometimes only a wireless connection. The problem is how to handle routing in this situation. It seems that routes are configured per interface, but I do not understand how to specify a route for a specific interface using route. OpenBSD does however support multipath routes. See Multipath in Networking FAQ and PF: Address Pools and Load Balancing, but I have failed to get it to work. There is also a good overview over different routing capabilities in OpenBSD Routing with OpenBSD using OpenOSPFD and OpenBGPD, but solutions used here (OpenBGPD and OpenOSPFD) are normally used in routers/gateways in large networks which most likely is overkill for my purpose.

Possibly you could also use ifstated or hotplugd to dynamically reconfigure network depending on available network.

In OpenBSD 4.8 both interfaces seems to go up simultaneously. I have also learned that you can setup failover between two interfaces using trunk(4) interfaces. See Interface trunking

3G access via bluetooth

This does not work yet

When you neither have internet access through ethernet nor WLAN there is one last option, 3G access via your mobile phone. The Wind has a bluetooth which is supported by OpenBSD. Check out the following link for an excellent guide on how to set this up.

Some tips on ppp setup to GPRS/UMTS can be found here.

Name lookup

If you configure network interfaces using DHCP the information in resolv.conf(5) will be overwritted by dhclient(5).

In my setup I want to use /etc/hosts for local machines and external DNS for external name lookup. To make sure that lookup priority is ensured you need to add an lookup directive in resolv.conf.tail to ensure that hosts(5) are searched before DNS lookup.

# echo "lookup file bind" > /etc/resolv.conf.tail

See FAQ 6 Networking - DHCP Client for more information.

Locate problem

Directly after install the locate database will not be updated. By default locate database is updated through /etc/weekly script. Common tips indicate that this script should be run to update the locate database, but this does not work in OpenBSD 4.5. The weekly script is run from the root‘s crontab which set up HOME=/var/db. When run as root outside /var the weekly script fails. There are three ways around this problem.

  1. Run locate.updatedb directly
  2. cd /var/db before running weekly script
  3. Wait until weekly script is run by cron. This should work but is not verified.

Upgrade to OpenBSD 4.6

Upgrading to the latest version of OpenBSD went swift as usual. The following steps were performed to complete the upgrade.

  1. Copy the contents CD1(i386) to the local harddisk.
  2. Backup /etc to etc.tgz.
  3. Disable automatic start of XDM at boot.
  4. Reboot and boot from bsd.rd now located on the harddisk.
  5. Choose Update path in the installer. Reboot.
  6. Upgrade packages from packages included on CD.
  7. Upgrade the rest of the packages from favorite ftp server.
  8. Update PKG_PATH setting in .profile
  9. Enable XDM at boot.
  10. Reboot and your done!

Some of the commands entered during this install …

<<on MacOS X host with CD>>
sudo scp -r /Volumes/OpenBSD4.6CD1.../4.6 root@wind:/
<<on target>>
tar czf etc-4.5.tgz /etc
# xdm_flags=""  <<in rc.local.conf>>
boot wd0a:/4.6/i386/bsd.rd <<at boot prompt>>
export PKG_PATH=/4.6/packages/i386
pkg_add -ui -F update -F updatedepends
export PKG_PATH= <<also update .profile>>
pkg_add -ui -F update -F updatedepends