Hari's Corner

Humour, comics, tech, law, software, reviews, essays, articles and HOWTOs intermingled with random philosophy now and then

My FreeBSD journey - part 1

Filed under: Tutorials and HOWTOs by Hari
Posted on Wed, May 5, 2010 at 10:23 IST (last updated: Tue, May 18, 2010 @ 12:55 IST)

In this series Next >
This is probably going to be a series of short notes on my FreeBSD 8.0 installation. This is more a personal reference rather than a full-fledged guide, but I hope some people will benefit from it. Use the FreeBSD handbook as your main source of information.

Note 1: that this is a desktop user's perspective.

Note 2: I've simplified a lot of this because I did have to struggle to find out a few tricks. That's why I am documenting this now.

Initial Configuration and Setting up the Boot Loader

After the FreeBSD installation, I was left with a non-booting system as I chose not to install the FreeBSD loader in the MBR. However, the GRUB super disk came to the rescue and I was able to boot Vista no problem.

Then I downloaded and installed EasyBCD, a GUI configurator for the Vista boot manager and that way I restored the MBR to a working state.

Setting up the default user

I added the newly created normal user to the group "wheel". This is a great convenience factor as I can su as root whenever I want. For this I edited the /etc/groups file and found the line:
wheel:*:0:root
and added the user as follows:
wheel:*:0:root,myname
(Note that there should be no space between the commas.

Networking and hostname setup

Since I added a default network, I wanted to avoid the long delay on boot which occurs when you're not connected to a network. To this end, I appended my hostname to the loopback IP 127.0.0.1 /etc/hosts.

Also in /etc/rc.conf I disabled MTA, by added a line
sendmail_enable="NONE"

This speeded up the boot process quite a bit.

Xorg and GDM setup

After generating the initial X configuration file, using X -configure I noticed that the mouse and keyboard wouldn't work with the setup. I edited out the keyboard and mouse devices section and added this in the serverlayout:
Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen         0  "Screen0" 0 0
        Option      "AutoAddDevices" "True"
        Option         "AutoEnableDevices" "True"
EndSection

Having configured Xorg successfully I wanted to load GDM automatically on boot. To make Gnome and GDM work properly, I had to edit the /etc/rc.conf file and add these lines:
dbus_enable="YES"
gnome_enable="YES"
powerd_enable="YES"
gdm_enable="YES"

powerd is necessary for ACPI functionality to work properly. Also without hal and dbus Gnome won't work properly.

For shutdown and reboot to work, add this line to /etc/fstab:
proc    /proc    procfs   rw    0       0

Now shutdown and reboot should work from within GDM.

Sound and wireless networking

To make wireless and sound work, I had to dig a bit into the FreeBSD handbook and wireless proved to be quite a nuisance until I realized that I had to create a wlan0 interface. My laptop has the Intel 3945ABG which uses the if_wpi FreeBSD driver and requires the wpifw firmware as well.

I enabled the kernel support for wireless and sound by editing /boot/loader.conf:
legal.intel_wpi.license_ack=1
wpifw_load="YES"
if_wpi_load="YES"
wlan_scan_ap_load="YES"
wlan_scan_sta_load="YES"
firmware_load="YES"
wlan_amrr_load="YES"
pci_load="YES"
wlan_wep_load="YES"
wlan_tkip_load="YES"
wlan_ccmp_load="YES"
snd_driver_load="YES"
(I realize that I probably don't need all of that and some of them will be loaded as dependencies.)

Now since I use WPA-PSK encryption I created the /etc/wpa_supplicant.conf file as follows:
network={
  ssid="mySSID"
  psk="myPassPhrase"
}

Then I added these line in /etc/rc.conf to automatically run wpa_supplicant and configure the interface:
wlans_wpi0="wlan0"
ifconfig_wlan0="WPA DHCP"

I struggled with the above bit as directly using the wpi0 interface failed and I had no clue how to resolve it.

So far it's been quite hard and as you can see it's not as friendly as modern Linux distributions. FreeBSD makes very little assumptions about your default setup and simply dumps you into a *nix shell when you first log in. Everything from there is what you know.

The journey is by no means complete as I still have to install my software and see if I can set up everything else the way I want to as in Linux. Whether I am successful or not will be documented in part 2 of this.

FreeBSD is not for the faint-hearted. :-P

In this series

3 comment(s)

  1. Why FreeBSD and not PC-BSD? The latter is aimed at the desktop market, whereas the former is, of course, more "pure".

    Whatever the reason, good choice and hope it all goes well.

    Comment by ray (visitor) on Thu, May 6, 2010 @ 17:03 IST #
  2. Simple answer: Gnome :D

    PC-BSD is KDE oriented and I hate having to remove KDE and install Gnome over it. It leaves a lot of cruft behind. I like a pure Gnome installation.

    Comment by Hari (blog owner) on Thu, May 6, 2010 @ 18:17 IST #
  3. Ah, that makes sense. :-D

    Comment by ray (visitor) on Fri, May 7, 2010 @ 13:51 IST #

Comments closed

The blog owner has closed further commenting on this entry.