FreeBSD - on a laptop

Posted by Eric Stein - July 20, 2006 CE @ 05:00:15 UTC
Recently I installed PC-BSD on my laptop. It was pretty decent, but it had some problems. I would have continued to use it if a kernel compile that I botched hadn't removed its ability to boot. I needed a new OS, and since I'm going to be out of town this weekend, I needed it fast.

I wanted an OS that had:I've liked BSD since I first used it, so I wanted to give it a try on a laptop. It definitely had the network security - firewall or not (I wanted a firewall anyways). Physical security is reasonably easy in FreeBSD with swap and partition encryption. There is a wide variety of good looking and low resource use desktop environments in the ports collection - I chose Xfce. BSD, being UNIX based, has a great command line. My wifi card is supported natively by the if_ath driver. Here's the kicker - what's cooler than running FreeBSD on a laptop? I guess my mind was made up before I started deciding, but I really think it was a good choice.

Partitioning

During install, I added an extra 3 GB partition to be configured as my home partition later. I'd advise using more than this - I wish I had used more like 8 or 9 GB out of my 17 GB drive, as my home directory is likely to fill up fast.

Loading Modules

After installing the OS, the first thing I did was to set up my /boot/loader.conf:
if_ath_load="YES"
ipfw_load="YES"
geom_eli_load="YES"
This loads the driver for my wifi card, ipfw (firewall), and the module used for encrypting my home partition. Some modules are loaded by default, so this is the list I have now:
bash-2.05b# kldstat
Id Refs Address    Size     Name
1   14 0xc0400000 691928   kernel
2    1 0xc0a92000 d9f4     ipfw.ko
3    1 0xc0aa0000 b944     geom_eli.ko
4    2 0xc0aac000 19f44    crypto.ko
5    2 0xc0ac6000 ad04     zlib.ko
6    1 0xc0ad1000 fa20     if_ath.ko
7    3 0xc0ae1000 3015c    ath_hal.ko
8    2 0xc0b12000 3fbc     ath_rate.ko
9    1 0xc2438000 16000    linux.ko

Network Security

Security configuration was pretty simple too:
linux_enable="YES"
usbd_enable="YES"
syslogd_flags="-ss"          # syslogd - no network
portmap_enable="NO"          # no portmap - security risk
inetd_enable="NO"            # no inetd - no need
firewall_enable="YES"        # use ipfw
firewall_script="/etc/rules" # load rules from /etc/rules
hostname="eowyn"
ifconfig_rue0="DHCP"         # use DHCP to get an IP (wired)
Setting up ipfw can be decidedly confusing when you first start doing it. It took a few hours to come up with this rules script:
ipfw -q -f flush
cmd="ipfw -q add"
$cmd 00001 allow ip from any to any via lo0
$cmd 00002 allow tcp from any to any out setup keep-state
$cmd 00003 allow tcp from any to any in established
$cmd 00010 deny ip from any to any in frag
$cmd 00020 deny ip from any to 127.0.0.0/8
$cmd 00021 deny ip from 127.0.0.0/8 to any
$cmd 00060 deny icmp from any to any in
$cmd 00600 allow tcp from any to any dst-port 68 in
$cmd 00601 deny udp from any to any dst-port 68 in
$cmd 00603 deny tcp from any to any dst-port 68 in
$cmd 65534 allow ip from any to any out keep-state
$cmd 65535 deny ip from any to any
In a nutshell: let anything on localhost work, allow needed network services to work, and let anything that's connecting to the net out.

Physical Security

Configuring encrypted swap was extremely simple. All I had to do was add .eli to the end of the device filename for the swap partition (in /etc/fstab). It was a bit more difficult to encrypt a partition, but it is well documented in the handbook. I'm quite happy with the results:
bash-2.05b# df -h|grep eli
/dev/ad0s1g.eli    2.9G    384M    2.3G    14%    /crypt
bash-2.05b# swapctl -l
Device:       1024-blocks     Used:
/dev/ad0s1b.eli    992416         4

Programs

After setting up the basics, I installed a few programs from ports. To have a reasonably comfortable user experience on a computer, I need abiword, bash2, calc, cvsup-without-gui, eog, fastest_cvsup, firefox, gnome-terminal, kismet, portaudit, screen, scrot, xfce4, xpdf, and xscreensaver. Needless to say, this took awhile to compile on a 333 MHz laptop.

Success

People say Linux isn't ready for the desktop. The people who say Linux is ready for the desktop say BSD isn't. I don't know about Joe sixpack, but BSD is ready for my laptop - a lot readier than Windows or Mac OSX will ever be.

Comments

There are no comments yet.

Post a Comment

Name
Email (not published, I won't spam you)
URL (optional)
Title
Comment
opposite of good?
Worth Saying
Valid XHTML, CSS, RSS | 2ms | Copyright 2004-2025 Eric Stein