Desktop FreeBSD Part 1: Installation

By Ed Hurst | Posted at 9:45 PM
What follows is a tutorial aimed specifically at the ordinary desktop user interested in getting started with FreeBSD. Ed provides an easy to understand guide through FreeBSD's Sysinstall installer in part one of this series.

Assumptions

  • You are running a stand-alone machine
  • You are the only user
  • You intend to use this machine as a working desktop computer
  • You connect to the Internet via dialup

Pay attention! Read everything! Okay, that's over-stated, but it really does make a difference if you take the time to let the installer help you. Remember that hitting the TAB key will jump between the list and buttons at the bottom of the page. The arrow keys work within lists, the SPACE bar selects an option if there is a check box, and PGDN and PGUP do just that within lists, too. Read this through once at least before you try the installation. What follows here is a reflection of my experience with FreeBSD 4.9, and there's no guarantee your attempt will happen in precisely this way. Thus, you really should read the official installation instructions at the FreeBSD.org website for whatever version you are installing. It's likely some of it will be over your head, and the sequence of steps may not reflect quite what you find when you boot from the CD. Still, at a minimum you will see pictures of what the various screens look like. I won't provide an exact link here because you really must learn to navigate that site even if you plan only casual use of FreeBSD.


Upon booting, you will see the usual hardware scan. If all is well, it will present you with a kernel options page. While it is unlikely that you will know what to do, it won't hurt to see what's going on.

1. Options for the kernel -- chose "visual" (2nd option)

Take a look at the list, paying attention to the on-screen instructions. It tells you how to expand and collapse the lists. According the FreeBSD Handbook, this is the place to settle driver conflicts, if you happen to understand what's involved. It's quite unlikely anything here will be unworkable for you, so you can exit.

Next, you'll see the Sysinstall menu. You will want to choose the "Standard" option.

2. Setting up your hard drive -- if you have more than one hard drive, you will have to select which one you are going to use for FreeBSD. If you don't understand the jargon of disk identification, just notice this pattern: two or three letters and a number. Computers start numbering at zero, not at one. "0" is the first, "1" is the second, etc.

ad0 = ATAPI Drive = IDE/EIDE hard drive, the most common type.

da0 = SCSI Drive = Not many computers you buy for home use have these.

Choose the drive for this installation and go to the next screen for setting up the file system on that drive. The simplest is to use the whole drive for FreeBSD, without complicated partitioning. So here we choose option A for "All" of the drive for FreeBSD. At the next screen, again choose the A option for "Automatic" partitioning. Note that BSD uses the Unix file system, which refers to slices rather than partitions. The automatic setup is quite unlikely to bring you problems. Press Q to save and move to the next screen.

Boot options: Still a part of the hard drive setup, you will probably want to choose the BootMgr for maximum flexibility later. If you have other hard drives in your box, you'll be returned to the page for selecting which one to configure. Tab to Cancel to leave this screen.

3. Distribution -- we will want the most useful option, which is to select All at this point, unless you have a serious problem with hard drive space. For the most part, the options are self-explanatory, and it's easy to make adjustments later. The next immediate screen asks if you want the Ports Collection installed; select Yes because you'll need this later. As with most screens, TAB to the OK button and ENTER. You'll come back to the Distributions screen; choose Exit to move on.

4. Source for the installation -- since we booted from the CD/DVD-ROM drive, that is your obvious choice. If like me you have both a DVD-ROM and a CD-RW, it's best to install from the DVD reader. Ideally that one is connected as the first (master) drive on the second IDE socket of your motherboard. If you have issues booting from a CD, you'll need to read that portion on the installation instructions found at FreeBSD.org. There you will find a page on making a boot floppy, and for using various other methods. Very few modern machines won't boot from a CD drive, though you'll probably need to play with BIOS settings. If you don't know what that means, learn about that before doing anything to your computer.

5. LAST CHANCE -- The next screen tells you that this is your last chance to back out. If up to this point you are still uncertain, you should start over. "Third try is charmed" is true, though it says more about human nature and learning than it does about Fate, so don't be afraid to run through a couple of failed installs before you get it right. It was my own third try with FreeBSD that saw an easy time installing. Take the Yes answer when you are ready.

You will see the following information flash on the screen:

  • Making the file system on your hard drive
  • Installing basic OS files
  • Individual packages that you selected (the default set here)
  • Setting up the other slices

Finally, you will see a screen that congratulates you on a successful installation. If not, there are problems and you need to get help. Write down word for word whatever messages you get that indicate what the problem is. There are very few genuine newbie forums, but if you know how to use Google and other search engines, you'll probably find what you need. Search terms will of course include "freebsd install" and whatever particular keywords you can associate with your specific case, such as hardware parts names.

If you have no problems, you are now running FreeBSD.

6. Modem setup -- Usually this means selecting the ppp0 option for this purpose. You must know where your hardware believes the modem is, probably one of four "COMM" ports, to use the common term. As before, the first in the list is 0, the second is 1, etc. What most of the world calls COMM1 is cuaa0 in BSD, COMM2 is cuaa1, and so on. If you don't know, FreeBSD won't do it for you.

You won't need to worry about the next two screens, IPv6 and DHCP, so answer No to both.

7. Network setup -- There are only a couple of boxes you need to worry about filling in at this point.

Host: Every machine on any standard network has it's own name. This name takes three parts, each separated by a dot or period. The first name is anything you choose, but I recommend keeping it short. This will become obvious why later. I've seen things like yoda, shad, bite, and whit. Four characters is a good idea; pick anything from the dictionary or make up your own. The second part of the name indicates the name of the network. Yours should say local because your machine only talks to itself. The obvious exception is via the dialup connection to the Internet, when your ISP will provide a cover name for you, regardless of what your machine is called. The last part of the name is the stuff you see on most Internet addresses: .com, .org, .biz, etc. Yours is self-contained, and .bsd is highly recommended, since it won't confuse things with your ISP. For now, the .bsd ending isn't used on the official Internet, so your ISP won't have to worry about anyone looking for that address. Here's what it will look like:

   name.local.bsd

with name substituted by your choice.

Domain: This should end up with the local.bsd part automatically once you type in the first field. If not, type it manually.

You are now finished with this page, so tab to Done and hit ENTER. You have no reason to bring up the interface, so on the next page choose No. There are several more option screens listed with my recommendations:

  • Gateway: choose No
  • Inetd: choose No
  • Anonymous ftp: choose No
  • NFS: choose No
  • Security Profile: "moderate" is just fine, so choose the medium option

You will be greeted with a warning about securing your system from outside attacks, which serves nicely as a hint that you have to setup your firewall before connecting to the Internet. We'll deal with that in a later article.

8. Console settings -- unless you have a compelling reason to operate a lot in the console (without a GUI), this isn't worth much of your time. We will be learning about the console just enough to avoid being there long. This is for the desktop, remember? Take the defaults, unless you need to change the language settings or something. By the way, the screensaver option here applies only to the console.

9. Time zone -- most machines are set to local time, so don't select to base your system on UTC. Next, select your region, country and specific Time Zone. There are enough options in this last to cover just about every square inch of the world, so be patient and search.

10. Linux compatibility -- Select Yes here because too often the most recent version of something you want to use won't be available in native FreeBSD format. That is, unless you are constantly upgrading and updating your system. With a dialup connection, this can be a big hassle. This is especially the case if you like Mozilla. Every release has had some major improvement so far, and I usually have needed/wanted that additional function. I haven't found where anybody is providing these larger applications for FreeBSD with any sort of backward compatibility. Even if you are willing to compile yourself a native version of those larger applications, you still need Linux compatibility sooner or later.

11. Mouse options -- This question is sort of backwards, in that it's asked in the negative. I have a USB mouse, so the answer was No. Otherwise, there is nothing here to setup, since it applies only the console mouse.

12. Setting up the X server -- DO NOT USE THE GRAPHICAL TOOL! It is guaranteed to crash and lock up your system. This is not the fault of anybody at FreeBSD, since it comes with the XFree86 package. Your best bet is the 3rd option, xf86cfg -textmode. Since this whole thing is adequately covered elsewhere on the Internet, if you need more details, you'll have to hunt them down. If you have a good XF86Config from Linux, you'll need to change a few things before dropping it into FreeBSD, so it's better to run the utility here, then cut and splice appropriate sections later.

This text-mode version is really quite simple, and explains itself very well. You have the main menu with various options and menus under each item on the list. Visit each one, and be sure you are happy with the setttings. Simply go down the list, and if you really don't know about something, the safe route is to accept the default answer -- that is, the answer offered by the program. On the graphics card, be sure to look the whole list over before choosing. You'd be surprised by the names sometimes chosen by the folks who write the XFree86 and the drivers.

You need to know precisely what the specs for your monitor are. That is, you need to know the upper and lower limits of the horizontal and vertical display frequencies. Be sure of this information; don't guess. This is the one place where software can easily damage your hardware. It is usually possible to find the information you want by visiting the website for the manufacturer of your monitor. The other item is to know what sort of screen resolution you want. If you have a really good card and large or high-quality monitor, getting a fancy 1600x1200 display might work, but there's not much point if you have only a 17" monitor. Here's the usual advice:

  • 16" or smaller: 800x640
  • 17" or larger: 1024x860
  • 19" or larger: 1200x1024

You can guess the rest for yourself. As for color depth, very few people need more than 16-bit color. Not many folks can tell the difference, and a few applications simply will not work in 24-bit mode. Using less is not often necessary anymore, unless you have really old hardware.

When you are finished, let the script write the file. If you want, you can go back later and hand edit the file. I like to go and cut out every line that has a hash-mark (#) in front of it, because it makes the file smaller, still has everthing the X-server needs to know, and allows it to load just a bit faster.

13. Default desktop -- I won't get into the desktop wars here. I like KDE, but it has a few incompatibilities with FreeBSD, and is a resource hog. Gnome 2, far more pleasing to my eyes, crashes on FreeBSD as bad it does anywhere else, which I find to be quite often. If you have no opinion, I find KDE a safer starting place. It has the easiest route to getting your dialup going, because it has a built-in PPP dialer. If you aren't afraid to face the complexity of FreeBSD's user dialup scripts, then it won't matter much. I personally use IceWM, but that requires more work to get it like I want it. If you have an older machine with lower power, I recommend WindowMaker.

The next screen will allow you watch the progress of packages being installed the match your choice.

14. Package choices -- Here's your chance to add from the collection of binary packages already on the install disk. The quickest way to see them all is the choose the All listing. Here's my suggestion for the common desktop user:

  • acroread
  • aspell
  • bash (especially for the newbie)
  • bitstream vera fonts
  • cdrtools (unless you don't have a CD-RW)
  • fetchmail
  • ghostscript-gnu
  • ghostview
  • gtk2 and gtk2-engines
  • imlib
  • lynx
  • pine
  • postfix (easier to work with than sendmail)
  • sudo
  • unzip
  • xscreensaver or xscreensaver-gnome

If there is an X in the box in front of anything, it has already been chosen for installation. Tab to the OK and ENTER. If you select "Install" you'll be presented with the list of packages you've chosen. The next screen shows the progress of installation.

15. User account -- If you don't create a user account, you had better not ever connect to the Internet. That's the mantra from everyone in the FOSS community, and I won't repeat the whole spiel here. We choose yes to this option. Next screen, select Add user. The next page has blocks for entries.

Login name: Keep it simple. Long cutesy names can present problems later when you need to work in a terminal or from the console. Three or four initials or something short and simple will be fine.

UID: Don't touch this. The system handles it fine.

Group: Leave for the defaults.

Password: I can only echo the good advice of Jon "maddog" Hall here. The best passwords have at least 8 characters, and is based on something you'll remember, but isn't easy to guess. Jon used the example of the phrase, "Ladies and Gentlemen, Elvis has left the building." He then takes the first letter of each word, upper or lower case as is proper, and inserts the punctuation, too. Then, when it's time to enter your password, you need only recite the phrase and type accordingly:

 L&G,Ehltb.

Notice that "and" is replaced with an ampersand (&). I prefer to use favorite songs. Since I am a church music director, I would obviously use hymns. One of my past choices is the song "God Is in Control" which give us this:

   Giictrl!

You can replace letters with numbers that are similar (o=0, a=4, e=3, etc.). Throwing in punctuation is a good idea, of course.

Full name: Whatever you want to use.

Member groups: Type in the word wheel which allows your user account to act briefly as root for administrative tasks. Without this, the su command won't work.

Home dir: Let the system choose the default.

Login shell: Unless you have a favorite, I'm going to recommend bash, so type in

 /usr/local/bin/bash

Tab to OK to exit the screen. Unless you have more users to setup, choose Exit and tab to OK for the next step.

16. Root password -- The same rule applies here as for user passwords. You'll need to be able to type it the same twice. Memorize the phrase and pay attention to how you type in each character. After about a half-dozen times, most folks have it nailed down.

17. Revise options -- It's not likely, but here's your chance. At the next screen, choose Exit install.

Now the system will reboot. This is a good time to catch the BIOS setup and return to booting from the hard drive, and removing the CD from the drive. You will see the usual boot messages. Unless things hang somewhere, you are on your way.

In our next installment, we'll cover post-install setup.



Ed Hurst is Associate Editor of Open for Business. Ed is also the Music Director for Grace Baptist Church of Kickapoo Creek, Texas. He loves computers, runs GNU/Linux and reads all sorts of things. You can reach Ed at ehurst@ofb.biz.