Archive

Posts Tagged ‘virtualization’

FreeBSD Handbook - Chapter 22 Virtualization

January 6th, 2009

Warning: file_get_contents(http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=1TJ8QTQ6ZFCVAJ3X1T02&AssociateTag=ii0c3-20&Operation=ItemSearch&SearchIndex=Books&ResponseGroup=Small,Images&Keywords=bsd) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in /home/manusia2/public_html/wp-content/plugins/amazonfeed/php/amazonfeed.class.php on line 271

Contributed by Murray Stokely.

22.1 Synopsis

Virtualization software allows multiple operating systems to run simultaneously on the same computer. Such software systems for PCs often involve a host operating system which runs the virtualization software and supports any number of guest operating systems.

After reading this chapter, you will know:

  • The difference between a host operating system and a guest operating system.

  • How to install FreeBSD on an Intel-based Apple Macintosh computer.

  • How to install FreeBSD on Linux with Xen™.

  • How to install FreeBSD on Microsoft Windows with Virtual PC.

  • How to tune a FreeBSD system for best performance under virtualization.

Before reading this chapter, you should:

  • Understand the basics of UNIX and FreeBSD (Chapter 3).

  • Know how to install FreeBSD (Chapter 2).

  • Know how to set up your network connection (Chapter 31).

  • Know how to install additional third-party software (Chapter 4).


22.2 FreeBSD as a Guest OS

22.2.1 Parallels on MacOS

Parallels Desktop for Mac is a commercial software product available for Intel based Apple Mac computers running Mac OS 10.4.6 or higher. FreeBSD is a fully supported guest operating system. Once Parallels has been installed on Mac OS X, the user must configure a virtual machine and then install the desired guest operating system.


22.2.1.1 Installing FreeBSD on Parallels/Mac OS® X

The first step in installing FreeBSD on Mac OS X/Parallels is to create a new virtual machine for installing FreeBSD. Select FreeBSD as the Guest OS Type when prompted:

And choose a reasonable amount of disk and memory depending on your plans for this virtual FreeBSD instance. 4GB of disk space and 512MB of RAM work well for most uses of FreeBSD under Parallels:

Select the type of networking and a network interface:

Save and finish the configuration:

After your FreeBSD virtual machine has been created, you will need to install FreeBSD on it. This is best done with an official FreeBSD CDROM or with an ISO image downloaded from an official FTP site. When you have the appropriate ISO image on your local Mac filesystem or a CDROM in your Mac’s CD drive, click on the disc icon in the bottom right corner of your FreeBSD Parallels window. This will bring up a window that allows you to associate the CDROM drive in your virtual machine with an ISO file on disk or with your real CDROM drive.

Once you have made this association with your CDROM source, reboot your FreeBSD virtual machine as normal by clicking the reboot icon. Parallels will reboot with a special BIOS that first checks if you have a CDROM just as a normal BIOS would do.

In this case it will find the FreeBSD installation media and begin a normal sysinstall based installation as described in Chapter 2. You may install, but do not attempt to configure X11 at this time.

When you have finished the installation, reboot into your newly installed FreeBSD virtual machine.


22.2.1.2 Configuring FreeBSD on Mac OS X/Parallels

After FreeBSD has been successfully installed on Mac OS X with Parallels, there are a number of configuration steps that can be taken to optimize the system for virtualized operation.

  1. Set boot loader variables

    The most important step is to reduce the kern.hz tunable to reduce the CPU utilization of FreeBSD under the Parallels environment. This is accomplished by adding the following line to /boot/loader.conf:

    kern.hz=100

    Without this setting, an idle FreeBSD Parallels guest OS will use roughly 15% of the CPU of a single processor iMac®. After this change the usage will be closer to a mere 5%.

  2. Create a new kernel configuration file

    You can remove all of the SCSI, FireWire, and USB device drivers. Parallels provides a virtual network adapter used by the ed(4) driver, so all other network devices except for ed(4) and miibus(4) can be removed from the kernel.

  3. Setup networking

    The most basic networking setup involves simply using DHCP to connect your virtual machine to the same local area network as your host Mac. This can be accomplished by adding ifconfig_ed0="DHCP" to /etc/rc.conf. More advanced networking setups are described in Chapter 31.


22.2.2 FreeBSD with Xen™ on Linux

Contributed by Fukang Chen (Loader).

The Xen hypervisor is an open source paravirtualization product which is now supported by the commercial XenSource company. Guest operating systems are known as domU domains, and the host operating system is known as dom0. The first step in running a virtual FreeBSD instance under Linux is to install Xen for Linux dom0. The host operating system will be a Slackware Linux distribution.


22.2.2.1 Setup Xen 3 on Linux dom0
  1. Download Xen 3.0 from XenSource

    Download xen-3.0.4_1-src.tgz from http://www.xensource.com/.

  2. Unpack the tarball

    # cd xen-3.0.4_1-src
    # KERNELS="linux-2.6-xen0 linux-2.6-xenU" make world
    # make install

    Note: To re-compile the kernel for dom0:

    # cd xen-3.0.4_1-src/linux-2.6.16.33-xen0
    # make menuconfig
    # make
    # make install

    Older version of Xen may need to specify make ARCH=xen menuconfig

  3. Add a menu entry into Grub menu.lst

    Edit /boot/grub/menu.lst and add the following lines:

    title Xen-3.0.4
    root (hd0,0)
    kernel /boot/xen-3.0.4-1.gz dom0_mem=262144
    module /boot/vmlinuz-2.6.16.33-xen0 root=/dev/hda1 ro
  4. Reboot your computer into Xen

    First, edit /etc/xen/xend-config.sxp, and add the following line:

    (network-script 'network-bridge netdev=eth0')

    Then, we can launch Xen:

    # /etc/init.d/xend start
    # /etc/init.d/xendomains start

    Our dom0 is running:

    # xm list
    Name                                      ID   Mem VCPUs      State   Time(s)
    Domain-0                                   0   256     1     r-----  54452.9

22.2.2.2 FreeBSD 7-CURRENT domU

Download the FreeBSD domU kernel for Xen 3.0 and disk image from http://www.fsmware.com/

  • kernel-current

  • mdroot-7.0.bz2

  • xmexample1.bsd

Put the configuration file xmexample1.bsd into /etc/xen/ and modify the related entries about where the kernel and the disk image are stored. It should look like the following:

kernel = "/opt/kernel-current"
memory = 256
name = "freebsd"
vif = [ '' ]
disk = [ 'file:/opt/mdroot-7.0,hda1,w' ]
#on_crash    = 'preserve'
extra = "boot_verbose"
extra += ",boot_single"
extra += ",kern.hz=100"
extra += ",vfs.root.mountfrom=ufs:/dev/xbd769a"

The mdroot-7.0.bz2 file should be uncompressed.

Next, the __xen_guest section in kernel-current needs to be altered to add the VIRT_BASE that Xen 3.0.3 requires:

# objcopy kernel-current -R __xen_guest
# perl -e 'print "LOADER=generic,GUEST_OS=freebsd,GUEST_VER=7.0,XEN_VER=xen-3.0,BSD_SYMTAB,VIRT_BASE=0xC0000000\x00"' > tmp
# objcopy kernel-current --add-section __xen_guest=tmp
# objdump -j __xen_guest -s kernel-current

kernel-current:     file format elf32-i386

Contents of section __xen_guest:
 0000 4c4f4144 45523d67 656e6572 69632c47  LOADER=generic,G
 0010 55455354 5f4f533d 66726565 6273642c  UEST_OS=freebsd,
 0020 47554553 545f5645 523d372e 302c5845  GUEST_VER=7.0,XE
 0030 4e5f5645 523d7865 6e2d332e 302c4253  N_VER=xen-3.0,BS
 0040 445f5359 4d544142 2c564952 545f4241  D_SYMTAB,VIRT_BA
 0050 53453d30 78433030 30303030 3000      SE=0xC0000000.

We are, now, ready to create and launch our domU:

# xm create /etc/xen/xmexample1.bsd -c
Using config file "/etc/xen/xmexample1.bsd".
Started domain freebsd
WARNING: loader(8) metadata is missing!
Copyright (c) 1992-2006 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD 7.0-CURRENT #113: Wed Jan  4 06:25:43 UTC 2006
    kmacy@freebsd7.gateway.2wire.net:/usr/home/kmacy/p4/freebsd7_xen3/src/sys/i386-xen/compile/XENCONF
WARNING: DIAGNOSTIC option enabled, expect reduced performance.
Xen reported: 1796.927 MHz processor.
Timecounter "ixen" frequency 1796927000 Hz quality 0
CPU: Intel(R) Pentium(R) 4 CPU 1.80GHz (1796.93-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0xf29  Stepping = 9
  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,
  DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0x4400<CNTX-ID,<b14>>
real memory  = 265244672 (252 MB)
avail memory = 255963136 (244 MB)
xc0: <Xen Console> on motherboard
cpu0 on motherboard
Timecounters tick every 10.000 msec
[XEN] Initialising virtual ethernet driver.
xn0: Ethernet address: 00:16:3e:6b:de:3a
[XEN]
Trying to mount root from ufs:/dev/xbd769a
WARNING: / was not properly dismounted
Loading configuration files.
No suitable dump device was found.
Entropy harvesting: interrupts ethernet point_to_point kickstart.
Starting file system checks:
/dev/xbd769a: 18859 files, 140370 used, 113473 free (10769 frags, 12838 blocks, 4.2% fragmentation)
Setting hostname: demo.freebsd.org.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
      inet6 ::1 prefixlen 128
      inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
      inet 127.0.0.1 netmask 0xff000000
Additional routing options:.
Mounting NFS file systems:.
Starting syslogd.
/etc/rc: WARNING: Dump device does not exist.  Savecore not run.
ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout
Starting usbd.
usb: Kernel module not available: No such file or directory
Starting local daemons:.
Updating motd.
Starting sshd.
Initial i386 initialization:.
Additional ABI support: linux.
Starting cron.
Local package initialization:.
Additional TCP options:.
Starting background file system checks in 60 seconds.

Sun Apr  1 02:11:43 UTC 2007

FreeBSD/i386 (demo.freebsd.org) (xc0)

login:

The domU should run the FreeBSD 7.0-CURRENT kernel:

# uname -a
FreeBSD demo.freebsd.org 7.0-CURRENT FreeBSD 7.0-CURRENT #113: Wed Jan  4 06:25:43 UTC 2006
kmacy@freebsd7.gateway.2wire.net:/usr/home/kmacy/p4/freebsd7_xen3/src/sys/i386-xen/compile/XENCONF  i386

The network can now be configured on the domU. The FreeBSD domU will use a specific interface called xn0:

# ifconfig xn0 10.10.10.200 netmask 255.0.0.0
# ifconfig
xn0: flags=843<UP,BROADCAST,RUNNING,SIMPLEX> mtu 1500
    inet 10.10.10.200 netmask 0xff000000 broadcast 10.255.255.255
    ether 00:16:3e:6b:de:3a
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
      inet6 ::1 prefixlen 128
      inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
      inet 127.0.0.1 netmask 0xff000000

On dom0 Slackware, some Xen dependant network interfaces should show up:

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:07:E9:A0:02:C2
          inet addr:10.10.10.130  Bcast:0.0.0.0  Mask:255.0.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:815 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1400 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:204857 (200.0 KiB)  TX bytes:129915 (126.8 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:99 errors:0 dropped:0 overruns:0 frame:0
          TX packets:99 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:9744 (9.5 KiB)  TX bytes:9744 (9.5 KiB)

peth0     Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF
          UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
          RX packets:1853349 errors:0 dropped:0 overruns:0 frame:0
          TX packets:952923 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2432115831 (2.2 GiB)  TX bytes:86528526 (82.5 MiB)
          Base address:0xc000 Memory:ef020000-ef040000 

vif0.1    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF
          UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
          RX packets:1400 errors:0 dropped:0 overruns:0 frame:0
          TX packets:815 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:129915 (126.8 KiB)  TX bytes:204857 (200.0 KiB)

vif1.0    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF
          UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
          RX packets:3 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:157 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:140 (140.0 b)  TX bytes:158 (158.0 b)

xenbr1    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF
          UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:112 (112.0 b)  TX bytes:0 (0.0 b)
# brctl show
bridge name     bridge id           STP enabled         interfaces
xenbr1          8000.feffffffffff   no                  vif0.1
                                                        peth0
                                                        vif1.0

22.2.3 Virtual PC on Windows

Virtual PC for Windows is a Microsoft software product available for free download. See system requirements. Once Virtual PC has been installed on Microsoft Windows, the user must configure a virtual machine and then install the desired guest operating system.


22.2.3.1 Installing FreeBSD on Virtual PC/Microsoft® Windows

The first step in installing FreeBSD on Microsoft Windows /Virtual PC is to create a new virtual machine for installing FreeBSD. Select Create a virtual machine when prompted:

And select Other as the Operating system when prompted:

Then, choose a reasonable amount of disk and memory depending on your plans for this virtual FreeBSD instance. 4GB of disk space and 512MB of RAM work well for most uses of FreeBSD under Virtual PC:

Save and finish the configuration:

Select your FreeBSD virtual machine and click Settings, then set the type of networking and a network interface:

After your FreeBSD virtual machine has been created, you will need to install FreeBSD on it. This is best done with an official FreeBSD CDROM or with an ISO image downloaded from an official FTP site. When you have the appropriate ISO image on your local Windows filesystem or a CDROM in your CD drive, double click on your FreeBSD virtual machine to boot. Then, click CD and choose Capture ISO Image… on Virtual PC window. This will bring up a window that allows you to associate the CDROM drive in your virtual machine with an ISO file on disk or with your real CDROM drive.

Once you have made this association with your CDROM source, reboot your FreeBSD virtual machine as normal by clicking the Action and Reset. Virtual PC will reboot with a special BIOS that first checks if you have a CDROM just as a normal BIOS would do.

In this case it will find the FreeBSD installation media and begin a normal sysinstall based installation as described in Chapter 2. You may install, but do not attempt to configure X11 at this time.

When you have finished the installation, remember to eject CDROM or release ISO image. Finally, reboot into your newly installed FreeBSD virtual machine.


22.2.3.2 Configuring FreeBSD on Microsoft Windows/Virtual PC

After FreeBSD has been successfully installed on Microsoft Windows with Virtual PC, there are a number of configuration steps that can be taken to optimize the system for virtualized operation.

  1. Set boot loader variables

    The most important step is to reduce the kern.hz tunable to reduce the CPU utilization of FreeBSD under the Virtual PC environment. This is accomplished by adding the following line to /boot/loader.conf:

    kern.hz=100

    Without this setting, an idle FreeBSD Virtual PC guest OS will use roughly 40% of the CPU of a single processor computer. After this change the usage will be closer to a mere 3%.

  2. Create a new kernel configuration file

    You can remove all of the SCSI, FireWire, and USB device drivers. Virtual PC provides a virtual network adapter used by the de(4) driver, so all other network devices except for de(4) and miibus(4) can be removed from the kernel.

  3. Setup networking

    The most basic networking setup involves simply using DHCP to connect your virtual machine to the same local area network as your host Microsoft Windows. This can be accomplished by adding ifconfig_de0="DHCP" to /etc/rc.conf. More advanced networking setups are described in Chapter 31.


22.2.4 VMWare on MacOS

VMWare Fusion for Mac is a commercial software product available for Intel based Apple Mac computers running Mac OS 10.4.9 or higher. FreeBSD is a fully supported guest operating system. Once VMWare Fusion has been installed on Mac OS X, the user must configure a virtual machine and then install the desired guest operating system.


22.2.4.1 Installing FreeBSD on VMWare/Mac OS X

The first step is to start VMWare Fusion, the Virtual Machine Library will load. Click "New" to create the VM:

This will load the New Virtual Machine Assistant to help you create the VM, click Continue to proceed:

Select Other as the Operating System and FreeBSD or FreeBSD 64-bit, depending on if you want 64-bit support, as the Version when prompted:

Choose the Name of the VM Image and the Directory where you would like it saved:

Choose the size of the Virtual Hard Disk for the VM:

Choose the method you would like to install the VM, either from an ISO image or from a CD:

Once you click Finish, the VM will boot:

Install FreeBSD like you normally would, or by following the directions in Chapter 2:

Once the install is complete you can modify the settings of the VM, such as Memory Usage:

Note: The System Hardware settings of the VM cannot be modified while the VM is running.

The number of CPUs the VM will have access to:

The status of the CD-Rom Device. Normally you can disconnect the CD-Rom/ISO from the VM if you will not be needing it anymore.

The last thing to change is how the VM will connect to the Network. If you want to allow connections to the VM from other machines besides the Host, make sure you choose the Connect directly to the physical network (Bridged). Otherwise Share the host’s internet connection (NAT) is preferred so that the VM can have access to the Internet, but the network cannot access the VM.

After you have finished modifying the settings, boot the newly installed FreeBSD virtual machine.


22.2.4.2 Configuring FreeBSD on Mac OS X/VMWare

After FreeBSD has been successfully installed on Mac OS X with VMWare, there are a number of configuration steps that can be taken to optimize the system for virtualized operation.

  1. Set boot loader variables

    The most important step is to reduce the kern.hz tunable to reduce the CPU utilization of FreeBSD under the VMWare environment. This is accomplished by adding the following line to /boot/loader.conf:

    kern.hz=100

    Without this setting, an idle FreeBSD VMWare guest OS will use roughly 15% of the CPU of a single processor iMac. After this change the usage will be closer to a mere 5%.

  2. Create a new kernel configuration file

    You can remove all of the FireWire, and USB device drivers. VMWare provides a virtual network adapter used by the em(4) driver, so all other network devices except for em(4) can be removed from the kernel.

  3. Setup networking

    The most basic networking setup involves simply using DHCP to connect your virtual machine to the same local area network as your host Mac. This can be accomplished by adding ifconfig_em0="DHCP" to /etc/rc.conf. More advanced networking setups are described in Chapter 31.


22.3 FreeBSD as a Host OS

FreeBSD is not officially supported by any virtualization package as a host operating system at this time, but many people use older versions of VMware in this capacity. Work is also ongoing in getting Xen to work as a host environment on FreeBSD.

Tags: bsd, cron, domain, freebsd, FreeBSD Handbook, ftp, slackware, software, ssh, virtualization, vmware, xen

Related posts

FreeBSD Handbook , , , , , , , , , ,

FreeBSD Handbook - III System Administration

January 6th, 2009

The remaining chapters of the FreeBSD Handbook cover all aspects of FreeBSD system administration. Each chapter starts by describing what you will learn as a result of reading the chapter, and also details what you are expected to know before tackling the material.

These chapters are designed to be read when you need the information. You do not have to read them in any particular order, nor do you need to read all of them before you can begin using FreeBSD.

Table of Contents
11 Configuration and Tuning
12 The FreeBSD Booting Process
13 Users and Basic Account Management
14 Security
15 Jails
16 Mandatory Access Control
17 Security Event Auditing
18 Storage
19 GEOM: Modular Disk Transformation Framework
20 File Systems Support
21 The Vinum Volume Manager
22 Virtualization
23 Localization - I18N/L10N Usage and Setup
24 Updating and Upgrading FreeBSD
25 DTrace
Tags: account, bsd, freebsd, FreeBSD Handbook, manage, virtualization

Related posts

FreeBSD Handbook , , , ,

FreeBSD Handbook

January 5th, 2009
The FreeBSD Documentation Project

Copyright © 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The FreeBSD Documentation Project

Welcome to FreeBSD! This handbook covers the installation and day to day use of FreeBSD 6.4-RELEASE and FreeBSD 7.1-RELEASE. This manual is a work in progress and is the work of many individuals. As such, some sections may become dated and require updating. If you are interested in helping out with this project, send email to the FreeBSD documentation project mailing list. The latest version of this document is always available from the FreeBSD web site (previous versions of this handbook can be obtained from http://docs.FreeBSD.org/doc/). It may also be downloaded in a variety of formats and compression options from the FreeBSD FTP server or one of the numerous mirror sites. If you would prefer to have a hard copy of the handbook, you can purchase one at the FreeBSD Mall. You may also want to search the handbook.

Redistribution and use in source (SGML DocBook) and ‘compiled’ forms (SGML, HTML, PDF, PostScript, RTF and so forth) with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code (SGML DocBook) must retain the above copyright notice, this list of conditions and the following disclaimer as the first lines of this file unmodified.

  2. Redistributions in compiled form (transformed to other DTDs, converted to PDF, PostScript, RTF and other formats) must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Important: THIS DOCUMENTATION IS PROVIDED BY THE FREEBSD DOCUMENTATION PROJECT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD DOCUMENTATION PROJECT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

FreeBSD is a registered trademark of the FreeBSD Foundation.

3Com and HomeConnect are registered trademarks of 3Com Corporation.

3ware and Escalade are registered trademarks of 3ware Inc.

ARM is a registered trademark of ARM Limited.

Adaptec is a registered trademark of Adaptec, Inc.

Adobe, Acrobat, Acrobat Reader, and PostScript are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries.

Apple, AirPort, FireWire, Mac, Macintosh, Mac OS, Quicktime, and TrueType are trademarks of Apple Computer, Inc., registered in the United States and other countries.

Corel and WordPerfect are trademarks or registered trademarks of Corel Corporation and/or its subsidiaries in Canada, the United States and/or other countries.

Sound Blaster is a trademark of Creative Technology Ltd. in the United States and/or other countries.

CVSup is a registered trademark of John D. Polstra.

Heidelberg, Helvetica, Palatino, and Times Roman are either registered trademarks or trademarks of Heidelberger Druckmaschinen AG in the U.S. and other countries.

IBM, AIX, EtherJet, Netfinity, OS/2, PowerPC, PS/2, S/390, and ThinkPad are trademarks of International Business Machines Corporation in the United States, other countries, or both.

IEEE, POSIX, and 802 are registered trademarks of Institute of Electrical and Electronics Engineers, Inc. in the United States.

Intel, Celeron, EtherExpress, i386, i486, Itanium, Pentium, and Xeon are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

Intuit and Quicken are registered trademarks and/or registered service marks of Intuit Inc., or one of its subsidiaries, in the United States and other countries.

Linux is a registered trademark of Linus Torvalds.

LSI Logic, AcceleRAID, eXtremeRAID, MegaRAID and Mylex are trademarks or registered trademarks of LSI Logic Corp.

M-Systems and DiskOnChip are trademarks or registered trademarks of M-Systems Flash Disk Pioneers, Ltd.

Macromedia, Flash, and Shockwave are trademarks or registered trademarks of Macromedia, Inc. in the United States and/or other countries.

Microsoft, IntelliMouse, MS-DOS, Outlook, Windows, Windows Media and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.

Netscape and the Netscape Navigator are registered trademarks of Netscape Communications Corporation in the U.S. and other countries.

GateD and NextHop are registered and unregistered trademarks of NextHop in the U.S. and other countries.

Motif, OSF/1, and UNIX are registered trademarks and IT DialTone and The Open Group are trademarks of The Open Group in the United States and other countries.

Oracle is a registered trademark of Oracle Corporation.

PowerQuest and PartitionMagic are registered trademarks of PowerQuest Corporation in the United States and/or other countries.

RealNetworks, RealPlayer, and RealAudio are the registered trademarks of RealNetworks, Inc.

Red Hat, RPM, are trademarks or registered trademarks of Red Hat, Inc. in the United States and other countries.

SAP, R/3, and mySAP are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world.

Sun, Sun Microsystems, Java, Java Virtual Machine, JavaServer Pages, JDK, JRE, JSP, JVM, Netra, Solaris, StarOffice, Sun Blade, Sun Enterprise, Sun Fire, SunOS, and Ultra are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.

Symantec and Ghost are registered trademarks of Symantec Corporation in the United States and other countries.

MATLAB is a registered trademark of The MathWorks, Inc.

SpeedTouch is a trademark of Thomson.

U.S. Robotics and Sportster are registered trademarks of U.S. Robotics Corporation.

VMware is a trademark of VMware, Inc.

Waterloo Maple and Maple are trademarks or registered trademarks of Waterloo Maple Inc.

Mathematica is a registered trademark of Wolfram Research, Inc.

XFree86 is a trademark of The XFree86 Project, Inc.

Ogg Vorbis and Xiph.Org are trademarks of Xiph.Org.

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this document, and the FreeBSD Project was aware of the trademark claim, the designations have been followed by the “™” or the “®” symbol.


Table of Contents
Preface
I. Getting Started
1 Introduction
1.1 Synopsis
1.2 Welcome to FreeBSD!
1.3 About the FreeBSD Project
2 Installing FreeBSD
2.1 Synopsis
2.2 Hardware Requirements
2.3 Pre-installation Tasks
2.4 Starting the Installation
2.5 Introducing Sysinstall
2.6 Allocating Disk Space
2.7 Choosing What to Install
2.8 Choosing Your Installation Media
2.9 Committing to the Installation
2.10 Post-installation
2.11 Troubleshooting
2.12 Advanced Installation Guide
2.13 Preparing Your Own Installation Media
3 UNIX Basics
3.1 Synopsis
3.2 Virtual Consoles and Terminals
3.3 Permissions
3.4 Directory Structure
3.5 Disk Organization
3.6 Mounting and Unmounting File Systems
3.7 Processes
3.8 Daemons, Signals, and Killing Processes
3.9 Shells
3.10 Text Editors
3.11 Devices and Device Nodes
3.12 Binary Formats
3.13 For More Information
4 Installing Applications: Packages and Ports
4.1 Synopsis
4.2 Overview of Software Installation
4.3 Finding Your Application
4.4 Using the Packages System
4.5 Using the Ports Collection
4.6 Post-installation Activities
4.7 Dealing with Broken Ports
5 The X Window System
5.1 Synopsis
5.2 Understanding X
5.3 Installing X11
5.4 X11 Configuration
5.5 Using Fonts in X11
5.6 The X Display Manager
5.7 Desktop Environments
II. Common Tasks
6 Desktop Applications
6.1 Synopsis
6.2 Browsers
6.3 Productivity
6.4 Document Viewers
6.5 Finance
6.6 Summary
7 Multimedia
7.1 Synopsis
7.2 Setting Up the Sound Card
7.3 MP3 Audio
7.4 Video Playback
7.5 Setting Up TV Cards
7.6 Image Scanners
8 Configuring the FreeBSD Kernel
8.1 Synopsis
8.2 Why Build a Custom Kernel?
8.3 Finding the System Hardware
8.4 Kernel Drivers, Subsystems, and Modules
8.5 Building and Installing a Custom Kernel
8.6 The Configuration File
8.7 If Something Goes Wrong
9 Printing
9.1 Synopsis
9.2 Introduction
9.3 Basic Setup
9.4 Advanced Printer Setup
9.5 Using Printers
9.6 Alternatives to the Standard Spooler
9.7 Troubleshooting
10 Linux Binary Compatibility
10.1 Synopsis
10.2 Installation
10.3 Installing Mathematica®
10.4 Installing Maple™
10.5 Installing MATLAB®
10.6 Installing Oracle®
10.7 Installing SAP® R/3®
10.8 Advanced Topics
III. System Administration
11 Configuration and Tuning
11.1 Synopsis
11.2 Initial Configuration
11.3 Core Configuration
11.4 Application Configuration
11.5 Starting Services
11.6 Configuring the cron Utility
11.7 Using rc under FreeBSD
11.8 Setting Up Network Interface Cards
11.9 Virtual Hosts
11.10 Configuration Files
11.11 Tuning with sysctl
11.12 Tuning Disks
11.13 Tuning Kernel Limits
11.14 Adding Swap Space
11.15 Power and Resource Management
11.16 Using and Debugging FreeBSD ACPI
12 The FreeBSD Booting Process
12.1 Synopsis
12.2 The Booting Problem
12.3 The Boot Manager and Boot Stages
12.4 Kernel Interaction During Boot
12.5 Device Hints
12.6 Init: Process Control Initialization
12.7 Shutdown Sequence
13 Users and Basic Account Management
13.1 Synopsis
13.2 Introduction
13.3 The Superuser Account
13.4 System Accounts
13.5 User Accounts
13.6 Modifying Accounts
13.7 Limiting Users
13.8 Groups
14 Security
14.1 Synopsis
14.2 Introduction
14.3 Securing FreeBSD
14.4 DES, Blowfish, MD5, and Crypt
14.5 One-time Passwords
14.6 TCP Wrappers
14.7 KerberosIV
14.8 Kerberos5
14.9 OpenSSL
14.10 VPN over IPsec
14.11 OpenSSH
14.12 File System Access Control Lists
14.13 Monitoring Third Party Security Issues
14.14 FreeBSD Security Advisories
14.15 Process Accounting
15 Jails
15.1 Synopsis
15.2 Terms Related to Jails
15.3 Introduction
15.4 Creating and Controlling Jails
15.5 Fine Tuning and Administration
15.6 Application of Jails
16 Mandatory Access Control
16.1 Synopsis
16.2 Key Terms in this Chapter
16.3 Explanation of MAC
16.4 Understanding MAC Labels
16.5 Planning the Security Configuration
16.6 Module Configuration
16.7 The MAC seeotheruids Module
16.8 The MAC bsdextended Module
16.9 The MAC ifoff Module
16.10 The MAC portacl Module
16.11 The MAC partition Module
16.12 The MAC Multi-Level Security Module
16.13 The MAC Biba Module
16.14 The MAC LOMAC Module
16.15 Nagios in a MAC Jail
16.16 User Lock Down
16.17 Troubleshooting the MAC Framework
17 Security Event Auditing
17.1 Synopsis
17.2 Key Terms in this Chapter
17.3 Installing Audit Support
17.4 Audit Configuration
17.5 Administering the Audit Subsystem
18 Storage
18.1 Synopsis
18.2 Device Names
18.3 Adding Disks
18.4 RAID
18.5 USB Storage Devices
18.6 Creating and Using Optical Media (CDs)
18.7 Creating and Using Optical Media (DVDs)
18.8 Creating and Using Floppy Disks
18.9 Creating and Using Data Tapes
18.10 Backups to Floppies
18.11 Backup Strategies
18.12 Backup Basics
18.13 Network, Memory, and File-Backed File Systems
18.14 File System Snapshots
18.15 File System Quotas
18.16 Encrypting Disk Partitions
18.17 Encrypting Swap Space
19 GEOM: Modular Disk Transformation Framework
19.1 Synopsis
19.2 GEOM Introduction
19.3 RAID0 - Striping
19.4 RAID1 - Mirroring
19.5 GEOM Gate Network Devices
19.6 Labeling Disk Devices
19.7 UFS Journaling Through GEOM
20 File Systems Support
20.1 Synopsis
20.2 The Z File System
21 The Vinum Volume Manager
21.1 Synopsis
21.2 Disks Are Too Small
21.3 Access Bottlenecks
21.4 Data Integrity
21.5 Vinum Objects
21.6 Some Examples
21.7 Object Naming
21.8 Configuring Vinum
21.9 Using Vinum for the Root Filesystem
22 Virtualization
22.1 Synopsis
22.2 FreeBSD as a Guest OS
22.3 FreeBSD as a Host OS
23 Localization - I18N/L10N Usage and Setup
23.1 Synopsis
23.2 The Basics
23.3 Using Localization
23.4 Compiling I18N Programs
23.5 Localizing FreeBSD to Specific Languages
24 Updating and Upgrading FreeBSD
24.1 Synopsis
24.2 FreeBSD Update
24.3 Portsnap: A Ports Collection Update Tool
24.4 Tracking a Development Branch
24.5 Synchronizing Your Source
24.6 Rebuilding “world”
24.7 Tracking for Multiple Machines
25 DTrace
25.1 Synopsis
25.2 Implementation Differences
25.3 Enabling DTrace Support
25.4 Using DTrace
25.5 The D Language
IV. Network Communication
26 Serial Communications
26.1 Synopsis
26.2 Introduction
26.3 Terminals
26.4 Dial-in Service
26.5 Dial-out Service
26.6 Setting Up the Serial Console
27 PPP and SLIP
27.1 Synopsis
27.2 Using User PPP
27.3 Using Kernel PPP
27.4 Troubleshooting PPP Connections
27.5 Using PPP over Ethernet (PPPoE)
27.6 Using PPP over ATM (PPPoA)
27.7 Using SLIP
28 Electronic Mail
28.1 Synopsis
28.2 Using Electronic Mail
28.3 sendmail Configuration
28.4 Changing Your Mail Transfer Agent
28.5 Troubleshooting
28.6 Advanced Topics
28.7 SMTP with UUCP
28.8 Setting Up to Send Only
28.9 Using Mail with a Dialup Connection
28.10 SMTP Authentication
28.11 Mail User Agents
28.12 Using fetchmail
28.13 Using procmail
29 Network Servers
29.1 Synopsis
29.2 The inetd “Super-Server”
29.3 Network File System (NFS)
29.4 Network Information System (NIS/YP)
29.5 Automatic Network Configuration (DHCP)
29.6 Domain Name System (DNS)
29.7 Apache HTTP Server
29.8 File Transfer Protocol (FTP)
29.9 File and Print Services for Microsoft Windows clients (Samba)
29.10 Clock Synchronization with NTP
29.11 Remote Host Logging with syslogd
30 Firewalls
30.1 Introduction
30.2 Firewall Concepts
30.3 Firewall Packages
30.4 The OpenBSD Packet Filter (PF) and ALTQ
30.5 The IPFILTER (IPF) Firewall
30.6 IPFW
31 Advanced Networking
31.1 Synopsis
31.2 Gateways and Routes
31.3 Wireless Networking
31.4 Bluetooth
31.5 Bridging
31.6 Link Aggregation and Failover
31.7 Diskless Operation
31.8 ISDN
31.9 Network Address Translation
31.10 Parallel Line IP (PLIP)
31.11 IPv6
31.12 Asynchronous Transfer Mode (ATM)
31.13 Common Access Redundancy Protocol (CARP)
V. Appendices
A. Obtaining FreeBSD
A.1 CDROM and DVD Publishers
A.2 FTP Sites
A.3 BitTorrent
A.4 Anonymous CVS
A.5 Using CTM
A.6 Using CVSup
A.7 CVS Tags
A.8 AFS Sites
A.9 rsync Sites
B. Bibliography
B.1 Books & Magazines Specific to FreeBSD
B.2 Users’ Guides
B.3 Administrators’ Guides
B.4 Programmers’ Guides
B.5 Operating System Internals
B.6 Security Reference
B.7 Hardware Reference
B.8 UNIX History
B.9 Magazines and Journals
C. Resources on the Internet
C.1 Mailing Lists
C.2 Usenet Newsgroups
C.3 World Wide Web Servers
C.4 Email Addresses
D. PGP Keys
D.1 Officers
D.2 Core Team Members
D.3 Developers
FreeBSD Glossary
Index
Colophon
List of Tables
2-1. Sample Device Inventory
2-2. Partition Layout for First Disk
2-3. Partition Layout for Subsequent Disks
2-4. FreeBSD 6.X and 7.X ISO Image Names and Meanings
3-1. Disk Device Codes
18-1. Physical Disk Naming Conventions
21-1. Vinum Plex Organizations
26-1. DB-25 to DB-25 Null-Modem Cable
26-2. DB-9 to DB-9 Null-Modem Cable
26-3. DB-9 to DB-25 Null-Modem Cable
26-4. Signal Names
31-1. Wiring a Parallel Cable for Networking
31-2. Reserved IPv6 addresses
List of Figures
2-1. FreeBSD Boot Loader Menu
2-2. Typical Device Probe Results
2-3. Selecting Country Menu
2-4. Select Sysinstall Exit
2-5. Selecting Usage from Sysinstall Main Menu
2-6. Selecting Documentation Menu
2-7. Sysinstall Documentation Menu
2-8. Sysinstall Main Menu
2-9. Sysinstall Keymap Menu
2-10. Sysinstall Main Menu
2-11. Sysinstall Options
2-12. Begin Standard Installation
2-13. Select Drive for FDisk
2-14. Typical Fdisk Partitions before Editing
2-15. Fdisk Partition Using Entire Disk
2-16. Sysinstall Boot Manager Menu
2-17. Exit Select Drive
2-18. Sysinstall Disklabel Editor
2-19. Sysinstall Disklabel Editor with Auto Defaults
2-20. Free Space for Root Partition
2-21. Edit Root Partition Size
2-22. Choose the Root Partition Type
2-23. Choose the Root Mount Point
2-24. Sysinstall Disklabel Editor
2-25. Choose Distributions
2-26. Confirm Distributions
2-27. Choose Installation Media
2-28. Selecting an Ethernet Device
2-29. Set Network Configuration for ed0
2-30. Editing inetd.conf
2-31. Default Anonymous FTP Configuration
2-32. Edit the FTP Welcome Message
2-33. Editing exports
2-34. System Console Configuration Options
2-35. Screen Saver Options
2-36. Screen Saver Timeout
2-37. System Console Configuration Exit
2-38. Select Your Region
2-39. Select Your Country
2-40. Select Your Time Zone
2-41. Select Mouse Protocol Type
2-42. Set Mouse Protocol
2-43. Configure Mouse Port
2-44. Setting the Mouse Port
2-45. Enable the Mouse Daemon
2-46. Test the Mouse Daemon
2-47. Select Package Category
2-48. Select Packages
2-49. Install Packages
2-50. Confirm Package Installation
2-51. Select User
2-52. Add User Information
2-53. Exit User and Group Management
2-54. Exit Install
2-55. Network Configuration Upper-level
2-56. Select a default MTA
2-57. Ntpdate Configuration
2-58. Network Configuration Lower-level
21-1. Concatenated Organization
21-2. Striped Organization
21-3. RAID-5 Organization
21-4. A Simple Vinum Volume
21-5. A Mirrored Vinum Volume
21-6. A Striped Vinum Volume
21-7. A Mirrored, Striped Vinum Volume
List of Examples
2-1. Using an Existing Partition Unchanged
2-2. Shrinking an Existing Partition
3-1. Sample Disk, Slice, and Partition Names
3-2. Conceptual Model of a Disk
4-1. Downloading a Package Manually and Installing It Locally
11-1. Creating a Swapfile on FreeBSD
12-1. boot0 Screenshot
12-2. boot2 Screenshot
12-3. An Insecure Console in /etc/ttys
13-1. Adding a user on FreeBSD
13-2. rmuser Interactive Account Removal
13-3. Interactive chpass by Superuser
13-4. Interactive chpass by Normal User
13-5. Changing Your Password
13-6. Changing Another User’s Password as the Superuser
13-7. Adding a Group Using pw(8)
13-8. Setting the List of Members of a Group Using pw(8)
13-9. Adding a New Member to a Group Using pw(8)
13-10. Using id(1) to Determine Group Membership
14-1. Using SSH to Create a Secure Tunnel for SMTP
18-1. Using dump over ssh
18-2. Using dump over ssh with RSH set
18-3. A Script for Creating a Bootable Floppy
18-4. Using mdconfig to Mount an Existing File System Image
18-5. Creating a New File-Backed Disk with mdconfig
18-6. Configure and Mount a File-Backed Disk with mdmfs
18-7. Creating a New Memory-Based Disk with mdconfig
18-8. Creating a New Memory-Based Disk with mdmfs
19-1. Labeling Partitions on the Boot Disk
26-1. Adding Terminal Entries to /etc/ttys
28-1. Configuring the sendmail Access Database
28-2. Mail Aliases
28-3. Example Virtual Domain Mail Map
29-1. Reloading the inetd configuration file
29-2. Mounting an Export with amd
29-3. Installing Django with Apache2, mod_python3, and PostgreSQL
29-4. Apache Configuration for Django/mod_python
31-1. LACP aggregation with a Cisco switch
31-2. Failover mode
31-3. Branch Office or Home Network
31-4. Head Office or Other LAN
A-1. Checking Out Something from -CURRENT (ls(1)):
A-2. Using SSH to check out the src/ tree:
A-3. Checking Out the Version of ls(1) in the 6-STABLE Branch:
A-4. Creating a List of Changes (as Unified Diffs) to ls(1)
A-5. Finding Out What Other Module Names Can Be Used:

Preface

Intended Audience

The FreeBSD newcomer will find that the first section of this book guides the user through the FreeBSD installation process and gently introduces the concepts and conventions that underpin UNIX®. Working through this section requires little more than the desire to explore, and the ability to take on board new concepts as they are introduced.

Once you have traveled this far, the second, far larger, section of the Handbook is a comprehensive reference to all manner of topics of interest to FreeBSD system administrators. Some of these chapters may recommend that you do some prior reading, and this is noted in the synopsis at the beginning of each chapter.

For a list of additional sources of information, please see Appendix B.

Changes from the Third Edition

The current online version of the Handbook represents the cumulative effort of many hundreds of contributors over the past 10 years. The following are some of the significant changes since the two volume third edition was published in 2004:

  • Chapter 25, DTrace, has been added with information about the powerful DTrace performance analysis tool.

  • Chapter 20, File Systems Support, has been added with information about non-native file systems in FreeBSD, such as ZFS from Sun™.

  • Chapter 17, Security Event Auditing, has been added to cover the new auditing capabilities in FreeBSD and explain its use.

  • Chapter 22, Virtualization, has been added with information about installing FreeBSD on virtualization software.

Changes from the Second Edition (2004)

The third edition was the culmination of over two years of work by the dedicated members of the FreeBSD Documentation Project. The printed edition grew to such a size that it was necessary to publish as two separate volumes. The following are the major changes in this new edition:

  • Chapter 11, Configuration and Tuning, has been expanded with new information about the ACPI power and resource management, the cron system utility, and more kernel tuning options.

  • Chapter 14, Security, has been expanded with new information about virtual private networks (VPNs), file system access control lists (ACLs), and security advisories.

  • Chapter 16, Mandatory Access Control (MAC), is a new chapter with this edition. It explains what MAC is and how this mechanism can be used to secure a FreeBSD system.

  • Chapter 18, Storage, has been expanded with new information about USB storage devices, file system snapshots, file system quotas, file and network backed filesystems, and encrypted disk partitions.

  • Chapter 21, Vinum, is a new chapter with this edition. It describes how to use Vinum, a logical volume manager which provides device-independent logical disks, and software RAID-0, RAID-1 and RAID-5.

  • A troubleshooting section has been added to Chapter 27, PPP and SLIP.

  • Chapter 28, Electronic Mail, has been expanded with new information about using alternative transport agents, SMTP authentication, UUCP, fetchmail, procmail, and other advanced topics.

  • Chapter 29, Network Servers, is all new with this edition. This chapter includes information about setting up the Apache HTTP Server, ftpd, and setting up a server for Microsoft® Windows® clients with Samba. Some sections from Chapter 31, Advanced Networking, were moved here to improve the presentation.

  • Chapter 31, Advanced Networking, has been expanded with new information about using Bluetooth® devices with FreeBSD, setting up wireless networks, and Asynchronous Transfer Mode (ATM) networking.

  • A glossary has been added to provide a central location for the definitions of technical terms used throughout the book.

  • A number of aesthetic improvements have been made to the tables and figures throughout the book.

Changes from the First Edition (2001)

The second edition was the culmination of over two years of work by the dedicated members of the FreeBSD Documentation Project. The following were the major changes in this edition:

  • A complete Index has been added.

  • All ASCII figures have been replaced by graphical diagrams.

  • A standard synopsis has been added to each chapter to give a quick summary of what information the chapter contains, and what the reader is expected to know.

  • The content has been logically reorganized into three parts: “Getting Started”, “System Administration”, and “Appendices”.

  • Chapter 2 (“Installing FreeBSD”) was completely rewritten with many screenshots to make it much easier for new users to grasp the text.

  • Chapter 3 (“UNIX Basics”) has been expanded to contain additional information about processes, daemons, and signals.

  • Chapter 4 (“Installing Applications”) has been expanded to contain additional information about binary package management.

  • Chapter 5 (“The X Window System”) has been completely rewritten with an emphasis on using modern desktop technologies such as KDE and GNOME on XFree86™ 4.X.

  • Chapter 12 (“The FreeBSD Booting Process”) has been expanded.

  • Chapter 18 (“Storage”) has been written from what used to be two separate chapters on “Disks” and “Backups”. We feel that the topics are easier to comprehend when presented as a single chapter. A section on RAID (both hardware and software) has also been added.

  • Chapter 26 (“Serial Communications”) has been completely reorganized and updated for FreeBSD 4.X/5.X.

  • Chapter 27 (“PPP and SLIP”) has been substantially updated.

  • Many new sections have been added to Chapter 31 (“Advanced Networking”).

  • Chapter 28 (“Electronic Mail”) has been expanded to include more information about configuring sendmail.

  • Chapter 10 (“Linux® Compatibility”) has been expanded to include information about installing Oracle® and SAP® R/3®.

  • The following new topics are covered in this second edition:

    • Configuration and Tuning (Chapter 11).

    • Multimedia (Chapter 7)

Organization of This Book

This book is split into five logically distinct sections. The first section, Getting Started, covers the installation and basic usage of FreeBSD. It is expected that the reader will follow these chapters in sequence, possibly skipping chapters covering familiar topics. The second section, Common Tasks, covers some frequently used features of FreeBSD. This section, and all subsequent sections, can be read out of order. Each chapter begins with a succinct synopsis that describes what the chapter covers and what the reader is expected to already know. This is meant to allow the casual reader to skip around to find chapters of interest. The third section, System Administration, covers administration topics. The fourth section, Network Communication, covers networking and server topics. The fifth section contains appendices of reference information.

Chapter 1, Introduction

Introduces FreeBSD to a new user. It describes the history of the FreeBSD Project, its goals and development model.

Chapter 2, Installation

Walks a user through the entire installation process. Some advanced installation topics, such as installing through a serial console, are also covered.

Chapter 3, UNIX Basics

Covers the basic commands and functionality of the FreeBSD operating system. If you are familiar with Linux or another flavor of UNIX then you can probably skip this chapter.

Chapter 4, Installing Applications

Covers the installation of third-party software with both FreeBSD’s innovative “Ports Collection” and standard binary packages.

Chapter 5, The X Window System

Describes the X Window System in general and using X11 on FreeBSD in particular. Also describes common desktop environments such as KDE and GNOME.

Chapter 6, Desktop Applications

Lists some common desktop applications, such as web browsers and productivity suites, and describes how to install them on FreeBSD.

Chapter 7, Multimedia

Shows how to set up sound and video playback support for your system. Also describes some sample audio and video applications.

Chapter 8, Configuring the FreeBSD Kernel

Explains why you might need to configure a new kernel and provides detailed instructions for configuring, building, and installing a custom kernel.

Chapter 9, Printing

Describes managing printers on FreeBSD, including information about banner pages, printer accounting, and initial setup.

Chapter 10, Linux Binary Compatibility

Describes the Linux compatibility features of FreeBSD. Also provides detailed installation instructions for many popular Linux applications such as Oracle, SAP R/3, and Mathematica®.

Chapter 11, Configuration and Tuning

Describes the parameters available for system administrators to tune a FreeBSD system for optimum performance. Also describes the various configuration files used in FreeBSD and where to find them.

Chapter 12, Booting Process

Describes the FreeBSD boot process and explains how to control this process with configuration options.

Chapter 13, Users and Basic Account Management

Describes the creation and manipulation of user accounts. Also discusses resource limitations that can be set on users and other account management tasks.

Chapter 14, Security

Describes many different tools available to help keep your FreeBSD system secure, including Kerberos, IPsec and OpenSSH.

Chapter 15, Jails

Describes the jails framework, and the improvements of jails over the traditional chroot support of FreeBSD.

Chapter 16, Mandatory Access Control

Explains what Mandatory Access Control (MAC) is and how this mechanism can be used to secure a FreeBSD system.

Chapter 17, Security Event Auditing

Describes what FreeBSD Event Auditing is, how it can be installed, configured, and how audit trails can be inspected or monitored.

Chapter 18, Storage

Describes how to manage storage media and filesystems with FreeBSD. This includes physical disks, RAID arrays, optical and tape media, memory-backed disks, and network filesystems.

Chapter 19, GEOM

Describes what the GEOM framework in FreeBSD is and how to configure various supported RAID levels.

Chapter 20, File Systems Support

Examines support of non-native file systems in FreeBSD, like the Z File System from Sun.

Chapter 21, Vinum

Describes how to use Vinum, a logical volume manager which provides device-independent logical disks, and software RAID-0, RAID-1 and RAID-5.

Chapter 22, Virtualization

Describes what virtualization systems offer, and how they can be used with FreeBSD.

Chapter 23, Localization

Describes how to use FreeBSD in languages other than English. Covers both system and application level localization.

Chapter 24, Updating and Upgrading FreeBSD

Explains the differences between FreeBSD-STABLE, FreeBSD-CURRENT, and FreeBSD releases. Describes which users would benefit from tracking a development system and outlines that process. Covers the methods users may take to update their system to the latest security release.

Chapter 25, DTrace

Describes how to configure and use the DTrace tool from Sun in FreeBSD. Dynamic tracing can help locate performance issues, by performing real time system analysis.

Chapter 26, Serial Communications

Explains how to connect terminals and modems to your FreeBSD system for both dial in and dial out connections.

Chapter 27, PPP and SLIP

Describes how to use PPP, SLIP, or PPP over Ethernet to connect to remote systems with FreeBSD.

Chapter 28, Electronic Mail

Explains the different components of an email server and dives into simple configuration topics for the most popular mail server software: sendmail.

Chapter 29, Network Servers

Provides detailed instructions and example configuration files to set up your FreeBSD machine as a network filesystem server, domain name server, network information system server, or time synchronization server.

Chapter 30, Firewalls

Explains the philosophy behind software-based firewalls and provides detailed information about the configuration of the different firewalls available for FreeBSD.

Chapter 31, Advanced Networking

Describes many networking topics, including sharing an Internet connection with other computers on your LAN, advanced routing topics, wireless networking, Bluetooth, ATM, IPv6, and much more.

Appendix A, Obtaining FreeBSD

Lists different sources for obtaining FreeBSD media on CDROM or DVD as well as different sites on the Internet that allow you to download and install FreeBSD.

Appendix B, Bibliography

This book touches on many different subjects that may leave you hungry for a more detailed explanation. The bibliography lists many excellent books that are referenced in the text.

Appendix C, Resources on the Internet

Describes the many forums available for FreeBSD users to post questions and engage in technical conversations about FreeBSD.

Appendix D, PGP Keys

Lists the PGP fingerprints of several FreeBSD Developers.

Conventions used in this book

To provide a consistent and easy to read text, several conventions are followed throughout the book.

Typographic Conventions
Italic

An italic font is used for filenames, URLs, emphasized text, and the first usage of technical terms.

Monospace

A monospaced font is used for error messages, commands, environment variables, names of ports, hostnames, user names, group names, device names, variables, and code fragments.

Bold

A bold font is used for applications, commands, and keys.

User Input

Keys are shown in bold to stand out from other text. Key combinations that are meant to be typed simultaneously are shown with `+‘ between the keys, such as:

Ctrl+Alt+Del

Meaning the user should type the Ctrl, Alt, and Del keys at the same time.

Keys that are meant to be typed in sequence will be separated with commas, for example:

Ctrl+X, Ctrl+S

Would mean that the user is expected to type the Ctrl and X keys simultaneously and then to type the Ctrl and S keys simultaneously.

Examples

Examples starting with E:\> indicate a MS-DOS® command. Unless otherwise noted, these commands may be executed from a “Command Prompt” window in a modern Microsoft Windows environment.

E:\> tools\fdimage floppies\kern.flp A:

Examples starting with # indicate a command that must be invoked as the superuser in FreeBSD. You can login as root to type the command, or login as your normal account and use su(1) to gain superuser privileges.

# dd if=kern.flp of=/dev/fd0

Examples starting with % indicate a command that should be invoked from a normal user account. Unless otherwise noted, C-shell syntax is used for setting environment variables and other shell commands.

% top

Acknowledgments

The book you are holding represents the efforts of many hundreds of people around the world. Whether they sent in fixes for typos, or submitted complete chapters, all the contributions have been useful.

Several companies have supported the development of this document by paying authors to work on it full-time, paying for publication, etc. In particular, BSDi (subsequently acquired by Wind River Systems) paid members of the FreeBSD Documentation Project to work on improving this book full time leading up to the publication of the first printed edition in March 2000 (ISBN 1-57176-241-8). Wind River Systems then paid several additional authors to make a number of improvements to the print-output infrastructure and to add additional chapters to the text. This work culminated in the publication of the second printed edition in November 2001 (ISBN 1-57176-303-1). In 2003-2004, FreeBSD Mall, Inc, paid several contributors to improve the Handbook in preparation for the third printed edition.

Tags: account, Apache, backup, bsd, cron, database, domain, domain name, email, freebsd, FreeBSD Handbook, ftp, inetd, manage, openbsd, password, pop, postgresql, sendmail, smtp, software, ssh, ssl, virtualization, vmware

Related posts

FreeBSD Handbook , , , , , , , , , , , , , , , , , , , , , , ,