Friday, September 27, 2013

OpenBSD - Post Install - Wifi - USB - Pkg_add - What do I Think

v 0.3
29 Sep 13


Well, I've been the proud user of an OpenBSD 5.4 Snapshot installation, on an Asus VX1 laptop for a few days now. My initial impressions are pretty damn good.  Yes it is a basic install (hey, the ISO is only 200 meg or so) but it is clean and uncluttered.  It lets you build the system you want without any crap you don't want - and THAT helps security.  Whilst OpenBSD installs quickly, don't expect a system that can do work "out of the box" - if you do, then you will be sorely disappointed and will miss what is truly a gem.  If you want something like that, then PC-BSD is perfect for you, or on the Linux side something like Ubuntu - or even Debian or Slackware.

Take a couple of relaxing breaths, and tinker and read and gradually you will understand and build your system.

Wireless and USB

As for me, well, I was able to configure the Ethernet port during install, however the Intel Wifi card would not work.  After some reading and checking the man page for it, I worked out I had to either download the firmware directly from the OpenBSD site, or use the specialised program which checked what was needed, downloaded and installed the firmware automatically.

Man page for wpi (my card) is here:

There are two ways you can install the firmware
1. Have a wired ethernet link and use fw_update
2. Download the firmware on another computer, transfer the firmware to the laptop and run pkg_add from the directory the firmware is in.

Of course, if you are going to copy the file to your machine, you will probably use a USB memory stick.  The documentation for this is thorough and I was most impressed to see my USB sticks recognised and easily mounted.

Once the firmware is installed, then you need an appropriate config file in " /etc ".  I got the wireless card to work by putting this line in " /etc/hostname.wpi0 " 

dhcp nwid [SSID] wpakey [PASSWORD]

Packages

Package Management - again, the man page is your friend.  I found using an http mirror to be far more reliable than an ftp mirror, which kept dropping out and failing.  You need to configre " pkg.conf " with mirror sites or package directories .. you can put in more than one.  As mentioned below - if you have the packages in the default directory, then there is no need to specify that directory.

/etc/pkg.conf

installpath=http://mirror.internode.on.net/pub/OpenBSD/snapshots/packages/i386/ 

Remember the trailing "  /  "

Where do they go?

Downloaded packages can be found in " /var/db/pkg "
Installed programs are in " /usr/local/share "



... Later

Tuesday, September 24, 2013

OpenBSD - Windows XP Dual Boot

September 25 2013
v 0.24

Recently, I stumbled upon OpenBSD and I have to say, I like it. Despite a couple of articles I've read proclaiming that it is not as secure as it claims, I'd have to question what the authors of the article understand, since I tend to agree with the OpenBSD people. In a way, OpenBSD is a little like Dassault. Dassault believes that beautiful aeroplanes fly right. OpenBSD believes that beautiful code works properly.

Whilst OpenBSD will not pander to your ignorance (people who wonder what "the big red button does" will find out quickly), having patience and reading and doing research will quickly get you on the right track.

As an aside, my stable of preferred Operating Systems is:
  • Debian Stable (with backports) for pure desktop
  • PC-BSD for desktop / server (nVidia card required for X)
  • OpenBSD for lots of stuff because it works.

Whilst I have been playing with OpenBSD in a Virtualbox VM, I wanted it on hardware. I have an Asus VX1 laptop that has a 160 gig HDD, 2 gig memory and an nVidia video card. It runs Windows XP. Now, WinXP has 6 months before MS withdraws support - no more security updates, so attaching it to the Internet could get (more) exciting. I didn't want to blow XP away if I could help it, so .. here we go.

First I removed all the files I could - hey I wasn't going to need them there anyway .. and I figured I could shrink the NTFS partition to 40 gig, leaving over 100 gig for OpenBSD. Initial disk configuration was:
  • 2 gig hidden recovery partition
  • 88 gig C drive
  • 58 gig D drive

Next .. disable virtual memory and hibernation in XP. (google is your friend). These two features are responsible for the "unmoveable" files shown when you defrag. Whilst I'm sure I could shrink the partition without trouble, I wanted to play nice.

Surgery, boot with a "Parted Magic" CD. Using this, I deleted the "D" extended and logical partitions, and shrank the "C" partition to 40 gig. I was now left with the initial "hidden" recovery partition for WinXP (careful of it - if you ever use it, it will blow away OpenBSD) and the WinXP primary partitions. I created an empty, unformatted partition to fill up the disk, this coming to about 107 gig. It is important to create this partition now as I have shown. It makes things a lot safer and easier later.

OpenBSD installation uses the fdisk program to set the boot partition and to label the installation partition as "A6". THEN it uses the disklabel program to set internal "partitions" and mount points inside this. I'll not describe the process in any more detail, since OpenBSD is not something you should be playing with if you are not able to work things out. The best web-page I found to fill in the blanks and help was this:


Booting the OpenBSD installation CD, I used fdisk to set the bootable partition and set its filesystem type. Then disklabel came up and I eventually accepted the defaults. There are several Youtube videos that give you more insight to this.

With the installation finished, I booted into OpenBSD - as the web page above said, I used fdisk to set the bootable partition back to NTFS and rebooted. Once in Windows again, I used the instructions to add OpenBSD to the Boot menu.

Final tip - remember you have an extra hidden partition, so be careful when you come to specifying partition numbers ...

Done.


PS    Editing the BOOT.INI in Windows ........

The referenced web page doesn't tell all you need to know, nor does it interpret the editing process correctly.

You edit BOOT.INI with the " bootcfg " command.  Whilst you can view boot.ini with notepad, you cannot edit it.  So ...
  • Change default OS .. "  bootcfg /default /ID [linenumber of OS to be default] " .. In our case, we want the second OS to be made the default, so we would use the number 2.
  • Change the timeout .. " bootcfg /timeout 10 "

That's it ..