Deploying a FreeBSD Workstation

From DFWLPiki
Jump to: navigation, search

Scope of This Document

This is the First Edition of this Document, and its not quite finished yet. --Sharaz 23:39, 22 June 2006 (CDT)

I originally wrote this information up for myself, so I could document the procedures for building a FreeBSD workstation from the ground up. My hope is that someday, someone might happen across this document, and benefit from my experience. This build will be a KDE workstation, with other additions such as webmin, net-snmp, as well as others useful items. The actual FreeBSD 6.1 installation is covered in another document found on this site.

Setup Useful Daemons

We are going to install webmin with ssl, ntpd for time syncronization, and net-snmp. When you configure webmin, be sure to choose 'yes' when asked if you want to use ssl. When configuring net-snmp, make sure you specify snmp-v1 and snmp-v2 community strings that only you know, its just good practice.

# cd /usr/ports/sysutils/webmin; make install clean
# cd /usr/ports/net-mgmt/net-snmp; make install clean

First up, lets manually sync the time of the computer.

# ntpdate -v -b us.pool.ntp.org

Configure net-snmp. Most sites use snmp-v1 or snmp-v2, but net-snmp supports the more secure snmp-v3 as well. If you just want to be able to query your machine against a public or private community string, follow the promts to configure the snmpd.conf file for snmp-v1/v2.

# snmpconf

Configure webmin.

# /usr/local/lib/webmin/setup.sh

Add these damons to /etc/rc.conf, so that they start at boot.

ntpdate_enable="YES"
ntpdate_hosts="us.pool.ntp.org"
snmpd_enable="YES"
webmin_enable="YES"
ntpd_enable="YES"

Ntpd will require the creation and population of the file /etc/ntp.conf, with these settings below. The 'echo restrict' line, should reflect your local network's address.

server us.pool.ntp.org
restrict 192.168.125.0 mask 255.255.255.0 nomodify notrap
driftfile /var/db/ntp.drift 

Last, we start our daemons (webmin already started with the configuration script)

# /etc/rc.d/ntpd start
# /usr/local/etc/rc.d/snmpd start

Prepare Configuration Files

Tell the sound driver to load. This driver is one that will try them all, then load the one it finds. Later, we can discover the one that is in use, and load just that one.

snd_driver_load="YES"

... so add that to /boot/loader.conf. That is a generic meta driver that will load every sound driver available, and if one works, your system will use it. Which driver it chooses can be later used to trim out this generic driver, and specify just the correct one. After you system is up and running with the generic sound driver, you can use these commands to see which drivers are loaded (kldstat will show all, and 'cat /dev/sndstat' will specify which sound driver is currently in use)

[root@athena ~]# kldstat
Id Refs Address    Size     Name
 1   14 0xc0400000 6ab778   kernel
 2    1 0xc0aac000 5f60     snd_ich.ko
 3    2 0xc0ab2000 22b88    sound.ko
 4    1 0xc0ad5000 59960    acpi.ko
 5    1 0xc382f000 16000    linux.ko
 6    1 0xc39ca000 5000     i915.ko
 7    1 0xc39cf000 e000     drm.ko
[root@athena ~]# cat /dev/sndstat
FreeBSD Audio Driver (newpcm)
Installed devices:
pcm0: <Intel ICH6 (82801FB)> at io 0xcfdc0400, 0xcfdc0600 irq 21 bufsz 16384 kld snd_ich (1p/1r/0v channels  duplex default)

Building the Desktop Environment

Now we are finally ready to build the GUI environment. This part is quite lengthy; my Pentium 4 3.2 system took about 22 hours just to compile KDE. X.org was probably about 2 hours. I also include the Nvidia driver on my system, if you do not have an Nvidia based card, omit that step. Also, since xorg and KDE take so long to compile, we use batch mode for them.

# cd /usr/ports/x11/xorg; make BATCH=yes install clean
# cd /usr/ports/x11/kde3; make BATCH=yes install clean
# cd /usr/ports/x11/nvidia-driver; make install clean

Start Your Desktop Environment

Log out root, and log in as your user. If you want KDE to start, you can insert the file .xinitrc into your homedir, and this will cause KDE to load.

# touch .xinitrc
# echo exec startkde >> .xinitrc
# startx

Add Some Useful Desktop Programs

Now that we are up and running, lets open a konsole and become root. Here is a sample of some of the programs I tend to add right away to a new system I build. You can literally spend days exploring and compiling interesting things from the ports collection, so I highly recommend you visit the ports page, and give it a search.

http://www.freebsd.org/ports/index.html
# cd /usr/ports/misc/kdeaddons3; make install clean
# cd /usr/ports/graphics/gwenview; make install clean
# cd /usr/ports/x11/xscreensaver-kde; make install clean
# cd /usr/ports/security/nmap; make install clean
# cd /usr/ports/sysutils/gkrellm2; make install clean
# cd /usr/ports/www/firefox; make install clean
# cd /usr/ports/net-im/gaim; make install clean
# cd /usr/ports/print/acroread7; make install clean
# cd /usr/ports/sysutils/cdrtools; make install clean