Table of Contents

Preface

1 Introduction

1.1 PC-BSD's Goals and Features

1.2 What's New in 9

1.3 PC-BSD Releases

1.4 PC-BSD for Linux Users

1.4.1 Filesystems

1.4.2 Device Names

1.4.3 Feature Names

1.4.4 Commands

1.4.5 Additional Resources

2 Pre-Installation Tasks

2.1 Migrating to PC-BSD

2.2 Minimum Hardware Requirements

2.2.1 Minimum System Requirements

2.2.2 Recommended System requirements

2.2.3 Supported Processors

2.3 Hardware Compatibility

2.4 Laptops

2.4.1 Thinkpad BIOS Versions with Known Bug

2.4.2 Laptops with Built-In Intel Video Chip

2.4.3 MacBooks

2.4.4 Touch Screens

2.5 Partitioning the Hard Drive

2.5.1 Shrinking a Drive in Windows 7

2.5.2 Using Parted Magic to Create a Primary Partition

2.6 Obtaining PC-BSD

2.6.1 Selecting Which File to Download

2.6.2 Data Integrity Check

2.7 Burning the Installation Media

2.7.1 Burning the CD/DVD ISO File on Windows

2.7.1.1 Windows 7 Disc Image Burner

2.7.1.2 ImgBurn

2.7.1.3 InfraRecorder

2.7.2 Burning the CD/DVD ISO File on a BSD or Linux System

2.7.2.1 K3B

2.7.2.2 Brasero

2.7.2.3 growisofs

2.7.3 Burning the CD/DVD ISO File on a Mac OSX System

2.7.4 Writing an IMG File to USB

2.7.4.1 Writing the IMG File on a Linux or BSD System

2.7.4.2 Writing the IMG File on a Windows System

2.7.4.3 Writing the IMG File on a Mac OSX System

2.8 PC-BSD Live Mode

2.9 Using VirtualBox

2.9.1 Creating a Virtual Machine

2.9.2 Configuring the Storage Device

2.9.3 Configuring the Network Adapter

2.9.4 Troubleshooting VirtualBox

3 Installing PC-BSD

3.1 Starting the PC-BSD Installation

3.2 Welcome & Language Selection Screen

3.3 Keyboard Setup Screen

3.4 Installation Type Screen

3.5 Disk Setup Screen

3.6 User Creation Screen

3.7 Meta Package Selection Screen

3.8 Sources Selection Screen

3.9 Pre-Install Summary Screen

3.10 Installation Progress Screen

3.11 Installation Finished Screen

3.12 Post Installation

3.12.1 PC-BSD Graphical Boot Loader

3.12.1.1 Creating a Custom Boot Theme

3.12.2 Configuring Display Settings

3.12.3 Logging In

3.12.4 Auto-login

3.12.5 Welcome & Getting Started

3.13 Installation Troubleshooting

3.13.1 Network Installation Fails

3.13.2 Installation Fails

3.13.3 System Doesn't Boot

3.13.4 Getting Help

4 Advanced Installation Topics

4.1 Using the PC-BSD Installer to Install FreeBSD

4.2 Install PC-BSD Over a Network

4.3 Using a Custom Partition Layout

4.3.1 Customizing a UFS Partition

4.3.1.1 Changing the Defaults

4.3.2 ZFS

4.3.2.1 Customizing the ZFS Pool

4.4 Disk Encryption

4.4.1 Encrypting Other Partitions

4.4.2 Using Your Passphrase

4.5 Dual Booting

4.5.1 Choosing the Installation Partition

4.5.2 GAG, The Graphical Boot Manager

4.5.3 GRUB

4.5.3.1 Adding PC-BSD to Legacy GRUB

4.5.3.2 Adding PC-BSD to GRUB Version 2

4.5.4 Dual Boot with Windows Using EasyBCD

4.6 Upgrading PC-BSD

4.7 Creating an Automated Installation with pc-sysinstall

4.7.1 Determine Which Variables you Wish to Customize

4.7.2 Create a Customized Configuration

4.7.3 Create a Custom Installation Media

5 Desktops

5.1 GNOME2

5.2 KDE4

5.3 LXDE

5.4 XFCE4

5.4.1 XFCE Applications

5.4.2 Editing the Menu

5.4.3 Mounting Devices

5.4.4 XFCE Plugins

5.5 Awesome

5.6 Fluxbox

5.7 FVWM

5.8 IceWM

5.9 Openbox

5.10 ScrotWM

5.11 Window Maker

5.11.1 Working with the Dock

5.11.2 DockApps

6 Installing Applications and Keeping PC-BSD Updated

6.1 Using AppCafe™

6.1.1 Installing and Uninstalling PBI Software

6.1.2 Updating Installed PBIs

6.1.3 Repositories

6.2 PBI Manager

6.2.1 New Features

6.2.2 What is the PBI format?

6.2.3 Underlying File / Directory Structure

6.2.4 Command Reference

6.2.4.1 pbi_add(1)

6.2.4.2 pbi_addrepo(8)

6.2.4.3 pbi_autobuild(8)

6.2.4.4 pbi_browser(1)

6.2.4.5 pbi.conf(5)

6.2.4.6 pbi_create(1)

6.2.4.7 pbi_delete(1)

6.2.4.8 pbi_deleterepo(8)

6.2.4.9 pbi_icon(1)

6.2.4.10 pbi_indextool(1)

6.2.4.11 pbi_info(1)

6.2.4.12 pbi_listrepo(1)

6.2.4.13 pbi_makepatch(1)

6.2.4.14 pbi_makeport(1)

6.2.4.15 pbi_makerepo(1)

6.2.4.16 pbi_metatool(1)

6.2.4.17 pbi_patch(1)

6.2.4.18 pbi_update(1)

6.2.4.19 pbi_update_hashdir(1)

6.2.4.20 pbid(8)

6.3 Update Manager

7 Control Panel

7.1 Ports Jail

7.1.1 Initializing Ports Jail

7.1.2 Installing FreeBSD Packages

7.1.3 Compiling FreeBSD Ports

7.2 Service Manager

7.3 System Manager

7.3.1 Generating a Diagnostic Report

7.3.2 Setting an Update Mirror

7.3.3 Install/Uninstall Desktops and System Components

7.3.4 Install FreeBSD Source and Ports

7.3.5 Set Miscellaneous Options

7.4 User Manager

7.5 Display

7.5.1 Desktop Effects and Compiz

7.5.2 Troubleshooting

7.6 Printing

7.6.1 Researching your Printer

7.6.2 Adding a Printer

7.6.3 Manually Adding a Driver

7.6.4 Printer Troubleshooting

7.7 Network Configuration

7.7.1 Devices: Ethernet Adapters

7.7.2 Devices: Wireless Adapters

7.7.3 Network Configuration (Advanced)

7.7.4 3G and PPP Settings

7.7.5 Proxy Settings

7.7.6 Troubleshooting Network Settings

7.7.6.1 Useful Files and Commands

7.7.7 bwn(4) and bwi(4) Drivers

7.7.7.1 For the bwn driver

7.7.7.2 For the bwi driver

7.7.8 If a Driver Does Not Exist

7.8 Firewall Manager

7.9 Life Preserver

7.9.1 Creating a Backup

7.9.2 Configuration Options

7.9.3 Restoring a Backup

7.10 Warden™

7.10.1 Installing Warden™

7.10.2 Using the Warden™ GUI

7.10.3 Exporting/Importing Jails

7.11 Thin Client

7.11.1 Building the Thin Client Server

7.11.2 Using the Thin Client Server

8 Common Tasks

8.1 Java, Flash, and Fonts

8.1.1 Java

8.1.2 Flash

8.1.3 Fonts

8.1.3.1 Installing Microsoft True Type Fonts

8.1.4 Installing Custom Fonts

8.2 Multimedia

8.2.1 Troubleshooting Sound

8.3 MythTV

8.3.1 Running MythTV for the First Time

8.4 XBMC

8.5 Windows Emulation

8.5.1 Installing and Using Wine

8.6 Files and File Sharing

8.6.1 File Managers and File Structure

8.6.2 Samba

8.6.2.1 Using the Samba Client

8.6.2.2 Installing and Configuring the Samba Server

8.7 Remote Desktop

8.7.1 Connecting to Another Computer Using RDP

8.7.1.1 Preparing the Remote System

8.7.1.2 Connecting with KDE's KRDC

8.7.2 Allowing Another Computer to Connect Using Desktop Sharing

8.8 Security

9 Finding Help

9.1 PC-BSD Forums

9.2 IRC Channel

9.3 Mailing Lists

9.4 FreeBSD Handbook and FAQ

9.5 Social Media

9.6 Search and Portals

9.7 Other Resources

10 Supporting PC-BSD

10.1 Become a Beta Tester

10.2 Become a Translator

10.3 Become a Developer

10.4 Report Bugs

10.5 Submit PBI Requests

10.6 Test PBIs

10.7 Create PBIs

10.7.1 Using EasyPBI

10.7.2 Creating a New PBI with pbi_makeport

10.7.3 PBI Module Components

10.7.4 Useful Tips

10.7.5 Getting Help

10.8 Purchase PC-BSD Swag

10.9 Host a Mirror

10.10 Seed a Torrent

10.11 Become an Advocate

Preface

written by users of the PC-BSD operating system.

Version 9.0

Published January, 2012

Copyright © 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, The PC-BSD Project.

Welcome to PC-BSD! This Handbook covers the installation and use of PC-BSD 9.0. This Handbook is a work in progress and relies on the contributions of many individuals. If you are interested in assisting with the Handbook, visit the PC-BSD wiki and create a login account for yourself. If you use IRC Freenode, you are welcome to join the #pcbsd channel where you will find other PC-BSD users.

Previous versions of the Handbook in various formats and languages are available here.

The PC-BSD 9.0 Users Handbook is freely available for sharing and redistribution under the terms of the Creative Commons Attribution License. This means that you have permission to copy, distribute, translate, and adapt the work as long as you attribute the PC-BSD Project as the original source of the Handbook.

PC-BSD and the PC-BSD logo are registered trademarks of iXsystems. If you wish to use the PC-BSD logo in your own works, ask for permission first from marketing@ixsystems.com.

FreeBSD is a registered trademark of the FreeBSD Foundation.

Typographic Conventions

The PC-BSD 9.0 Users Handbook uses the following typographic conventions:

bold text: represents a command written at the command line. In usage examples, the font is changed to Courier 10 with any command output displayed in unbolded text.

italic text: used to represent device names or file name paths.

bold italic text: used to emphasize an important point.

1Introduction

Welcome to PC-BSD and many thanks for your interest.

Early in 2005, Kris Moore, the founder of PC-BSD, presented the first beta version of PC-BSD, an easy-to-use FreeBSD-based operating system pre-configured for desktop use. Since then, PC-BSD has matured into a polished, feature-rich, free-of-charge, open source operating system that anyone can use, from the beginner to the advanced user alike.

PC-BSD is essentially a customized installation of FreeBSD, not a forked derivative. Since the underlying FreeBSD system has been kept intact, you have a fully functional FreeBSD system under the hood. PC-BSD is basically a pre-configured FreeBSD with a graphical installer, graphical package management, pre-installed packages, and some handy graphical utilities to make PC-BSD suitable for desktop use. As a user of PC-BSD, you don’t have to worry about configuring your system; instead you can simply install and start using it.

The main difference between PC-BSD and FreeBSD is that PC-BSD is geared towards desktop use, while FreeBSD has been created with server use in mind. Other differences include:

- PC-BSD pre-configures at least one desktop manager during installation

- PC-BSD is installed by a graphical installer rather than a text based installer

- the PC-BSD installer supports additional features such as configuring ZFS and encryption during installation

- PC-BSD provides a graphical software management system

- PC-BSD’s rc.conf and sysctl.conf have been tweaked for a desktop environment

- PC-BSD comes pre-configured with a number of automatic scripts to perform tasks such as connecting digital cameras or USB memory sticks

PC-BSD started off as an independent project, but since October, 2006 PC-BSD is (financially) backed and supported by the enterprise-class hardware solutions provider iXsystems.

The rest of this section discusses:

- PC-BSD's Goals and Features

- What's New in 9

- PC-BSD Releases

- PC-BSD for Linux Users

1.1PC-BSD's Goals and Features

Designed with the desktop computer user in mind, PC-BSD, and its community, aim to provide the following:

- Easy installation: to install PC-BSD, simply insert the installation media, reboot the system to start the installer, and answer a few questions in the graphical menus.

- Automatically configured hardware: video, sound, network and other devices are automatically configured for you.

- Intuitive desktop interface: PC-BSD comes with a choice of desktop environments to support your day-to-day computing needs.

- Easy software management: with PC-BSD's AppCafe™ utility, installing, upgrading, and uninstalling software is safe and easy.

- Lots of software available: in addition to its own software, PC-BSD can install software that has been ported to FreeBSD (currently over 23,000 applications).

- Binary compatibility: for software that hasn't been specifically ported to FreeBSD. PC-BSD can run almost any GNU/Linux application using Linux binary compatability It is also able to run many Windows applications using Wine.

- Easy to update: PC-BSD provides a built-in Update Manager that will notify you of available updates and allow you to apply operating system security fixes, bug fixes, system enhancements as well as upgrade to newer versions of the operating system or installed software.

- Virus-free: PC-BSD is not affected by viruses, spyware and other malware.

- No defragmentation: PC-BSD drives do not need to be defragmented and do not slow down over time. PC-BSD also supports ZFS which is a self-healing filesystem.

- Architecture support: PC-BSD is available for 32-bit and 64-bit systems.

- Laptop support: provides power saving and swap space encryption and automatically switches between wired and wifi network connections.

- Secure environment: PC-BSD provides a pre-configured PF firewall and brute-force attack protection with denyhosts.

- Easy system administration: PC-BSD provides a Control Panel containing many graphical tools for performing system administration tasks.

- Localization: PC-BSD supports a number of native languages and locales.

- Vibrant community: PC-BSD has a friendly and helpful support community.

- Professional support: professional email and phone support is available from iXsystems.

1.2What's New in 9

The following features have been added to or improved for PC-BSD 9.0:

- the ability to choose from 11 desktop managers during and after installation

- PBIs are no longer self-contained and now safely share libraries using a hash database; this feature reduces their download size significantly

- PBI upgrades are now incremental, meaning that only the changed files need to be downloaded

- Software Manager has been improved and is now known as AppCafe™

- the PBI system has been rewritten to allow for scriptable, command line utilities

- a PC-BSD Control Panel has been added which provides access to the PC-BSD configuration options, regardless of the desktop manager one is logged into

- configuration utilities from 4 different desktop managers can be added to Control Panel, even when not logged into that desktop manager

- Update Manager has been rewritten and now allows one to upgrade the operating system, installed software (ports, packages, and PBIs), apply security patches, and rebuild the kernel or world

- a wireless configuration tool has been added to the system tray which shows all available networks and provides a quick connect option

- Life Preserver has been improved, making it easier than ever to manage backups

- a Display Manager is now included with Control Panel

- you can install MythTV or XBMC during or after installation

- touchscreen drivers are included and will automatically detect touch screens on laptops

- the amountd script automatically detects USB devices for desktop managers that don't support devd

- the ability to install directly to Mac OS X BootCamp partitions has been added

- PC-BSD configuration utilities are single-instance, meaning that you can't inadvertently end up with multiple open copies of the same application

1.3PC-BSD Releases

As of September 2008, PC-BSD release version numbers are the same as those for FreeBSD. When the first number of a release is followed by a zero (e.g. version 9.0), this means that this version of PC-BSD introduces many new features. When the second number of a release is not a zero (e.g. version 8.2), this means that the new version may have some new features, but it mostly fixes known software problems and security vulnerabilities. If a release includes the letters RC, this means that it is a "Release Candidate", or that the developers are still adding and fixing features and need testers to help them find any existing problems in preparation for the upcoming release. If the release includes the word BETA, it means that that version is still buggy and needs the help of testers to find as many problems as possible so that they can be fixed.

The change logs for each PC-BSD release are available:

- 9.x series

- 8.x series

- 7.x and earlier series

PC-BSD releases follow the same EOL (end of release) cycle as the underlying FreeBSD release. Any security patches for a supported release will appear in Update Manager, making it easy to keep your PC-BSD system fully patched against known security vulnerabilities.

1.4PC-BSD for Linux Users

PC-BSD is based on BSD Unix, meaning that it is not a Linux distribution. If you have used Linux before, you will find that some features that you are used to have different names on a BSD system and that some commands are different. This section covers some of these differences.

1.4.1Filesystems

BSD and Linux use different filesystems during installation. Many Linux distros use EXT2, EXT3, EXT4, or ReiserFS, while PC-BSD uses UFS or ZFS. This means that if you wish to dual-boot with Linux or access data on an external drive that has been formatted with a Linux filesystem, you will want to do a bit of research first to see if the data can be made available on both operating systems.

Table 1.4a summarizes the various filesystems commonly used by desktop systems. Most of the desktop managers available from PC-BSD should automatically mount the following filesystems: FAT16, FAT32, EXT2, EXT3 (without journaling), EXT4 (read-only), NTFS5, NTFS6, and XFS. See section 8.6 Files and File Sharing for more information about available file manager utilities.

Table 1.4a: Filesystem Support Between Linux and PC-BSD

Filesystem

Native to

Type of Non-native Support

Usage Notes

Btrfs

Linux

none

Btrfs, when complete, is expected to offer a feature set comparable to ZFS

EXT2

Linux

r/w through ext2fs(5)

EXT3

Linux

r/w through ext2fs(5)

EXT3 journaling is not supported. This means that you You won't be able to mount a filesystem requiring a journal replay unless you fsck it using an external utility such as e2fsprogs.

EXT4

Linux

r/o through ext2fs(5)

Journaling is not supported. This means that you won't be able to mount a filesystem requiring a journal replay unless you fsck it using an external utility such as e2fsprogs. EXT3 filesystems converted to EXT4 may be more likely to have better results. May not work. Neither having extended attributes 'enabled' nor inodes greater than 128-bytes are supported.

FAT16

Windows

r/w through msdosfs(5)

FAT32

Windows

r/w through msdosfs(5)

HFS+

Mac OSX

none

Older Mac versions might work with hfsexplorer.

JFS

Linux

none

If you're interested in journaling, choose UFS+J during installation.

NTFS5

Windows

full r/o with some limitations on r/w when using mount_ntfs(8);

full r/w through ntfs-3g(8)

PC-BSD uses ntfs-3g

NTFS6

Windows

r/w through ntfs-3g(8)

ReiserFS

Linux

r/o through reiserfs(5)

UFS

BSD

r/o support is included in Linux kernel 2.6.5 onwards;

r/w support on Mac;

UFS Explorer can be used on Windows

Changed to r/o support in Mac Lion.

UFS+S

FreeBSD

PC-BSD

check if your Linux distro provides ufsutils;

r/w support on Mac;

UFS Explorer can be used on Windows

Changed to r/o support in Mac Lion.

UFS+J

FreeBSD

PC-BSD

check if your Linux distro provides ufsutils;

r/w support on Mac;

UFS Explorer can be used on Windows

Changed to r/o support in Mac Lion.

XFS

Linux

r/o through xfs(5)

ZFS

FreeBSD

PC-BSD

OpenSolaris

Linux portMac support is under development

1.4.2Device Names

Linux and BSD use different naming conventions for devices. For example:

- in Linux, Ethernet interfaces begin with eth; in BSD, interface names indicate the name of the driver. For example, an Ethernet interface may be listed as re0, indicating that it uses the Realtek re driver. The advantage of this convention is that you can read the man 4 page for the driver (e.g. type man 4 re) to see which models and features are provided by that driver.

- BSD disk names differ from Linux. IDE drives begin with ad and SCSI and USB drives begin with da.

1.4.3Feature Names

Some of the features used by BSD have similar counterparts to Linux, but the name of the feature is different. Table 1.4b provides some common examples:

Table 1.4b: Names for BSD and Linux Features

PC-BSD

Linux

Description

PF

iptables

default firewall

/etc/rc.d/ for operating system

/etc/rc.d/ for applications

rc0.d/, rc1.d/, and so on

in PC-BSD, the directories containing the startup scripts do not link to runlevels as there are no runlevels; system startup scripts are separated from third-party application scripts

/etc/ttys and /etc/rc.conf

telinit and init.d/

terminals are configured in ttys and rc.conf indicates which services will start at boot time

1.4.4Commands

If you're comfortable with the command line, you may find that some of the commands that you are used to have different names on BSD. Table 1.4c lists some common commands and their equivalents.

Table 1.4c: Common BSD and Linux Commands

PC-BSD

Linux

Result

dmesg

lsdev

discover what hardware was detected by the kernel

sysctl dev

cat /proc/devices

display configured devices

pciconf -l -cv

lspci -tv

show PCI devices

dmesg | grep usb

lsusb -tv

show USB devices

kldstat

lsmod

list all modules loaded in the kernel

kldload <module>

modprobe <module>

load a kernel module for the current session

pbi_add -r <pbiname>

rpm -i <package>.rpm

install software from the command line

sysctl hw.realmem

cat /proc/meminfo

hardware memory

sysctl hw.model

cat /proc/cpuinfo

CPU model

sysctl hw.machine_arch

uname -m

CPU architecture

sysctl hw.ncpu

getconf _NPROCESSORS_ONLN

number of CPUs

uname -vm

lsb release -a

cat /etc/*release

cat /etc/*version

get release version information

gpart show

fdisk -l

parted -l

show device partition information

1.4.5Additional Resources:

- Comparing BSD and Linux

- An Open Source Alternative to Linux

- Quickstart Guide for Linux Users

- BSD vs Linux Rant

2Pre-Installation Tasks

Installing PC-BSD is very easy. However, you should review this section to make sure your hardware is supported and you know how to prepare your installation media. This section discusses the following topics:

- Migrating to PC-BSD

- Minimum Hardware Requirements

- Hardware Compatibility

- Laptops

- Partitioning the Hard Drive

- Obtaining PC-BSD

- Burning the Installation Media

- PC-BSD Live Mode

- Using VirtualBox

2.1Migrating to PC-BSD

Migrating your computer to a brand new operating system can sometimes be a daunting task.

Before you begin, there are a few things you should check to ensure that your system is ready to install PC-BSD.

- Are you dual-booting or installing over the entire drive? If you are dual-booting you will need to ensure that you have a primary partition available. You should also review section 4.5 Dual Booting to make sure you are comfortable with preparing the drive for the installation and to determine which boot loader best suits your needs.

- What type of video card is your system using? Like most open source operating systems, PC-BSD uses X.org drivers for graphics support. X.org supports many video cards; you can check if your video card is supported at the X.org Drivers page. If you want to use 3D acceleration, NVIDIA is currently the best supported as there is a native driver for PC-BSD. Until the DRI/GEM/KMS work is complete (expected for PC-BSD 9.1), 3D acceleration will not work on ATI or Radeon cards. You can still use these cards, but you will have to use the 2D driver.

- Are you using a wifi card in your system? PC-BSD has built-in support for dozens of wireless networking cards. You can check if your card has a FreeBSD driver. If it does, it should "just work".

- Have you backed up your important data? Any irreplaceable data, such as emails, bookmarks, or important files and documents should always be backed up to an external media, such as a removable flash drive, before installing or upgrading any operating system.

If you would like to try out PC-BSD before committing to an install, try PC-BSD Live Mode first. This is an excellent way to determine if your hardware will work with PC-BSD.

2.2 Minimum Hardware Requirements

PC-BSD has moderate hardware requirements and commonly uses less resources than its commercial counterparts. Before installing PC-BSD on your computer, make sure you meet the minimum requirements.

2.2.1Minimum System Requirements

At a bare minimum, you need to have the following computer hardware in order to install PC-BSD:

- Pentium II or higher

- 512 MB RAM

- 4GB of free hard drive space

- Network card

- Sound card

2.2.2Recommended System requirements

The following are the minimum recommended requirements. The faster your computer hardware, the better your computing experience:

- Pentium 4 or higher

- 1024 MB of RAM

- 20GB of free hard drive space (if you will be installing KDE, GNOME, or lots of software)

- Network card

- Sound card

- NVIDIA 3D accelerated video card

You can never have too much RAM, so install as much as you can afford. To play modern video games, you should use a fast CPU. If you want to create a collection of tunes and movies on your computer, you will want a large hard disk drive which can be internal or external.

2.2.3Supported Processors

PC-BSD should install on any system containing a 32-bit (also called i386) or 64-bit (also called amd64) processor. Despite the amd64 name, a 64-bit processor does not need to be manufactured by AMD in order to be supported. The FreeBSD Hardware Notes list the i386 and amd64 processors known to work.

2.3Hardware Compatibility

While most hardware "just works" with PC-BSD, it is possible that you'll run across a piece of hardware that does not. If you do, you can help improve hardware support for all PC-BSD users by reporting the problem so that it can be addressed by the developers. It should be remembered that PC-BSD is really FreeBSD, meaning that any hardware that works on FreeBSD will work on PC-BSD.

If you wish to check your hardware before installing PC-BSD, a good place to start is the FreeBSD 9.0 Hardware Notes. Another good resource is to run PC-BSD in Live Mode; that way you can test your various devices before committing to an install.

If you are experiencing problems with a device, start with a Google search for the term "FreeBSD" plus the type and model of the hardware. This will let you know if there is a known issue with the device. If there are many search results, concentrate on the most recent ones as often hardware that used to be problematic has since been fixed or the missing driver will be available in an upcoming release of FreeBSD.

Currently there are some known issues with wireless devices and the developers that are fixing these problems are looking for testers. More information is available on the Wireless Testing page.

If you experience problems with a device that should work but does not or you can not find any existing problem reports for your hardware, please take a few moments to report the problem. Instructions on where to send your report and suggestions for what information should be included in your report can be found in section 10.1 Become a Beta Tester.

2.4Laptops

Many PC-BSD users successfully run PC-BSD on their laptops. To determine if the hardware on your laptop is supported, search the FreeBSD Laptop Compatibility List. Consider adding to this list if your model is not listed or the information for your model is out-of-date.

Depending upon the model of laptop, you may run across some issues. These typically deal with:

- sleep/suspend: unfortunately, ACPI is not an exact science meaning, that you may have to experiment with various sysctl variables in order to achieve successful sleep and suspend states on your particular laptop model. If your laptop is a Thinkpad, read man acpi_ibm. Thinkwiki is another excellent source. For other types of laptops, try reading the SYSCTL VARIABLES section of man 4 acpi. The Tuning with sysctl section of the FreeBSD Handbook demonstrates how to determine your current sysctl values, modify a value, and make a modified value persist after a reboot.

- internal wireless: some chipsets don't have a FreeBSD driver yet. If you would like to try converting a Windows driver into a FreeBSD module, use the instructions in this blog post.

- internal ATI or Radeon graphics: at this time, these chipsets will only support 2D graphics. This should be fixed by PC-BSD 9.1.

If you wish to test your laptop's hardware, consider using PC-BSD Live Mode, described in section 2.8, before committing to an installation.

If you would like to install PC-BSD onto an Asus Eee, read the FreeBSD Eee page first.

2.4.1Thinkpad BIOS Versions with Known Bug

If you wish to install PC-BSD on an older IBM/Lenovo Thinkpad laptop, it is important to first check your Thinkpad model number to see if its BIOS has a known bug. This bug is rather nasty and will render the computer completely unbootable--even the BIOS will be inaccessible. This situation occurs as the BIOS thinks that the PC-BSD (FreeBSD) partition number represents the IBM repair partition. The only way to get the affected laptop to boot again is to physically remove the hard drive, insert it into another laptop, wipe the drive, and insert the drive back into the system. While the hard drive is in the other system, you'll note that PC-BSD boots just fine as the problem is with the BIOS, not the hard drive. Once the BIOS is accessible again, you should upgrade (or possibly downgrade) the BIOS to a version number that fixes this bug. See Table 2.4a for the models which are affected, the BIOS version number that fixes the bug, and links to the BIOS software should you need to upgrade your BIOS. The BIOS needs to incorporate the fix "The system cannot boot from a hard disk drive with partition ID of n5h where n is 1 or greater".

Table 2.4a: Thinkpad BIOS Versions with Known Bug

Model Number

BIOS Version That Fixes Bug

A20m

1.08 - IWET54WW

A20p

1.05 - IVET62WW

A21e(2628)

1.07 (KUET30WW)

A21m (except Sxx models)

1.02 KXET24WW

A21p

1.04 - KYET27WW

A22m (except Sxx models)

1.02 KXET24WW

A22p

1.04 - KYET27WW

T20

1.10 - IYET49WW

T21

1.04 KZET22WW

X20

2.16 (IZET96WW)

X21

2.16 (IZET96WW)

2.4.2Laptops with Built-In Intel Video Chip

The FreeBSD Foundation and iXsystems are funding a project to add native DRI, GEM, and KMS support to the FreeBSD kernel for version 9.1. In the mean time, video drivers that require these kernel hooks currently use the X.org driver with those features disabled. Usually this means that the card works but may be missing features such as 3D acceleration.

It has been reported that Centrino based-laptops will fail to boot the installation DVD in both live and install mode. If your laptop has a built-in Intel chipset and will not boot the installation media, select "Run X in VESA mode" from the installer's boot menu. Once the installation is complete, you will need to select the default vesa driver from the display settings menu as selecting an Intel driver will freeze the system. Once DRI/GEM/KMS support is available in PC-BSD, you will be able to use the Intel driver.

2.4.3MacBooks

Before starting, you should review the MacBook on FreeBSD Wiki.

Starting in PC-BSD 9.0-RC1, support has been added for installing directly to Mac OS X BootCamp partitions.

First, you can install an OS X boot-manager, such as rEFIt. This step is optional as it requires either a dedicated partition or it installs into your OS X partition and takes over the boot process.

Next, you will need to make some free space to install into. You can use the MacBook's BootCamp utility to make a primary partition of at least 25 GB in size.

After creating the BootCamp partition, boot from the PC-BSD install media and proceed with a normal installation. When you get to the disk selection screen, be sure to select the ada0p3: linux-data partition for installation. After installation, reboot and select BSD from the rEFIt (or an alternate) boot menu to boot into the new PC-BSD installation.

2.4.4Touch Screens

Starting in PC-BSD 9.0, automatic detection of USB-based touch screen devices has been added. During the display wizard phase, if your touch-screen is auto-detected, the necessary flags will be added to /etc/X11/xorg.conf automatically. If your display is USB and is NOT auto-detected, please send the output of usbconfig and your /etc/X11/xorg.conf file to the PC-BSD testing mailing list.

2.5Partitioning the Hard Drive

PC-BSD does not come with a built-in partition manager as the installer assumes that the drive is already prepared for an installation. If you are not planning to install PC-BSD onto the entire hard drive, you will need to use a third-party application in order to prepare a primary partition to install PC-BSD into.

NOTE: PC-BSD will not install into a secondary or logical partition, it must be a primary partition.

Before creating or editing your hard drive's partitions, make sure that you first back up your valuable data to an external media such as a removable USB drive!

2.5.1Shrinking a Drive in Windows 7

If you are currently running Windows 7, it is using the entire hard drive. This means that you will need to first shrink the drive in order to make room to create a new partition. Shrinking is an operation that retains the current data on the partition, while reducing the size of the partition.

To shrink the drive, go to Start menu -> right-click Computer -> Manage -> Storage -> Disk Management. Figure 2.5a shows an example of a system running Windows 7. In this example, Windows has created three partitions: a 16GB recovery partition, a 100MB system partition, and a 450GB data partition.

Figure 2.5a: Viewing Disk Layout in Disk Management

NOTE: if you plan to dual-boot with Windows, it is important that you do not choose to install PC-BSD into any of these three partitions when you get to the Disk Selection Screen of the PC-BSD installation. It is a good idea to write down the sizes of the partitions so that you will recognize them when the PC-BSD installer displays your current partitions.

Since the three Windows partitions are using the entire disk, the data partition needs to be shrunk in order to create space to install PC-BSD into. To shrink the data partition, right-click the partition, in this example it is called Acer (C:), and select Shrink Volume. Wait a moment as it queries the volume for available shrink space; the results will be displayed as seen in the example in Figure 2.5b.

Figure 2.5b: Available Shrink Space

In this example, 321089MB of space is available. Since I wish to divide the partition between Windows and PC-BSD, I'll change that number to 230000 and click the Shrink button. When finished, the newly created free space will be displayed, as seen in Figure 2.5c.

Figure 2.5c: Disk Now Has Free Space

You can now format the newly created free space using a utility such as Parted Magic, as described in the next section.

NOTE: While the Disk Management utility in Windows 7 indicates that it will let you format a primary partition, in reality it will only create an extended partition which will not allow you to install PC-BSD. This means that you still need another utility such as Parted Magic.

2.5.2Using Parted Magic to Create a Primary Partition

Parted Magic is a graphical, easy-to-use partition editor that is packaged on a live CD. It can be used to shrink an existing partition and to create a primary partition from existing free space.

To use Parted Magic, download the latest .iso.zip file, unzip it, and burn it to CD. Boot the system with the CD and let it boot into "Default settings (Runs from RAM)". Wait for it to boot into the graphical screen, then select the Partition Editor desktop icon.

Figure 2.5d shows the same Windows 7 system in Partition Editor. The 225.05GB partition is the Windows data partition (which was displayed as drive C within Windows 7) and the 224.61GB of unallocated space was created using the Windows Disk Management utility. The Create new Partition screen was opened by right-clicking on the unallocated space and selecting New from the menu.

Figure 2.5d: Formatting the Unallocated Space into a Primary Partition

When creating your partition from unallocated space, make sure that "Primary Partition" is selected. The file system type does not matter as the PC-BSD installer will reformat it. It is a good idea to write down the size and file system type so that you will recognize the partition that you will be installing PC-BSD into. Once you have made your selections, click the Add button. Note that the partition will not actually be created until you click the Apply button to apply your changes. A popup menu will prompt you to make sure that you have selected the correct partition as formatting a partition destroys all data on that portion of the disk. Once the operation is complete, you can reboot and start the PC-BSD installation.

2.6Obtaining PC-BSD

The installation files for PC-BSD can be downloaded for free and end with an .iso or .img.bz2 file extension. Depending upon the type of file you choose, the size will vary between ~200MB and ~3.5GB. This section will show you how to select which file to download and how to verify the downloaded file's checksum. The next section will demonstrate how to burn the file to bootable media.

If you have a slow download connection or wish to support the PC-BSD project financially, you can purchase PC-BSD DVDs from the FreeBSD Mall.

Members of the PC-BSD project attend many IT conferences across the globe and give out PC-BSD DVDs at conference booths. Visiting a PC-BSD booth is an excellent way to meet other PC-BSD users and to get your questions answered. Check the PC-BSD Blog to see if any events are happening near you. If you are organizing a PC-BSD booth, contact us to arrange for DVDs.

2.6.1Selecting Which File to Download

When you go to the Download page of the PC-BSD website, you will find a number of files available for download:

- DVD-live: contains a live version of PC-BSD running the KDE4 desktop (no components or extra apps); requires a DVD burner/reader

- DVD: contains the full version of PC-BSD (all components and included apps); requires a DVD burner

- CD: contains a stripped down version of PC-BSD and the LXDE desktop (no components or extra apps); requires a CD burner/reader

- USB-live: contains a live version of PC-BSD running the KDE4 desktop (no components or extra apps); requires a USB memory stick or flash card

- USB: contains the full version of PC-BSD (all components and included apps); requires a USB memory stick or flash card

- USB-lite: contains a stripped down version of PC-BSD and the LXDE desktop (no components or extra apps); requires a USB memory stick or flash card

- USB-boot-only:contains the installer only; requires a USB memory stick or flash card and a network connection during the install

- Boot-only ISO: contains the installer only; requires a CD burner/reader and a network connection during the install

- VMware disk image: contains the full version of PC-BSD (all components and included apps); requires VMware to be installed

- VirtualBox disk: contains the full version of PC-BSD (all components and included apps); requires VirtualBox to be installed

NOTE: you will need to unzip the VMware and VirtualBox images before using them. The password for both the guest and root user for these virtual images is pcbsd.

The larger the installation file size, the more components and applications that come with that installation. For example, the full versions contain everything while the boot-only versions only contain the installer. If you choose to download a boot-only version, the initial download will be quick (due to the file size), but you will need an active Internet connection during the installation so the installer can download the rest of the files that it needs to perform the installation.

Regardless of which media you use to install PC-BSD, you have the option to install additional components and applications after the installation using System Manager and AppCafe™.

There are two versions available for each type of file: one for 32-bit (i386) systems and one for 64-bit (amd64) systems. It is important that you download a file that matches your computer's processor type (32- or 64-bit).

NOTE: If you plan to use VirtualBox to install PC-BSD, you can install the 32-bit version, even if your computer is 64-bit. Depending upon your processor's capabilities, you may or may not be able to install the 64-bit version on a 64-bit system using VirtualBox.

2.6.2Data Integrity Check

After downloading the file that is correct for your architecture and installation type, it is a good idea to check that the file is exactly the same as the one on the PC-BSD server. While downloading, a portion of the file may get damaged or lost, making the installation file unusable. Each PC-BSD download has an associated MD5 checksum which is listed next to the download link. If the checksum of the file you downloaded has the same number, your download was successful. If the MD5 numbers don't match, you should download the file again, preferably from a different mirror. In order to verify the checksum, you will need to use a checksum verification utility.

If you are currently using a Windows system, you can download and install the FastSum utility. Once installed, launch the program and click the Files button, shown in Figure 2.6a, to browse to the location of your downloaded file:

Figure 2.6a: Verifying a Checksum Using FastSum

Once the file is selected, click the green arrow to calculate the checksum. Once calculated, it will be listed in the Checksum\State column. In this example, the checksum is e66acb8ff1013c6c5e114191e9556580 (though FastSum will capitalize the letters).

On Linux and BSD systems you can use the built-in md5 command line tool to check the data integrity of the downloaded file. In this example, the file is located in the Downloads subdirectory of a user's home (~) directory. You should substitute the name and location of the file that you downloaded:

md5 ~/Downloads/PCBSD9.0-RELEASE-x86-DVD.iso

MD5 (Desktop/PCBSD9.0-RELEASE-x86-DVD.iso) = e66acb8ff1013c6c5e114191e9556580

2.7Burning the Installation Media

Once you have downloaded and verified the PC-BSD file, you will need to burn it to the correct media. This section demonstrates how to do so using several different applications and operating systems. It assumes that you have downloaded the correct ISO file for your media (CD or DVD), that your CD or DVD reader is capable of burning, and that you have inserted a blank or rewritable disk into the burner.

2.7.1Burning the CD/DVD ISO File on Windows

Several burning applications are available for Windows. This section will demonstrate how to use Windows 7's Disc Image Burner, ImgBurn, and InfraRecorder.

2.7.1.1Windows 7 Disc Image Burner

Windows 7 has built-in support for writing ISO images to disc. Right-click on the .iso file in Windows Explorer and select Open with -> Windows Disc Image Burner to open the screen shown in Figure 2.7.1a. Click "Burn" to write the disc. See the Microsoft article Burn a CD or DVD from an ISO file for more detailed instructions.

Figure 2.7.1a: Windows Disc Image Burner

2.7.1.2ImgBurn

ImgBurn is an easy to use image burner for Windows that is available for free download. After installing and launching ImgBurn, select "Write image file to disk" from the main menu, seen in Figure 2.7.1b:

Figure 2.7.1b: Initial ImgBurn Screen

You can then use File -> Browse for a source file... to select the .iso file to burn; once selected, your screen should look similar to Figure 2.7.1c. Click the Write icon in the lower left corner to begin the burn.

Figure 2.7.1c: Selecting the Source File (.iso) and Destination (burner) in ImgBurn

ImgBurn will provide a status bar to indicate the progress of the burn. When it is finished, ImgBurn will eject the burner tray then reclose it in order to verify the burn. If the tray does not return itself, which may occur on a laptop, push the tray back in if you wish to verify the burn.

2.7.1.3InfraRecorder

InfraRecorder is an open source burning application for both CDs and DVDs. Once installed, open InfraRecorder and click on the "Write Image" button shown in Figure 2.7.1d:

Figure 2.7.1d: Initial InfraRecorder Screen

InfraRecorder will display a screen where you can browse to the location of the PC-BSD image. Once selected, you will be presented with an options screen shown in Figure 2.7.1e:

Figure 2.7.1e: Burn Options in InfraRecorder

You can accept the defaults and click OK to start the burn. When finished, the burner tray will open and a dialog box will appear indicating that the burning process has finished.

2.7.2Burning the CD/DVD ISO File on a BSD or Linux System

This section demonstrates how to burn the installation ISO on a Linux or BSD system using the following tools: K3B, Brasero, and growisofs.

2.7.2.1K3B

The KDE desktop environment provides the K3B burning application. K3B has a similar interface to burning software found on Windows and is equally easy to use.

NOTE: depending upon your Linux distribution, K3B may or may not be included with the installation of KDE. If it does not appear in the KDE application launcher, you should be able to install it using your operating system's software management system. On a FreeBSD system, you can install the K3B package. If you are running an older version of KDE, use the pkg_add -r k3b command. If you are running KDE4, use the pkg_add -r k3b-kde4 command instead. On a PC-BSD system, you can install the K3B PBI using AppCafe™.

To burn your ISO, launch K3B and click "Tools → Burn Image...". Figure 2.7.2a demonstrates this screen on a KDE4 system. On a KDE3 system, the menu item may appear as "Burn DVD ISO Image...".

Figure 2.7.2a: Selecting the Burn Image Tool Within K3B

A new window, seen in Figure 2.7.2b, will launch. Click the blue folder to browse to the location of your .iso file.

Figure 2.7.2b: K3B's Burn Image Screen

Once your file is listed, click the "Start" button. K3B will automatically eject the media once the burn is complete.

2.7.2.2Brasero

Brasero is an easy to use burning application included with the GNOME desktop. A PBI is also available within AppCafe™. To launch Brasero within GNOME, click Applications -> Multimedia -> Brasero Disk Burner and the dialog window shown in Figure 2.7.2c will be displayed.

Figure 2.7.2c: Brasero's Initial Screen

If you click on Burn image -> Click here to select a disk image, you will be able to select your .iso file. Once selected, click "Open" to return to the screen seen in Figure 2.7.2d:

Figure 2.7.2d: Viewing the Image to Burn and the DVD Hardware Properties Within Brasero

The name and size of your .iso file should appear and Brasero will indicate the size of the media. The lower portion of Figure 2.7.2d shows the menu that appears if you click on the Properties button. You can change these options if you wish, but it is fine to keep the default settings. When you are ready, click the "Burn" button and Brasero will burn your ISO.

2.7.2.3growisofs

If you are familiar with using the command line on a FreeBSD or PC-BSD system, you can use the growisofs command line utility to burn the DVD. This utility is included with the dvd+rw-tools FreeBSD port which is installed by default on a PC-BSD system. If that software is not yet installed on a FreeBSD system, issue this command as the superuser:

pkg_add -r dvd+rw-tools

Depending upon the type of DVD burner hardware, you may have to configure the system to use it. If the device is ATAPI (i.e. not USB or SCSI), the ATAPI driver must be loaded. The superuser can issue this command:

kldload atapicam

If you just get your prompt back, the driver successfully loaded. If you get the message "kldload: can't load atapicam: File exists", this means that the driver was already loaded. If the device is USB or SCSI, no additional drivers need to be loaded if you are running the generic FreeBSD kernel. After inserting the DVD media into the device, you can start the burn using this command:

growisofs -Z /dev/cd0=PCBSD9.0-RELEASE-x86-DVD.iso

If your device is not the first CD device, change the number 0 accordingly. If your ISO has a different name, substitute the correct name in the command shown above.

2.7.3Burning the CD/DVD ISO File on a Mac OSX System

To burn the ISO on a Mac OSX system, go to Finder -> Applications -> Utilities -> Disk Utility. With a blank media inserted into the burner, highlight the device representing the CD/DVD writer and click the Burn button. This will open up a browser where you can select the ISO that you with to burn. In the example shown in Figure 2.7.3a, the DVD ISO has been selected and the device is a Sony DVD writer.

Figure 2.7.3a: Using Disk Utility on Mac OSX

Once the ISO is highlighted, click the Burn button. A pop-up message will indicate that the device is ready to burn. Click burn once more and Disk Utility will write the ISO to the CD/DVD media.

2.7.4Writing an IMG File to USB

To write an .img.bz2 file you will need the following:

- a utility that can extract bz2 zipped files

- a utility that can write the image to a USB media; the utility that you use will depend upon your operating system.

- a USB thumb drive or hard drive large enough to hold the image.

Once the image is written, boot from the removable device and proceed with the installation. If you are using the boot-only image, you will also need to refer to section 4.2 Install PC-BSD Over a Network as this image requires an Internet connection to download the rest of the files needed to complete the installation of PC-BSD.

NOTE: if the system does not boot from the removable device, check the boot order in your system BIOS.

2.7.4.1Writing the IMG File on a Linux or BSD System

If you selected to download an .img.bz2 file instead of an ISO, you can write the image file to a flash card or removable USB drive using the bunzip2 and dd command line utilities on a BSD or Linux system. On a FreeBSD system, the superuser can use these commands to extract the specified image and write it to the first plugged in USB device:

bunzip2 PCBSD9.0-RELEASE-x86-USBFULL.img.bz2

dd if=PCBSD9.0-RELEASE-x86-USBFULL.img of=/dev/da0 bs=64k conv=sync

63200+0 records in

63200+0 records out

4141875200 bytes transferred in 1395.261087 secs (2968531 bytes/sec)

When using the dd command:

- if= refers to the input file to be written; it should end with an .img extension

- of= refers to the output file (the device name of the flash card or removable USB drive): increment the number in the name if it is not the first USB device

- bs= refers to the block size

- conv=sync pads the final block so it is the specified block size

NOTE for Linux users: if you type mount with the USB stick inserted, you will see two or more device nodes corresponding to the USB stick. For example, /dev/sdc and /dev/sdc1, where /dev/sdc1 corresponds to the primary partition of the USB stick. Before using the dd command, ensure that the usb stick is first unmounted. When using the dd command, remember to use /dev/sdc (device node without the number) as the option for the output file of=. Once the dd completes, you might not be able to mount the USB stick on Linux as Linux has very limited support for UFS, the BSD file system that gets created on the USB stick.

2.7.4.2Writing the IMG File on a Windows System

To burn the image file on a Windows system, you can use win32-image-writer. You'll also need a utility that can extract .bz2 files such as 7-Zip.

When downloading win32-image-writer, download the latest version that ends in -binary.zip and use a utility such as WinZip or 7zip to unzip the executable.

To extract the PC-BSD image file using 7-Zip, browse to the location containing your downloaded .img.bz2 file, as seen in Figure 2.7.4a.

Figure 2.7.4a: Using 7-Zip to Extract Image File

Click the Extract button and browse to the location where you would like to save the extracted image. Once extracted, your image will end in .img and is now ready to be written to a USB device using the win32-image-writer application.

If you launch win32-image-writer.exe, it will start the Win32 Disk Imager utility, shown in Figure 2.7.4b. Use the browse button to browse to the location of the .img file. Insert a USB thumb drive and select its drive letter (in this example, drive F). Click the Write button and the image will be written to the USB thumb drive.

Figure 2.7.4b: Using Win32 Disk Imager to Write the Image

2.7.4.3Writing the IMG File on a Mac OSX System

To extract the .img.bz2 file on a Mac system, use Finder to browse to the location of the file, as seen in Figure 2.7.4c.

Figure 2.7.4c: Extracting the Image on Mac

Simply double-click the file to extract it to the .img format. Finder will create a second file with the .img extension.

To burn that .img file, insert a USB stick and open Terminal. Run the diskutil list command to find out the device name of the USB disk, unmount the USB disk, then use dd to write the image to the "raw" disk (rdisk). In the following example, an 8GB USB stick has a device name of /dev/disk1 and a raw device name of /dev/rdisk1.

diskutil list

/dev/disk0

#:        TYPE NAME            SIZE       IDENTIFIER

0:   GUID_partition_scheme    *500.1 GB   disk0

1:                     EFI     209.7 MB   disk0s1

2:  Apple_HFS Macintosh HD     499.2 GB   disk0s2

3:  Apple_Boot Recovery HD     650.0 MB   disk0s3

/dev/disk1

#:        TYPE NAME            SIZE       IDENTIFIER

0:  FDisk_partition_scheme    *8.0 GB     disk1

1:     DOS_FAT_32 UNTITLED     8.0 GB     disk1s1

diskutil unmountDisk /dev/disk1

Unmount of all volumes on disk1 was successful

sudo dd if=/Users/dru/Downloads/PCBSD9.0RELEASE-x86-USBFULL.img of=/dev/rdisk1 bs=4m

Password:

375+0 records in

375+0 records out

1572864000 bytes transferred in 86.742798 secs (18132502 bytes/sec)

2.8PC-BSD Live Mode

If you wish to try out PC-BSD before installing it, download either the live DVD or live USB version. Once you have burned the downloaded file to the appropriate media, insert the DVD or USB device. Assuming your BIOS has been set to boot from that device, you should see some startup messages followed by the PC-BSD boot menu, shown in Figure 2.8a.

Figure 2.8a: PC-BSD Welcome Screen in Live Mode

This screen provides the following options:

1. Boot [default]: continues to boot PC-BSD with all standard options enabled. This is the default if you don't select anything else within 10 seconds.

2. Boot with ACPI enabled: by default ACPI is disabled in live mode. If you wish to test PC-BSD's ACPI capabilities on your computer, select this option.

3. Boot in Safe Mode: if PC-BSD has problems booting on your hardware, try selecting this option.

4. Boot with verbose logging: select this option if you would like to see more detailed messages during the boot process. This can be useful if you wish to watch that all of your hardware is successfully detected.

5. Boot to emergency console: will boot to the menu shown in Figure 2.8b. If you choose the System Utilities option, you can manually run fdisk, drop to an emergency shell, or chroot into the root partition.

6. Boot with X in VESA mode: select this option if you suspect that your video card is not supported by PC-BSD.

7. Escape to loader prompt: advanced users can select this option to perform advanced operations such as loading or unloading kernel modules.

Figure 2.8b: Emergency Console in Live Mode

Unless you select to boot into the emergency console or the loader prompt, PC-BSD will continue to load. When it is finished loading, the desktop selector menu, shown in Figure 2.8c, will appear:

Figure 2.8c: Desktop Selector Menu

Use your arrow keys or type the letter of the window manager you wish to boot into, then press enter.

Figure 2.8d shows a screenshot of PC-BSD running the KDE desktop manager from live mode.

Figure 2.8d: PC-BSD in Live Mode

NOTE: like any live DVD, the amount of installed memory will affect the time it takes the operating system to load and how responsive the system is once loaded. Also, live mode provides very little storage, meaning that you should not install applications or save files within this mode. Live mode is meant to provide an environment for testing hardware and to see if you like PC-BSD. If you do, you should consider installing PC-BSD either onto the computer's hard drive or into a virtual environment such as VirtualBox.

If you wish to install PC-BSD, simply click the “Install PC-BSD” icon on the desktop. It will start the installation program for you.

If you wish to leave live mode altogether, click the red flame in the lower left corner -> Leave. You can then select to Restart or Shut down the computer.

2.9Using VirtualBox

A virtualized environment allows you to test drive an operating system without overwriting your current operating system. This is an excellent way to practice installation, to see if all of your hardware is supported, or to try multiple versions of operating systems. Virtualization software effectively creates windows (known as virtual machines) into which you can install and use an operating system. The only limitation to virtualization is your hardware as each virtual machine uses CPU and RAM. Depending upon the amount of CPU and RAM in your computer, you may find that the operating system you install using virtualization software runs slowly. If your computer slows down greatly, try closing other applications running on your computer to free up some RAM.

PC-BSD provides a PBI for VirtualBox, an open source virtualization program originally created by Sun Microsystems. VirtualBox also runs on Windows, Linux, Macintosh, and OpenSolaris and supports a large number of operating systems that can be installed into a virtual machine.

If your computer is already running a version of PC-BSD, you can use AppCafe™ to install VirtualBox. If your computer is running another operating system, download the binary for your operating system from the VirtualBox Downloads page.

On a PC-BSD 9.0 system you can install the VirtualBox Guest Additions from Control Panel -> System Manager -> System Components -> Misc. The guest additions add mouse pointer integration, shared folders between the host and guest, better video support, and a shared clipboard. To use the improved video support, select vboxvideo in Control Panel -> Display.

2.9.1Creating a Virtual Machine

Once installed, start VirtualBox to see the screen shown in Figure 2.9a:

Figure 2.9a: Initial VirtualBox Screen

Before you can install an operating system, you need to create a virtual machine. To do so, click the New button to start the new virtual machine wizard. Click the Next button to see the screen in Figure 2.9b:

Figure 2.9b: Type in a Name and Select the Operating System for the New Virtual Machine

Enter a name for your virtual machine, which can be anything that makes sense to you. Click the Operating System drop-down menu and select BSD which will automatically change the Version menu to FreeBSD. Click Next to see the screen in Figure 2.9c:

Figure 2.9c: Select the Amount of Memory Reserved for the Virtual Machine

The base memory size should be changed to at least 512 MB. If your system has a lot of RAM, you should probably assign more memory to your virtual machine. Any number within the green area is considered a safe value by VirtualBox, meaning it should not slow down your computer too much. When finished, click Next to see the screen in Figure 2.9d:

Figure 2.9d: Select Whether to Use an Existing or Create a New Virtual Disk

This screen is used to create the virtual hard disk--in other words, the amount of disk space that will be available to the virtual machine. If this is your first virtual machine, keep the default of "Create new hard disk" and click Next. If you have created a virtual machine in the past and wish to reuse its disk space, select "Use existing hard disk" and select it from the drop-down menu. You can create as many virtual machines as you wish. However, if your computer is getting low in disk space, you should consider reusing existing virtual hard disks to prevent your hard drive from being used up by old virtual machines.

If you choose to create a new hard disk, the "Create New Virtual Disk Wizard" will launch when you click Next. Click the Next button to see the screen in Figure 2.9e:

Figure 2.9e: Select the Storage Type for the Virtual Disk

You can now choose whether you want "Dynamically expanding storage" or "Fixed-size storage". The first option uses disk space as needed until it reaches the maximum size that you will set in the next screen. The second option creates a disk the same size as that specified amount of disk space, whether it's used or not. Choose the first option if you are worried about disk space; otherwise choose the second option as it allows VirtualBox to run slightly faster. Once you select Next, you'll see the screen in Figure 2.9f:

Figure 2.9f: Select the File Name and Size of the Virtual Disk

This screen is used to set the size (or upper limit) of the virtual machine. If you plan to install PC-BSD into the virtual machine, increase the size to at least 8 GB or you will receive an error during the PC-BSD installation. If you plan to install KDE, GNOME, multiple desktop managers, or PBIs within the virtual machine, you will probably want to choose at least 20 - 30GB. Whatever size you set, make sure that your computer has enough free disk space to support it. Use the folder icon to browse to a directory on disk with sufficient space to hold your virtual machine.

Once you make your selection and press Next, you will see a summary of your choices. You can use the Back button to return to a previous screen if you wish to change any values. Otherwise, click Finish to finish using the wizard. Your virtual machine should now show up in the left box, as seen in the example in Figure 2.9g:

Figure 2.9g: The New Virtual Machine

2.9.2Configuring the Storage Device

Before starting your virtual machine, you will want to configure it to use your installation media. Click the Storage hyperlink in the right frame to access the storage screen seen in Figure 2.9h:

Figure 2.9h: The Storage Settings of the Virtual Machine

Double-click the word Empty, which represents your DVD reader. If you wish to access the PC-BSD installer from your DVD reader, double-check that the Slot is pointing to the correct location (e.g. IDE Secondary Master) and use the drop-down menu to change it if the location is incorrect. Click the CD/DVD Device drop-down menu to change it from empty to the Host Drive value.

If you prefer to use an ISO that is stored on your hard disk, click the DVD icon -> "Choose a virtual CD/DVD disk file" to open a browser menu where you can navigate to the location of the ISO. Highlight the desired ISO and click Open. The name of the ISO will now appear in the Storage Tree section.

NOTE: the selected ISO/DVD can be 32-bit, even if you are using VirtualBox on a 64-bit system. Depending upon the extensions available in your CPU, you may or may not be able to run a 64-bit ISO on a 64-bit system. If you receive the error "your CPU does not support long mode" when you try to boot a 64-bit ISO, your CPU either does not have the required extension or AMD-V/VT-x is disabled in the system BIOS.

2.9.3Configuring the Network Adapter

If you wish to use your network card or perform a network installation of PC-BSD, you will need to configure bridging on your virtual machine. To do this, go to Settings -> Network. In the Attached to drop-down menu select Bridged Adapter and select the name of the physical interface from the Name drop-down menu. In the example shown in Figure 2.9i, the Intel Pro/1000 Ethernet card is attached to the network and has a device name of re0.

Figure 2.9i: Configuring a Bridged Adapter in VirtualBox

You are now ready to install PC-BSD into your virtual machine. Simply highlight the virtual machine and click on the green Start icon. A window will open indicating that the virtual machine is starting. If you have a DVD inserted, you should hear it spin and it should start to boot into the installation program. If it doesn't or if you're using an ISO stored on the hard disk, press F12 to select the boot device when you see the message to do so, then press "c" to boot from CD-ROM. You can then proceed through the installation as described in section 3 Installing PC-BSD.

NOTE: The virtual machine will "capture" your mouse pointer. Use your right Ctrl button if you wish to leave the virtual machine and use your mouse to interact with other applications on your computer. To go back to the virtual machine, simply click anywhere inside the virtual machine and VirtualBox will re-capture your mouse pointer.

2.9.4Troubleshooting VirtualBox

While using a virtual environment allows you to test an operating system without affecting what else is currently installed on the system, there are some tips to be aware of when using VirtualBox.

If the installer program fails to load, try increasing the amount of RAM in the virtual machine. The bare minimum is 512 MB, but increasing this value to 1024 or higher will sometimes allow an unbootable ISO to boot into the installer.

If the installation fails and you would like to review the installation log, right-click the virtual machine window and select xterm from the menu. You can now type more /tmp/pc-sysinstall.log to review the log.

Ctrl-f (right ctrl key only) will toggle the virtual machine window in and out of full-screen mode.

The FreeBSD VirtualBox wiki contains additional information that may assist you in troubleshooting VirtualBox issues.

3Installing PC-BSD

PC-BSD can be installed from the installation media directly onto a hard drive or into a virtual machine using virtualization software such as Virtualbox. You can also try PC-BSD without installing it by using a Live DVD or USB version.

The installation of PC-BSD is a fast, easy and straight-forward process. The graphical installer will take you step-by-step through the whole process by asking a few simple questions. Within a short period of time, your PC-BSD system will be installed, configured, and ready to use.

This section will walk you through a default install which will be suitable for most users. Users who wish to go beyond a default installation will also want to read section 4 Advanced Installation Topics.

3.1Starting the PC-BSD Installation

To begin the PC-BSD installation, insert the boot media. Boot the system and the installation should begin. If the computer instead boots into an existing operating system, reboot and check your computer's BIOS program to ensure that the drive containing the installation media is listed first in the boot order. Save your BIOS changes and reboot.

After a couple of seconds, a series of lines of code will scroll down the screen, meaning that PC-BSD is being loaded. Soon after, you should see a screen similar to Figure 3.1a:

Figure 3.1a: PC-BSD Installer Boot Menu

There are 7 options to choose from:

1. Boot [default]: starts the installation program with all standard options enabled. This is the default if you don't select anything else within 10 seconds.

2. Boot with ACPI enabled: this enables power management, which may be useful for certain BIOS's and laptops.

3. Boot in Safe Mode: select this option if the installation still hangs when probing your hardware and option #2 did not help. It will boot with a forced PIO mode (disabling the use of DMA), disable write caching for all IDE hard drives and CD ROM drives, disable the probing of EISA slots (as very few systems have them), and (on i386 systems) disables the use of ACPI and APICs.

4. Boot with verbose logging: select this option if you would like to see more detailed messages during the boot process. This can be useful if you are troubleshooting which piece of hardware is causing the installation to hang.

5. Boot to emergency console: advanced users can use this option to fix critical system failures.

6. Boot with X in VESA mode: if the installation program is unable to load your video driver, restart the computer and select this option. The installer will default to VESA mode which should work on any system with a video card.

7. Escape to loader prompt: advanced users can select this option to perform advanced operations, such as changing kernels or loading kernel modules.

3.2Welcome & Language Selection Screen

The next screen, seen in Figure 3.2a, indicates that the installer successfully loaded and is ready to present you with its options:

Figure 3.2a: Welcome and Language Selection Screen

The installer is divided into three logical areas:

- The left panel which lists the screens the installer will step through. The current step is highlighted in red text.

- The main area in the centre where the installer expects user input.

- The bottom navigation area where you can read that screen's Help text, use the onscreen keyboard, switch between the US keyboard layout and a user selected layout , navigate to a previous or upcoming screen, or abort the installation.

NOTE: if you select an alternate keyboard layout in the next screen, you can use the "Switch between US layout and user selected layout" button from any installation screen to toggle between your selected layout and the default US layout.

This screen allows you to select your language. PC-BSD's menus have been translated to several different languages and you can see the status of your native language at the PC-BSD Translation Site. If your language does not show 100% translation at this website, it means that not all of the menus have been translated yet and that the untranslated menus will instead display in English. You are welcome to join the PC-BSD Translators Mailing List if you would like to assist in translating menus to your native language.

By default, PC-BSD menus will display in English, unless you select another language in the drop-down menu in this screen.

This screen also allows you to set your time zone so that your PC-BSD system will automatically update its clock for events such as daylight savings time. If you wish to keep your clock in sync with an Internet time server, leave the NTP box checked. If you aren't running any time-sensitive applications and don't with to connect to an Internet time server, you can uncheck this box.

When you are finished, click Next to go to the next installation screen.

3.3Keyboard Setup Screen

The next screen, seen in Figure 3.3a, allows you to change your keyboard model, keyboard layout, and preferred variant. If English is your native language and you are using a basic English keyboard, you can just press Next to accept the defaults.

Otherwise, use the menus to change the default selection(s) to match your keyboard type and language. You can test your changes by typing into the white area at the bottom of the screen, just below the message that indicates you can test your selected settings.

Figure 3.3a: Keyboard Screen Allows you to Select your Keyboard Model, Layout, and Variant

3.4Installation Type Screen

The Installation Type screen is shown in Figure 3.4a.

Figure 3.4a: Installation Type Screen Allows you to Select the Type of Installation

This screen is divided into two sections which allow you to decide:

1. between installing a PC-BSD desktop (the default) or a FreeBSD server. If you wish to install FreeBSD, see section 4.1 Use PC-BSD Installer to Install FreeBSD.

2. whether the installer will copy the files it needs from the CD/DVD/USB image you booted from or from a location over the network. If you are installing from a boot-only image, the installation will fail unless you select the Network/Internet option as the boot-only install needs to access files on the Internet to complete the installation. See section 4.2 Install PC-BSD Over a Network for a demonstration on how to perform the installation over a network.

The default is to install PC-BSD from the boot media.

3.5Disk Setup Screen

The next screen, seen in Figure 3.5a, is used to determine which hard drive and partition to install PC-BSD into.

Figure 3.5a: Disk Setup Screen Allows you to Select Which Disk to Install PC-BSD Into

NOTE: If you are installing PC-BSD as the only operating system on your computer, simply check the "Use Entire Disk" checkbox then click Next to continue. However, if this is not your intent, you will need to review the sections 4.5 Dual Booting and 4.3 Using a Custom Partition Layout.

If your computer contains multiple hard drives, use the drop-down menu at the top of the screen to select the drive you wish to install into.

The middle section of this menu will show all of the disks and partitions that the installer recognizes. If you check the "Use Entire Disk" box, it will format the selected hard drive. If the computer contains multiple hard drives, it is important to select the drive that you wish to install onto.

If the hard drive has been divided into partitions, carefully review the listed partitions and highlight the partition you wish to install into. If you wish to install into the highlighted partition, DO NOT check the "Use Entire Disk" box or it will format the entire disk. Note that the installer will only recognize primary partitions as candidates for installing into.

The "Additional Options" section allows you to decide whether the selected drive or partition will be formatted with UFS or ZFS. If you select UFS, it will be formatted using softupdates. If you select ZFS, a small UFS formatted /boot partition will be created as well as a swap partition. The rest of the disk will be formatted with ZFS and will contain /, /var, and /usr.

This section also contains the following checkboxes:

Encrypt user data: if you wish the /usr partition to be encrypted, check this box after reading section 4.4 Disk Encryption.

Partition disk with GPT: this box needs to be checked if your hard drive is greater than 2 TB in size. You can learn more about this option in section 4.3 Using a Custom Partition Layout.

3.6User Creation Screen

The next screen, seen in Figure 3.6a, requires you to set the administrative password and to create at least one user account.

Figure 3.6a: User Creation Screen Allows you to Set Administrative Password and Create User Accounts

The system password, also known as the root, superuser, or administrative password, is required for system administration tasks such as installing server software, setting up your printer, or changing settings that affect all users. You will need to remember this password for the times that you are prompted for it. The password must be a minimum of 4 characters and you are required to type it in twice to confirm the password.

For security reasons, PC-BSD will not let you login as the root user; instead it will prompt you for the administrative password whenever it is needed to perform a system task. This means that you need to create a user account that you will use to login to your system. If you share your computer with other users, you should create an account for each user. That way, each user will have their own home directory where they can store their files and not interfere with the files created by other users.

To create a user, complete the following fields:

- Username: you need to remember this name as it is used to log in. It is case-sensitive, meaning you have to remember if you use any capitalization. It cannot contain any spaces.

- Full name: this name can contain spaces and is used as a description to help you remember who uses this user account.

- Password: you will need to type this in twice and it must be a minimum of 4 characters. If you or another user forget their password, see section 7.4 User Manager to learn how to reset the password.

- Shell: can be left as-is. This option is used by advanced users to choose their default shell when using a command prompt.

When you have filled in the information for the new user, click the +Add button and the user account should appear in the "User Accounts" field underneath. You can click a user name at any time and modify its details. If you need to modify a user's settings, highlight their entry, make your changes and click the Save Changes button. If you wish to delete a user, highlight their entry and click the -Remove button to prevent the user account from being created by the installation.

By default, PC-BSD will create a hostname for your computer. If you prefer to set the hostname yourself, click the "System Options" tab, shown in Figure 3.6b. Check the "Custom System Hostname" box, then input the name you wish to use. The hostname can not contain any spaces and must be unique on your network.

Figure 3.6b: System Options Tab

Click the Next button when you are finished.

3.7Meta Package Selection Screen

The Meta Package selection screen, shown in Figure 3.7a, allows you to choose which system components and window managers to install with PC-BSD. If you change your mind after installation, you can install or uninstall components using Control Panel -> System Manager -> System Packages.

Figure 3.7a: Meta Package Selection Screen

The following components are available for installation. If you right-click a component and select View Packages, a pop-up menu will list the packages that are installed with that component.

- Base-l18N: input methods (ibus), fonts, and codecs to support Japanese, Korean, and Chinese users.

- Desktops: includes the following supported desktops: GNOME2, KDE4, LXDE, and XFCE4. If you expand the + next to a desktop, you can select which components to install with that desktop. You can select as many desktops and components as you wish to install.

- Development: software utilities suited for developers. These include the valgrind debugging tool, QT development tools, CMake, GNU make, Subversion, and git.

- Hardware-Drivers: if you expand the + you can select which drivers to install: HPLIP (for HP printers), Handheld (for syncing with WinCE devices), and NVIDIA video.

- Misc: if you expand the + you can select from the following: Compiz, the MythTV DVR, VMwareGuest, VirtualBox Guest additions, and the XBMC media center.

- Services: if you expand the + you can select from the following: the MySQL and PostgreSQL database servers, the Samba file server, and the Apache and lighthttpd web servers with PHP.

- Unsupported-Desktops: additional light-weight desktops for expert users. If you expand the + you can select from Awesome, FVWM, IceWM, Openbox, ScrotWM, or Window Maker.

NOTE: Fluxbox is always installed and available in the login menu of a PC-BSD system.

If you check the box of a component that has a + next to it, it will automatically select all of its sub-components. You can click the + to expand and uncheck any sub-components that you do not wish to install.

You will need to choose at least one desktop or you will receive an error when you try to go to the next screen. You can select multiple desktops if you wish to try them out.

Once you have made your selection(s), click the Next button to proceed to the next screen.

3.8Sources Selection Screen

The Sources Selection screen, seen in Figure 3.8a, allows advanced users to install FreeBSD source or the FreeBSD ports collection. These can also be installed after installation using the "System Tasks - Advanced Users" section of Control Panel -> System Manager -> Tasks.

Figure 3.8a: Sources Selection Screen

Highlight the FreeBSD component that you would like to install in the "Available" box and click the blue > button to add it to the "Selected" box. If you change your mind, highlight the item in the "Selected" box and click the blue < button. Whatever shows up in the "Selected" box when you click the Next button, will be installed for you.

3.9Pre-Install Summary Screen

This screen, seen in Figure 3.9a, provides a summary of all of the options you selected in the previous screens.

Figure 3.9a: Pre-Install Summary Screen Allows you to Review your Selected Installation Options

You should review this information to make sure it is correct. If you would like to change anything, use the Back button to navigate to the option(s) you would like to change. When finished, click the Next button. A popup message will ask if you want to start the installation. If you are ready, click the Yes button.

NOTE: this is your very last chance to make sure that you are ready. Once you click Yes, the selected hard drive or partition will be formatted and any data it contains will be lost.

3.10Installation Progress Screen

This screen, seen in Figure 3.10a, uses a progress bar and messages so that you can watch the installation's progress.

Figure 3.10a: The Installation Progress Screen Allows you to View the Status of the Installation

How long the installation takes depends upon the speed of your hardware, the installation type you selected, and the number of components to be installed. A typical installation takes between 20 and 40 minutes.

3.11Installation Finished Screen

The screen shown in Figure 3.11a appears once the installation is complete.

Figure 3.11a: PC-BSD Installation is Now Complete

You can now remove your installation media and click the Finish button to boot into your PC-BSD installation.

3.12Post Installation

After installation, PC-BSD will reboot and you will be prompted to configure your display settings and to login to a desktop.

3.12.1 PC-BSD Graphical Boot Loader

Assuming the installation media has been removed, you should see the screen shown in Figure 3.12a when you reboot:

Figure 3.12a: PC-BSD Boot Screen

If you press any key, this screen will pause, allowing you to read and select the desired options. Otherwise, it will pause for a few seconds then continue to load PC-BSD with the default options.

There are 6 boot options and 4 actions to choose from:

1 Disable ACPI: ACPI controls power management but may be problematic on some hardware. Select this option if you are unable to boot into PC-BSD.

2 Enable Safe Mode: select this option if the installation hangs when probing your hardware. It will boot with a forced PIO mode (disabling the use of DMA), disable write caching for all IDE hard drives and CD ROM drives, disable the probing of EISA slots (as very few systems have them), and (on i386 systems) disable the use of ACPI and APICs.

3 Enter single user mode: advanced users can use this option to fix critical system failures.

4 Enable verbose logging: select this option if you would like to see more detailed messages during the boot process. This can be useful if you are troubleshooting a piece of hardware.

5 Run X in VESA mode: select this option if PC-BSD is unable to load your video driver. PC-BSD will default to VESA mode which should work on any system with a video card.

6 Run the Display Wizard: if you are unable to access the GUI due to a display setting, enable this option to boot into the display settings wizard.

Press the number of an option to select that option. As you make a selection, the FreeBSD bobble-head icon will be filled in, indicating that that option has been selected. To de-select an option, press its number again. Once you have made your selection(s), you can choose from the following actions:

B Boot PC-BSD with above options: starts PC-BSD with the selected options enabled.

D Restore default options: clears your selections.

L Escape to loader prompt: advanced users can select this option to perform advanced operations, such as changing kernels or loading kernel modules. This prompt provides a limited set of commands which are described here.

R Reboot: reboots the computer.

3.12.1.1Creating a Custom Boot Theme

If you would like to change the image in the graphical boot loader, create a PCX image file. It is important that the file is saved in .pcx format as that is the only image format that the boot loader understands. Additionally, the image must be 640 x 480 pixels and 16 colors. The RGB colors that will be available in the menu text will be taken from the image's palette.

The default PC-BSD graphical boot theme is found in /boot/themes/default/. To create your own theme, create a new directory in /boot/themes/ (e.g. mkdir /boot/themes/mytheme) and copy your PCX file to that new subdirectory.

Next, copy /boot/themes/default/theme.conf to your new subdirectory. Open the copied file and edit this line to point to the location of your PCX file:

theme_background="/boot/themes/default/bglogo.pcx"

You can change the theme's colors by editing the RGB values in this file. You can also change the font by modifying the theme_font path to point to the font to use. Finally, you can change the location of the list of options and the actions menu. These are defined with the *_xy settings in the configuration file. The value must be two numbers which specify the X and Y coordinates in pixels, relative to the upper left corner.

To enable your theme, modify this line in /boot/loader.conf to point to the location of your theme.conf file:

beastie_theme="/boot/themes/default/theme.conf"

3.12.2Configuring Display Settings

Once PC-BSD has finished booting for the first time, you will see the Display Settings screen shown in Figure 3.12b.

Figure 3.12b: Display Settings Wizard

Here you can select your desired screen resolution, color depth, and video driver. By default, PC-BSD should list the name of your video card. However, it will select the "vesa" driver which should always work but will provide sub-optimal performance. Click on the drop-down menu and change "vesa" to the driver that most closely matches your video card's name.

NOTE: until DRI/GEM/KMS is fully supported in PC-BSD, certain video drivers will not take full advantage of the hardware feature set. This typically affects 3d effects on ATI and Radeon cards. If the screen goes blank or otherwise doesn't work when you select the HD version of the driver, selecting the non-HD version should allow you to use the card.

You can also use the drop-down menus to change the screen resolution and color depth values. If the value you desire is not listed, it may be that the selected driver does not support that resolution or depth.

Advanced users can select their monitor's horizontal sync and vertical refresh rate in the Advanced tab, seen in Figure 3.12c:

Figure 3.12c: Advanced Tab of Display Settings

Use caution and refer to your monitor's documentation if you make any changes here. If you're not sure what you're doing, leave the default values as-is.

If your computer is connected to two monitors, check the box "Enable Dual-Head support".

When you are finished, click the "Apply" button for your settings to be saved and tested. If anything goes wrong during testing, you should be taken back to the Display Settings screen so that you can try another setting. Once you are happy with the tested setting, click the Yes button to save the setting and to proceed to the login screen.

NOTE: if you wish to return to the display wizard at a later time, go to Control Panel -> Display.

3.12.3 Logging In

Once you have finished configuring your display settings, you will be presented with the login screen seen in Figure 3.12d:

Figure 3.12d: PC-BSD Login Screen

Any user accounts that you created during installation will be listed. If you click the Universal Access button in the task bar (round icon with a stick figure), you can set the accessibility options shown in Figure 3.12e:

Figure 3.12e: Universal Access Preferences

If you installed PC-BSD on a laptop, the taskbar will also show the current battery charge level when you hover your mouse over the power icon. The taskbar includes a clock followed by a Shutdown Options icon. If you click that icon, you can choose to restart or shutdown the system.

If you highlight a user account, some more options will be added to the left side of the taskbar as shown in Figure 3.12f:

Figure 3.12f: Login Menu with User Selected

These options allow you to select your language, keyboard layout, and desktop to use for the login session. Once you have made your selections, input the password associated with the selected user and press enter.

NOTE: PC-BSD will not let you login as the root user account for security reasons. If you just get the login prompt after typing the password, the password was incorrect. Double-check that caplocks is not on and try typing the password again.

If you wish to add or delete any desktops, use the System Packages tab of Control Panel -> System Manager.

3.12.4 Auto-login

For security reasons, PC-BSD defaults to a login screen. If you are the only user on the PC-BSD computer, always use the same window manager, and don't consider it a security risk for the system to automatically boot into that window manager, you can enable auto-login as follows.

Become the superuser and edit the file /usr/local/etc/gdm/custom.conf. Add the following 2 lines to the [daemon] section, substituting the name of your user account for username:

[daemon]

AutomaticLoginEnable=true

AutomaticLogin=username

The next time you boot into PC-BSD, it will automatically login as the user you specified.

If you wish to test your changes before a reboot, close all of your applications as the following command will end your X session and should automatically log you back into the same desktop. You need to be the superuser in order to run this command:

/usr/local/etc/rc.d/gdm restart

3.12.5Welcome & Getting Started

The first time you log in, the PC-BSD Getting Started screen will load as seen in Figure 3.12g.

Figure 3.12g: PC-BSD Getting Started Screen

If you click the Next button, you can read an overview of the utilities that are used to configure your network connection, install applications, configure your system, make a backup, and keep the system updated, as well as how to get involved with the PC-BSD community. Check the box “Don't show this greeting on next startup” if you do not want to see this screen the next time you log in. To re-open the screen after checking that box, type pc-welcome.

3.13Installation Troubleshooting

Installing PC-BSD is usually an easy process that "just works". However, sometimes you will run into a problem. This section will look at solutions to the most common installation problems.

3.13.1Network Installation Fails

When installing over the network, the PC-BSD installer will try to configure any Ethernet interfaces using DHCP. Occasionally it will fail to get an IP address and will be unable to connect to the FTP mirror to get the files needed by the installer. You will know this is the case when the mirror list shown in Figure 4.2b remains greyed out.

You can manually retry getting an IP address from the terminal. To access a terminal, right-click an area on the desktop outside of the installation window and select xterm from the menu. Type ifconfig in the terminal to find out the FreeBSD names for your interfaces. You are looking for an Ethernet entry that shows a status of active. In the example shown in Figure 3.13a, the interface em0 is active but does not have an IP address.

Figure 3.13a: Using ifconfig to Determine IP Address

Once you know the name of the interface, use it with the dhclient command as seen in Example 3.13a.

Example 3.13a: Using dhclient to Obtain an IP Address

dhclient em0

DHCPREQUEST on em0 to 255.255.255.255 port 67

DHCPACK from 192.168.2.1

bound to 192.168.2.10 -- renewal in 43200 seconds.

If you can obtain an IP address, you should be able to select a mirror to install from and continue with the installation.

3.13.2 Installation Fails

The PC-BSD installer creates a log which keeps a record of all the steps that completed as well as any errors. Should the installation fail, you can access this log to see what went wrong. To access a terminal, right-click an area on the desktop outside of the installation window and select xterm from the menu. You can read the log with this command:

more /tmp/pc-sysinstall.log

If you can't figure out how to fix the error or believe that you have discovered an installation bug, send this log to the Support mailing list. When an installation error occurs, the PC-BSD installer will ask if you would like to generate an error report. If you click Yes, a pop-up message will ask if you would like to save the error log to a USB stick. Type y and insert a FAT formatted USB thumb drive to copy the log.

3.13.3System Doesn't Boot

If the installer doesn't make it to the installer boot screen, seen in Figure 3.13b, try unplugging as many devices as possible, such as webcams, scanners, printers, USB mice and keyboards. If this solves the problem, plug in one piece of hardware at a time, then reboot. This will help you pinpoint which device is causing the problem.

Figure 3.13b PC-BSD Welcome Screen

If your computer freezes after the installation boot menu (while probing hardware) and unplugging extra devices did not fix the problem, it is possible that the installation media is corrupt. If the MD5 on the file you downloaded is correct, try reburning the file at a lower speed.

If the system freezes after the PC-BSD boot screen loads and you suspect that the video card is causing the system to freeze, review your system's BIOS settings. If there is a setting for video memory, set it to its highest value. Also check to see if the BIOS is set to prefer built-in graphics or a non-existent graphics card. On some systems this is determined by the order of the devices listed; in this case, make sure that the preferred device is listed first. If you cannot see your BIOS settings you may need to move a jumper or remove a battery to make it revert to the default of built-in graphics; check your manual or contact your manufacturer for details.

If that change did not help, try rebooting and selecting option "7. Escape to loader prompt" from the boot menu. This will open the boot loader prompt where you can type the following commands:

unload

disable-module vesa

set module_path=/boot/kernel;/boot/modules;CONSOLE

boot

That will disable the vesa splash screen and boot the system to an emergency console. From there you can try vesa mode, or drop to a shell and modify /etc/X11/xorg.conf to change your display settings.

A not uncommon cause for problems is the LBA (Logical Block Addressing) setting in the BIOS. If your PC is not booting up before or after installation, check your BIOS and turn LBA off (don't leave it on automatic).

If the SATA settings in your BIOS are set to "compatibility" mode, try changing this setting to "AHCI".

3.13.4 Getting Help

If none of the above has fixed your problem, search the PC-BSD forums to see if a solution exists, try a Google search, or check section 9 Finding Help.

4Advanced Installation Topics

The previous section discussed a default installation of PC-BSD. This section covers the following advanced installation topics:

- Using the PC-BSD Installer to Install FreeBSD

- Install PC-BSD Over a Network

- Using a Custom Partition Layout

- Disk Encryption

- Dual Booting

- Upgrading PC-BSD

- Creating an Automated Installation with pc-sysinstall

4.1Using the PC-BSD Installer to Install FreeBSD

The Installation Type screen of the PC-BSD installer, seen in Figure 4.1a, allows you to install FreeBSD from either the boot media or a network connection:

Figure 4.1a: Using the PC-BSD Installer to Install FreeBSD

The PC-BSD installer supports ZFS and encryption, options which currently aren't available in FreeBSD's installer.

Once you select FreeBSD, the installer will go through the Disk Setup and User Creation screens as usual, then skip to the Pre-install Summary screen.

The FreeBSD install itself is very quick, taking only a few minutes. Once the installation is complete, you will be prompted to click Finish and to remove the installation media. The system will then boot to a FreeBSD login where you can log into a FreeBSD command prompt. If you wish to do any post-configuration, type sysinstall as the superuser.

Additional Resources:

FreeBSD Handbook

4.2Install PC-BSD Over a Network

If you are installing PC-BSD from a boot-only media, you will need an Internet connection to finish the install. If you are installing PC-BSD into VirtualBox, make sure that the virtual network adapter has been configured as described in section 2.9.3.

When you get to the Installation Type screen of the installation, shown in Figure 4.2a, select Network/Internet to expand the networking configuration options.

Figure 4.2a: Preparing the System for a Network Install

If you receive your IPv4/IPv6 address from a DHCP server, leave the Network Interface setting at AUTO-DHCP-SLAAC and click the Next button. Otherwise, click AUTO-DHCP-SLAAC to select AUTO-DHCP (IPv4 only), IPv6 SLAAC (IPv6 only), or the network interface that you wish to manually configure from the drop-down menu. If you select a network interface, input the values for your network in the IP address, Netmask, Nameserver, and Gateway fields. You can also manually configure the IPv6 information for the specified interface.

Once you click Next, the installer will attempt to use the network; if the connection is successful, you will see a pop-up screen similar to Figure 4.2b:

Figure 4.2b: Choosing an Installation Mirror

NOTE: if this screen remains greyed out, it means the installer was unable to connect to the network. Follow the instructions in section 3.13.1 Network Installation Fails and try again.

Once the network connection is active, you can click the drop-down mirrors menu to select a mirror close to your geographic region, then click the Select button to proceed with the installation as usual.

If your company has created a custom installation of PC-BSD that you wish to install from, select "Install from specified server" and input the IP address of the server hosting the installation files and the path to those files. The server can provide the installation files through either FTP or HTTP.

4.3Using a Custom Partition Layout

This section describes how to customize the default UFS and ZFS partitions. Also refer to section 4.5 Dual Booting if you plan to install PC-BSD onto a computer with multiple operating systems.

4.3.1Customizing a UFS Partition

During the Disk Setup screen of installation, advanced users have the flexibility of selecting the filesystem and manually configuring the filesystem size and mount points. This is optional as the default disk partitioning scheme should work just fine. However, if you are already familiar with the feature differences between various filesystems or would like to try out different filesystems, this section is for you.

NOTE: For the UFS filesystem, PC-BSD uses the same disk terminology as FreeBSD, which is different than the terminology used by Windows or Linux. In FreeBSD, the portion of the disk used by the operating system is called a "slice". That slice is then divided into partitions, with each partition containing a filesystem and a mount point.

Figure 4.3a shows the Disk Setup screen of the installation with the "Advanced Mode" tab then the "Use default layout" button selected. In this example, an 8GB disk has four partitions with mount points for /, swap, /var, and /usr.

DANGER: if you plan to dual boot PC-BSD with another operating system DO NOT use the "Use default layout" button in the Advanced Mode tab as it will instead layout the entire disk. If you wish to customize the layout of a specific partition, highlight that partition in Basic Mode and use the "Add" button in Advanced Mode to customize its layout.

Figure 4.3a: Viewing the Default Layout for UFS

Using the default layout button allows you to view the default disk layout so that you can decide if you wish to keep or edit the default values. The actual sizes of the partitions created by the default layout will vary, depending upon the size of the disk, but always follow this logic:

- the default size of / (root) will be 2 GB; this partition holds the root user's home directory as well as the files needed by the operating system. You should not use a size less than 1 GB. Do not store large files in the root user's home directory as the root partition is meant to be reserved for the operating system files.

- the default size of the swap partition will be RAM (physical memory) size times 2 up to a maximum of 4GB. You can increase this if you want a larger swap partition (also known as a paging file or virtual memory in Windows), though this isn't really necessary as PC-BSD has a built-in daemon which monitors swap usage and will automatically add more as it is needed.

NOTE: if your hardware uses a solid state drive instead of a hard drive (e.g. an Asus Eee Netbook), do not create a swap partition as swap will shorten the life of the solid state drive.

- the default size of /var will be 2 GB. This partition holds data that varies such as logs, printer queues, and the FreeBSD packages database. You can safely increase the size of this partition, though this is usually not needed on a desktop system.

- the rest of the disk space will go to /usr. This partition holds everything else, such as users' home directories and installed applications.

If you decide to change the default partitions, keep the following points in mind:

- you must have a / partition to hold the operating system; make sure it is at least 1 GB in size.

- unless your system has a solid state drive, you want a swap partition.

- you can have one big root partition (plus a swap partition); if you decide to do this, the installation will create /var and /usr directories as they are needed by applications. This is often discouraged on server systems, but is an option on desktop systems.

- you can remove /usr and divide the newly created free space into multiple partitions. For example, some users like to create separate partitions to hold their video files, artwork, work files, etc. When creating multiple partitions, use names that makes sense to you (e.g. /usr1, /usr2 or /video, /work) and set sizes that makes sense for the amount of content each partition will hold. If you decide to take this approach, you should still make a good sized /usr (otherwise it will be placed on root which will quickly fill up the / partition). The size of /usr should be sufficient to store any software you install.

Why do some users create multiple partitions or discourage the use of one big partition? The usual answer deals with backups (some people prefer to backup specified, smaller filesystems rather than specified directories) or filesystem corruption (if you lose a filesystem, you haven't lost everything). Since there are many ways to perform backups and it is rare to corrupt a filesystem beyond repair, it often becomes a matter of personal preference.

4.3.1.1Changing the Defaults

If you wish to change the sizes of the partitions shown in the default layout, you will need to delete the existing ones first to create free space to work with. Alternately, if you wish to divide /usr into multiple partitions, delete /usr, then add your partitions using the instructions in this section.

If you click the +Add button to create a partition or highlight an existing partition and click its /Edit button, you will see a screen similar to Figure 4.3b:

Figure 4.3b: Selecting the Filesystem Type

The PC-BSD installer allows you to choose from the following filesystem types:

- UFS: the Unix File System is the original filesystem used by BSD systems.

- UFS+S: the S adds soft updates to UFS. This means that the computer will boot faster after a crash as it does not have to wait to check that no data was lost during the crash.

UFS+SUJ: The SUJ adds a light version of journaling to soft updates as described in this technical paper. This is the default filesystem type.

- UFS+J: the J adds journaling to UFS, another approach to speeding up boot time after a system crash. This technical paper compares soft updates to journaling.

- ZFS: this filesystem was originally developed by Sun and adds many features. You can learn more about ZFS at Wikipedia and the FreeBSD Handbook.

- swap: choose this filesystem if you are creating a swap partition.

When creating or editing a partition:

- select a filesystem type from the drop-down menu

- type in a mount point (e.g. /, /usr, /var, /swap, /movies, etc.)

- set the size by either moving the slider, typing in a value, or using the up/down arrows. Note that this won't work if there isn't any remaining free space; if this is the case, delete a partition and try again.

- check the "Enable Encryption" box if you wish to do so. See section 4.4 Disk Encryption for more information on this topic.

Once you have reviewed your partitions, you need to determine whether or not to check the box at the bottom of the screen:

Partition disks with GPT: GPT is a partition table layout that supports larger partition sizes than the traditional MBR layout. If any of your partitions are larger than 2 TB, this box must be checked. If your computer BIOS supports EFI (most modern systems do), you can also check this box. The only time you should not check this box is on a system with an older motherboard--if it does not understand GPT, the installation will fail and you'll have to try again with the box unchecked. If you're unsure, leave the box unchecked. If you plan to mount your PC-BSD UFS partition using Linux, do not select GPT.

When you are finished with your selections, press Next to continue the installation.

4.3.2ZFS

ZFS is a combined file system and logical volume manager originally designed by Sun Microsystems. It was ported to FreeBSD and has been part of the operating system since FreeBSD 7.0. At this time, the PC-BSD installer allows you to create a new ZFS pool.

PC-BSD 9.1 will provide the ability to import existing ZFS pools during installation. PC-BSD 9.1 will also provide a graphical utility to manage ZFS properties such as quotas and compression and to manage ZFS snapshots and clones. At this time, these functions need to be configured at the command line after installation.

ZFS provides many features including: support for high storage capacities, snapshots and copy-on-write clones, continuous integrity checking and automatic repair, RAIDZ which was designed to overcome the limitations of hardware RAID5, and native NFSv4 ACLs.

If you are new to ZFS, the Wikipedia entry on ZFS provides an excellent starting point to learn about its features. These resources are also useful to bookmark and refer to as needed:

- Evil Tuning Guide

- FreeBSD ZFS Tuning Guide

- ZFS Best Practices Guide

- ZFS Administration Guide

- Becoming a ZFS Ninja (video)

The following is a glossary of terms used by ZFS:

Pool: the entire storage capacity managed by ZFS. This pooled storage model eliminates the concept of volumes and the associated problems of partitions, provisioning, wasted bandwidth and stranded storage. Thousands of file systems can draw from a common storage pool, each one consuming only as much space as it actually needs. The combined I/O bandwidth of all devices in the pool is available to all file systems at all times. The Storage Pools Recommendations of the ZFS Best Practices Guide provides detailed recommendations for creating the storage pool.

Mirror: a form of RAID where all data is mirrored onto two disks, creating a redundant copy should one disk fail.

RAIDZ: ZFS software solution that is equivalent to RAID5 in that it allows one disk to fail without losing data. Requires a minimum of 3 disks though 5 disks is recommended. You can not add additional drives to expand the size of a RAIDZ1 after you have created it. The only way to increase the size of a RAIDZ1 is to replace each drive with a larger drive one by one while allowing time for restriping between each drive swap out.

RAIDZ2: double-parity ZFS software solution that is similar to RAID6 in that it allows two disks to fail without losing data. Requires a minimum of 3 disks. RAIDZ2 allows you to lose 1 drive without any degradation as it basically becomes a RAIDZ1 until you replace the failed drive and restripe. At this time, RAIDZ2 on FreeBSD is slower than RAIDZ1.

RAIDZ3: triple-parity ZFS software solution. RAIDZ3 offers three parity drives and can operate in degraded mode if up to three drives fail with no restrictions on which drives can fail.

Dataset: a generic term for a ZFS component, such as file system, snapshot, clone, or volume. When you create a ZFS storage pool, a ZFS file system is automatically created. Consider using this top-level dataset as a container for other datasets since the top-level dataset cannot be destroyed or renamed.

Snapshot: a read-only point-in-time copy of a file system. Snapshots can be created quickly and, if little data changes, new snapshots take up very little space. For example, a snapshot where no files have changed takes 0MB of storage, but if you change a 10GB file it will keep a copy of both the old and the new 10GB version. Snapshots provide a clever way of keeping a history of files, should you need to recover an older copy or even a deleted file. For this reason, many administrators take snapshots often (e.g. every 15 minutes), store them for a period of time (e.g. for a month), and store them on another system. Such a strategy allows the administrator to roll the system back to a specific time or, if there is a catastrophic loss, an off-site snapshot can restore the system up to the last snapshot interval (e.g. within 15 minutes of the data loss). Snapshots can be cloned or rolled back, but the files on the snapshot cannot be accessed independently.

Clone: a writable copy of a snapshot which can only be created on the same ZFS volume. Clones provide an extremely space-efficient way to store many copies of mostly-shared data such as workspaces, software installations, and diskless clients. Clones do not inherit the properties of the parent dataset, but rather inherit the properties based on where the clone is created in the ZFS pool. Because a clone initially shares all its disk space with the original snapshot, its used property is initially zero. As changes are made to the clone, it uses more space.

Deduplication: the process of eliminating duplicate copies of data. ZFS deduplication is per-dataset and should only be enabled on datasets that require it as it is CPU intensive. If you enable dedup on datasets with duplicate data (e.g. containing virtual images or jails), you should see the benefits of saving space and better performance because less data is written and stored. Before enabling deduplication, you should determine if the performance benefit will outweigh the performance overhead. This blog post provides a good overview to assist in your decision.

The Basic Mode tab of the Disk Setup screen allows you to select the ZFS filesystem, as seen in Figure 4.3c:

Figure 4.3c: Selecting the ZFS Filesystem

The screen indicates that a 64-bit system and a minimum of 4GB of RAM are recommended. This is because ZFS needs at least 4 GB of usable RAM in order to use caching, which significantly increases its speed and performance. Since some RAM is used by the operating system, you can get by on 4GB of RAM but will have better performance with 8GB or more.

Figure 4.3d shows the default layout in the Advanced Mode tab when ZFS is selected as the filesystem in the Disk Setup screen:

Figure 4.3d: Default Layout for ZFS

The actual sizes of the partitions created will vary, depending upon the size of the disk, but always follow this logic:

- a 1 GB /boot partition that is formatted with UFS

- a 1 GB swap partition

- the rest of the disk devoted to ZFS

Unlike UFS, ZFS does not require separate partitions for /usr, /tmp, or /var. Instead, you create one ZFS partition and specify multiple mount points.

The /boot partition is not mandatory with ZFS as the PC-BSD installer puts a 64k partition at the beginning of the drive. If you prefer, you can just create a swap partition and then use the rest for ZFS.

4.3.2.1Customizing the ZFS Pool

If you highlight the ZFS partition and click the Edit button, you will see the screen shown in Figure 4.3e.

Figure 4.3e: Customizing the ZFS Partition

This screen allows you to customize the ZFS pool using the following options:

ZFS Pool Type: this drop-down menu allows you to choose from the following types: basic, mirror, raidz, raidz2, raidz3. If you only have one disk or wish to stripe multiple disks (this does not provide redundancy, so if one disk fails, all data is lost), select basic. If you wish to create a mirror or a type of RAIDZ, make sure that you have enough physical disks to support that type of RAID. You can specify which disks to include in the next option.

Additional ZFS Pool Devices: if you wish to add other disks to the ZFS pool, check the box next to each disk that you would like to include.

ZFS File Systems: input the names of the filesystems (mount points) that you would like to create within the ZFS pool. These are also known as datasets.

4.4Disk Encryption

The Disk Setup screen of the PC-BSD installer, shown in Figure 4.4a, has a checkbox "Encrypt user data". This option will automatically encrypt all of the data stored in /usr, including the home directories of all of the users that you create.

Figure 4.4a: Encrypt User Data Option

If you check this box, a pop-up message will ask if you want to use a passphrase to access the encrypted volume. If you click Yes, you will be prompted to enter twice a passphrase of at least 6 characters. If you decide to enter a passphrase, you will need to watch your boot messages whenever the system boots as the boot process will pause and prompt you to enter the passphrase so that it can mount /usr and finish booting into PC-BSD. While this is inconvenient, it means that if someone else boots your computer, PC-BSD will not be able to boot into PC-BSD if that person does not know the passphrase. However, if you forget your passphrase, you won't be able to access PC-BSD either. For these reasons, it is important to choose a good passphrase that other users won't guess and which you won't forget. Passphrases are case-sensitive and can contain spaces. The passphrase should be memorable to you (e.g. a line from a song or piece of literature), but hard to guess (i.e. people who know you should not be able to guess your favorite line from a song or piece of literature).

NOTE: be careful if you have changed your keyboard variant and layout. At this time, the GELI encryption framework only supports QWERTY passphrases, so don't use any characters not found on a QWERTY keyboard in your passphrase.

4.4.1Encrypting Other Partitions

The Disk screen of the installer also allows you to customize which partitions are encrypted. This is handy if you wish to encrypt the swap partition or if you create your own partitions and wish to encrypt them.

NOTE: don't encrypt the / partition as it stores the encryption keys.

To encrypt a partition, click the Advanced Mode tab in the Disk Setup screen of the installer. You can either click the "Use default layout" button and edit the default partitions or manually add your own partitions.

Highlight the partition you wish to encrypt and click / (Edit) to encrypt an existing partition or click + (Add) to add a new partition. This will open a pop-up screen, similar to the one in Figure 4.4b. If you check the "Enable Encryption" box, you will be prompted to enter and confirm a passphrase of at least 6 characters. In the example shown, the user has created a partition called /documents.

Figure 4.4b: Configuring Encryption on a partition

Once you have confirmed your passphrase, click the Save button to return to the previous screen. You can repeat this process for all of the partitions you wish to encrypt.

If you encrypt any partitions, you will see the message shown in Figure 4.4c when you click Next to proceed to the next installation screen.

Figure 4.4c: Remember to Take a Backup of your Encryption Keys After the Installation is Complete

It is important to remember to make a backup copy of your keys either to another system or to a removable media such as a USB thumb drive. You should do so after your first boot into PC-BSD.

4.4.2Using Your Passphrase

Once the installation is complete, watch your boot messages. Right after the hard drive is probed, you should see a message similar to the one shown in Figure 4.4d.

Figure 4.4d: Prompt to Enter Passphrase

A * should appear for each character that you type, so type slowly and make sure that each keystroke is accepted. If you do not enter the passphrase correctly, you will be re-prompted to try again:

GEOM_ELI: Wrong key for ada01se. Tries left: 2.

If you run out of tries, that filesystem will not be mounted. If the filesystem was critical to system bootup, you will be put into single-user mode.

Once the correct passphrase is entered, you'll see a message similar to the following and the boot sequence will proceed.

GEOM_ELI: Device ada01se.eli created.

GEOM_ELI: Encryption: AES-XTS 128

GEOM_ELI: Crypto: software

4.5Dual Booting

A PC-BSD installation assumes that you have an existing primary partition to install into. If your computer has only one disk and PC-BSD will be the only operating system, it is fine to accept the default partitioning scheme. However, if you will be sharing PC-BSD with other operating systems, care has to be taken that PC-BSD is installed into the correct partition; otherwise, you may inadvertently overwrite an existing operating system.

If you wish to install multiple operating systems on your computer, you will need the following:

- a partition for each operating system. Many operating systems, including PC-BSD, can only be installed into a primary partition. This means that you will need to use partitioning software as described in section 2.5 Partitioning the Hard Drive.

- a boot loader that allows you to select which operating system you wish to boot. Depending upon the choice of boot loader and the operating systems that you install, you may or may not have to configure the boot loader to list all of the installed operating systems. Also, depending upon the order that you install the operating systems, the existing MBR data may be overwritten. This section will describe the configuration of several different boot loaders and how to restore an overwritten MBR.

- a backup of any existing data. This backup should not be stored on your computer's hard drive but on another computer or on a removable media such as a USB drive or burnt onto a DVD media. If you are careful in your installation, everything should go fine. However, you'll be glad that you made a backup should something go wrong.

4.5.1Choosing the Installation Partition

When installing PC-BSD onto a computer that is to contain multiple operating systems, care must be taken to select the correct partition in the Disk Setup Screen of the installation. On a system containing multiple partitions, each partition will be listed. Highlight the partition that you wish to install into and make sure that you do not select a partition that already contains an operating system or data that you wish to keep.

DANGER: Make sure that the "Use Entire Disk" box is not checked. If you check this box, the installer will overwrite all of the partitions that exist on the selected disk! Also, do not use the "Use default layout" button in the Advanced Mode tab as it will instead layout the entire disk. If you wish to customize the layout of a specific partition, highlight that partition in Basic Mode and use the "Add" button in Advanced Mode to customize its layout.

If you install PC-BSD on a computer that already contains an operating system, the first time you reboot, your computer will automatically boot into the previous operating system. You will need to configure a boot loader utility to recognize all of the operating systems that are installed and to provide you with a boot menu where you can select which operating system to boot into. The rest of this section will demonstrate how to configure the GAG, GRUB, and EasyBCD boot loaders. Select the boot loader that best suits your needs or which is already installed on the computer.

4.5.2GAG, The Graphical Boot Manager

GAG is a versatile boot manager, capable of booting many different operating systems. Once you have finished installing all of your operating systems, you can configure GAG to present you with a boot menu containing an entry for each operating system.

After downloading and unzipping GAG, burn the cdrom.iso file to a CD. Insert the CD and reboot the system to configure GAG. You will be presented with the initial GAG screen, shown in Figure 4.5.2a:

Figure 4.5.2a: Initial GAG Screen

NOTE: Your mouse won't work in GAG. Instead, use the key representing the number or letter of the option that you wish to select.

Press 4 in order to "Install GAG". The next screen will prompt you to choose your keyboard type by pressing the associated number key. The next screen will prompt you to choose your language by pressing the associated number or letter key. Once your selections have been made, you will see a screen similar to Figure 4.5.2b:

Figure 4.5.2b: Press the S Key to Configure GAG

Press S to "Setup GAG" and see the screen shown in Figure 4.5.2c:

Figure 4.5.2c: GAG's Main Configuration Menu

Press A to "Add a new Operating System". GAG will display an entry for each operating system installed on the computer.

NOTE: If you are dual-booting with Linux, GAG will not find the Linux installation unless GRUB or lilo is installed in the / or /boot partition of the Linux system.

Press the letter associated with the operating system name. Your PC-BSD entry will probably be displayed as "A5h FreeBSD". When you press the associated letter, a pop-up menu will prompt you to type a description which will be shown in the boot menu. Type in something that is useful to you, such as "PC-BSD 9.0". When you press enter, you will be prompted to type in a password or to press return for no password. If you decide to type in a password, you will need to input this password whenever you wish to boot into that operating system.

Once you press enter, you will see the screen shown in Figure 4.5.2d.

Figure 4.5.2d: Selecting an Icon for the Boot Menu Entry

Press the letter representing the icon that you wish to associate with the operating system--it will be displayed next to the description in the boot menu. For example, you could press F to associate the FreeBSD Beastie icon next to the "PC-BSD 9.0" description. Once you press enter, you will be returned to the main menu. Press A again to add another operating system and repeat this process for each operating system that you wish to boot.

When you are finished, press H to "Save in Hard disk". You should receive a pop-up message indicating that "GAG installed successfully". You can now press R to "Return to main menu". You'll note that the screen shown in Figure 4.7.2b now contains the entries for the operating systems that you added. Remove the CD and press the key associated with the operating system you wish to boot.

Now, whenever you reboot your system, this same menu will appear. It will always contain the S option so that you can add or delete operating system entries, set the boot passwords, or set the boot timer.

4.5.3GRUB

Many Linux distros use GRUB as the boot loader. This section shows you how to add PC-BSD to an existing GRUB menu.

While booted into the Linux system, use the grub command line tool to list all devices that can be seen by GRUB's drivers. This will help you determine which drive options to use when setting the root option in the examples below.

sudo grub

grub> ls (output will be specific to your system)

grub> quit(when you are finished using grub)

There are two versions of GRUB that are in use. To see which version your Linux distro is using:

grub> grub --version

4.5.3.1Adding PC-BSD to Legacy GRUB

If the version number is less than 1, you are using legacy GRUB. Here is an example of adding a PC-BSD entry to a Linux distro that is using legacy GRUB:

title  PCBSD 9.0

root   (hd0,1)

kernel /boot/loader

title: This will be the text that is shown in the boot menu and can be anything that makes sense to you.

root: The root of the partition containing PC-BSD. In the above example, PC-BSD is installed on the first hard disk (hd0) and on the first partition (,1). Start counting your hard disk from zero (e.g. disk 0 for the first hard disk, disk 1 for the second hard disk) and your partition from one (e.g. 1 for the first partition on that disk, 2 for the second partition, etc.)

kernel: Used to load the primary boot image. For FreeBSD and PC-BSD, always use /boot/loader.

For more information about GRUB version 1, refer to the GRUB Legacy Manual.

4.5.3.2Adding PC-BSD to GRUB Version 2

If the version number is higher than 1, the entry would look something like this:

title  PCBSD 9.0

root   (hd0,1,a)

kernel /boot/loader

boot

If you installed PC-BSD onto a second hard drive and did not check the box to partition disk with GPT, the entry would look something like this:

title PC-BSD 9.0

map (hd0) (hd1)

map (hd1) (hd0)

map --hook

chainloader (hd0,0)/boot0

boot

If you installed PC-BSD onto a second hard drive and checked the box to partition disk with GPT, the entry would look something like this:

title PC-BSD GPT

map (hd0) (hd1)

map (hd1) (hd0)

map --hook

chainloader (hd0,0)/pmbr

boot

If you installed ZFS on a GPT Partition, your entry would look something like this:

menuentry "PC-BSD 9.0" {

insmod zfs

search -s -l freepool

kfreebsd /freebsd@/boot/kernel/kernel

kfreebsd_module_elf /freebsd@/boot/kernel/opensolaris.ko

kfreebsd_module_elf /freebsd@/boot/kernel/zfs.ko

kfreebsd_module /freebsd@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache

set kFreeBSD.vfs.root.mountfrom=zfs:freepool/freebsd

}

After a GRUB2 configuration change you need to run update-grub as the superuser or sudo update-grub. For more information please refer to the GNU GRUB Manual.

4.5.4Dual Boot with Windows Using EasyBCD

EasyBCD was developed by the non-profit NeoSmart Technologies to make it easy to add other operating system entries to the the Windows boot loader. EasyBCD allows you to add entries for multiple Windows installations as well as Linux, BSD, and Mac OS X. EasyBCD provides both a paid version and a free version for limited, non-commercial use.

After booting into Windows, download and install the latest version of EasyBCD. Once installed, launch EasyBCD. The initial screen will show the current Windows bootloader. As seen in the example in Figure 4.5.4a, it will be set to boot Windows only:

Figure 4.5.4a: Viewing the Windows Boot Loader Entries Using EasyBCD

Click the "Add New Entry" button to add an entry for your PC-BSD installation. In the Linux/BSD tab, click the "Type" drop-down menu and select FreeBSD/PC-BSD from the list. Type in something useful in the "Name" field; whatever you type here will show up in the boot menu. Click the "Device" drop-down menu and select the partition holding your PC-BSD installation. It will have a filesystem type of 0xA5 rather than a drive letter or NTFS. The entry will also show its size so you can find it if you have other non-Windows partitions. An example is seen in Figure 4.5.4b:

Figure 4.5.4b: Adding an Entry for PC-BSD to the Windows Boot Loader

Once you've made your selections, click the "Add Entry" button. If you then click on the "View Settings" button, you should see a new entry for your PC-BSD installation.

Now that you have an entry, you can click the "Edit Boot Menu" button to set the order of the entries in the boot menu, the default operating system to boot, and the boot menu selection timeout before booting into the default operating system. This screen is shown in Figure 4.5.4c.

Figure 4.5.4c: Viewing the New Entry in EasyBCD

Once you reboot, a simple boot menu will appear containing entries for Windows and PC-BSD. A sample menu is shown in Figure 4.5.4d. Use your arrow key to select the operating system you wish to boot into.

Figure 4.5.4d: Sample Boot Menu Created by EasyBCD

4.6Upgrading PC-BSD

PC-BSD's Update Manager makes it easy to upgrade from an earlier version of 9.0 (including beta and RC versions) to the latest version of PC-BSD.

NOTE: It is not recommended to update between major branches: for example, from a 7.x or 8.x version to a 9.x version of PC-BSD. Instead, backup your data and do a fresh install of the new version. Also, it is not possible to "upgrade" from FreeBSD to PC-BSD.

DANGER: before performing any upgrade, always back up your important data to an external backup device, such as a removable USB drive, or to another system using Life Preserver. While it is unlikely that something will go wrong, you'll be glad that you made that backup just in case.

An upgrade will preserve the data in the home directories, any installed PBIs, changes to the /usr/local/ and /etc/ directories, changes to /boot/device.hints, and user accounts. When the upgrade is finished, simply reboot to access the new version of your PC-BSD operating system.

NOTE: when you do an upgrade, programs installed via FreeBSD ports or packages will be removed. If you want to preserve them across major system updates, you should install these using Ports Jail. Better yet, request that your favourite port/package is made into a PBI as PBIs are preserved during an upgrade.

To perform the upgrade, make sure that your Internet connection is active and go to Control Panel -> Update Manager or type pc-su pc-updategui from a terminal. After inputting the administrative password, Update Manager will look for updates and inform you if a newer version of the operating system is available. In the example shown in Figure 4.6a, the operating system is currently at 9.0-BETA1 and Update Manager is indicating that 9.0-BETA1.5 is available.

Figure 4.6a: Using Update Manager to Upgrade the Operating System

To perform the update, check the box for the System Upgrade entry and click the "Install selected updates" button. A progress bar will indicate:

- the download status of the PCBSD.tbz upgrade file

- the download status of the software packages that are installed with the operating system and which have newer available versions

How long the downloads take depends upon the speed of your network connection; for example, it can take an hour or so over a DSL connection. You can continue to use your PC-BSD system while Update Manager downloads the files it needs to /usr/local/tmp/. Once the downloads are finished, the message seen in Figure 4.6b will appear.

Figure 4.6b: System is Ready to Reboot

PC-BSD won't automatically reboot the system, giving you the opportunity to close any applications that you have open before you reboot the system yourself.

After rebooting, a console message will appear similar to this one:

##############################################################

A system update to PC-BSD is ready to be installed.

This may take 30 minutes or more.

If you wish to postpone the update, type 'skip' and press enter.

You will be prompted again during the next system boot.

The update will begin automatically in 20 seconds.

>

Since this portion of the updating process can make your system unavailable for as long as half an hour, this message allows you to skip completing the update for now if you need to reboot into the system. If you are ready to leave the system alone while it completes the update, don't do anything and the update will begin in 20 seconds. It is important to not reboot the system until this portion of the upgrade completes.

# PC-BSD System Upgrade

# Updating to 9.0-BETA1.5

# Please do NOT reboot the system until the update is finished

##############################################################

Cleaning old system pkgs.....

Extracting updated world environment...DONE!

Extracting kernel and boot environment...DONE

Cleaning up old files...DONE

Rebooting for stage 2 of upgrade...Shutdown NOW!

The system will automatically reboot into the new operating system and continue with the application updates.

# PC-BSD System Upgrade

# Updating to 9.0-BETA1.5

# Please do NOT reboot the system until the update is finished

##############################################################

Installing system packages...

Cleaning up...DONE

Update finished! Rebooting...

Your system will now reboot into the newly installed operating system.

4.7Creating an Automated Installation with pc-sysinstall

PC-BSD provides a set of Bourne shell scripts that allow advanced users to create automatic or customized PC-BSD installations. pc-sysinstall is the name of the master script; it reads a customizable configuration file and uses dozens of backend scripts to perform the installation. You can read more about this utility by typing man pc-sysinstall.

Here is a quick overview of the components used by pc-sysinstall:

- /usr/share/pc-sysinstall/backend/ contains the scripts used by the PC-BSD installer. Scripts have been divided by function such as functions-bsdlabel.sh and functions-installcomponents.sh. If you've ever wondered how the PC-BSD installer works, read through these scripts. This directory also contains the parseconfig.sh and startautoinstall.sh scripts which pc-sysinstall uses to parse the configuration file and begin the installation.

- /usr/share/pc-sysinstall/backend-partmanager/ contains the scripts which are used by the installer to create and delete partitions.

- /usr/share/pc-sysinstall/backend-query/ contains the scripts which are used by the installer to detect (e.g. detect-nics.sh) and configure (e.g. enable-net.sh) hardware.

- /usr/share/pc-sysinstall/conf/ contains the configuration file pc-sysinstall.conf. It also contains a file indicating which localizations are available (avail-langs), a list of files which aren't touched during an upgrade (exclude-from-upgrade), and a licenses/ subdirectory containing text files of applicable licenses (e.g. bsd-en.txt and nvidia-en.txt).

- /usr/share/pc-sysinstall/doc/ contains the help text that is seen if you run pc-sysinstall without any arguments.

- /usr/share/examples/pc-sysinstall/ contains several example configuration files for different scenarios (e.g. upgrade, fbsd-netinstall). The README file in this directory should be considered as mandatory reading before using pc-sysinstall.

- /usr/sbin/pc-sysinstall this is the script that is used to perform a customized installation.

NOTE: if you wish to start a customized installation from a non-PCBSD system, you can install pc-sysinstall by running the following command. Note that all files will be copied to the current directory. This command assumes that you are on a Unix-like system (e.g. Linux or Mac OS X) and that subversion is installed. You can install a Unix-like environment on a Windows system using Cygwin.

svn co svn://svn.pcbsd.org/pcbsd/stable/pc-sysinstall

To create a custom installation, perform the following steps:

1. Determine which variables you wish to customize.

2. Create a customized configuration.

3. Create a custom installation media.

These steps are discussed in more detail below

4.7.1Determine Which Variables you Wish to Customize

A list of possible variables can be found in /usr/share/examples/pc-sysinstall/README and in Table 4.7.1. Note that the Table is meant as a quick reference to determine which variables are available. The README file contains more complete descriptions for each variable.

Table 4.7.1: Available Variables for Customizing a PC-BSD Installation

Variable

Options

Description

hostname=

should be unique for the network

optional as installer will auto-generate a hostname if empty

installMode=

fresh, upgrade, or extract

sets the installation type

installLocation=

/path/to/location

Used only when installMode is extract and should point to an already mounted location

installInteractive=

yes or no

set to no for automated installs without user input

netDev=

AUTO-DHCP or FreeBSD interface name

type of network connection to use during the installation

netIP=

IP address of interface used during installation

only use if netDev= is set to an interface name

netMask=

subnet mask of interface

only use if netDev= is set to an interface name

netNameServer=

IP address of DNS server

only use if netDev= is set to an interface name

netDefaultRouter=

IP address of default gateway

only use if netDev= is set to an interface name

netSaveDev=

AUTO-DHCP or FreeBSD interface name

type of network configuration to enable on the installed system; can set multiple interfaces

netSaveIP=

IP address of interface

only use if netSaveDev= is set to an interface name

netSaveMask=

subnet mask of interface

only use if netSaveDev= is set to an interface name

netSaveNameServer=

IP address of DNS server

only use if netSaveDev= is set to an interface name

netSaveDefaultRouter=

IP address of default gateway

only use if netSaveDev= is set to an interface name

disk0=

disk device, such as ad0

see README for examples

partition=

all, free, s1, s1, s3, s4, image

see README for examples

partscheme=

MBR or GPT

partition scheme type

mirror=

disk device such as ad1

sets the target disk for the mirror (e.g. the second disk)

mirrorbal=

load, prefer, round-robin, split

defaults to round-robin if the mirror balance method is not specified

bootManager=

none, bsd

image=

/path/to/image

will write specified image file

commitDiskPart

this variable is mandatory and must be placed at the end of each diskX= section; create a diskX= section for each disk you wish to configure.

commitDiskLabel

this variable is mandatory and must be placed at the end of disk's partitioning settings. See the README for examples on how to set the <File System Type> <Size> <Mountpoint> entries for each disk.

installMedium=

dvd, usb, ftp, rsync, image

source to be used for installation

installType=

PCBSD, FreeBSD

installFile=

e.g. fbsd-release.tbz

only set if using a customized installer archive

packageType=

tar, uzip, split

the archive type on the installation media

ftpPath=

e.g. ftp://ftp.pcbsd.org/pub/mirror/9.0/amd64/netinstall/

location of the installer archive when using installMedium=ftp

rsyncPath=

e.g. life-preserver/back-2011-09-12T14_53_14

location of the rsync data on the remote server when using installMedium=rsync

rsyncUser=

username

set when using installMedium=rsync

syncHost=

IP address of rsync server

set when using installMedium=rsync

rsyncPort=

port number

set when using installMedium=rsync

installComponents=

e.g. amarok,firefox,ports

components must exist in /PCBSD/pc-sysinstall/components/

upgradeKeepDesktopProfile=

yes or no

specify if you wish to keep your existing user's desktop profile data during an upgrade. The default is NO, and your existing profile will be moved to .kde4.preUpgrade automatically.

rootPass=

password

set the root password of the installed system to the specified string

rootEncPass=

encrypted string

set root password to specified encrypted string

userName=

case sensitive value

create a separate block of user values for each user you wish to create

userComment=

description

description text can include spaces

userPass=

case sensitive value

password of user

userEncPass

encrypted string

set user password to specified encrypted string

userShell=

e.g. /bin/csh

path to default shell

userHome=

e.g. /home/username

path to home directory

userGroups=

e.g. wheel,operator

comma separated (no spaces) list of groups

commitUser

mandatory, must be last line in each user block

runCommand=

path to command

run the specified command within chroot of the installed system, after the installation is complete

runScript=

path to script

runs specified script within chroot of the installed system, after the installation is complete

runExtCommand=

path to command

runs a command outside the chroot

timeZone=

e.g. America/New_York

location must exist in /usr/share/zoneinfo/

enableNTP=

yes or no

enable/disable NTP

localizeLang=

e.g. en

sets the system console and Desktop to the target language

localizeKeyLayout=

e.g. en

updates the system's xorg config to set the keyboard layout

localizeKeyModel=

e.g. pc104

updates the system's xorg config to set the keyboard model

localizeKeyVariant=

e.g. intl

updates the xorg config to set the keyboard variant

autoLoginUser=

username

user will be logged in automatically without entering a password

4.7.2Create a Customized Configuration

Read through the configuration examples in /usr/share/examples/pc-sysinstall/ to find the one that most closely matches your needs. Copy that file (to any location) and customize it so that it includes the variables and values you would like to use in your installation.

If you wish to perform a fully automated installation that does not prompt for any user input, you will also need to review /usr/share/examples/pc-sysinstall/pc-autoinstall.conf and place a customized copy of that file into /boot/pc-autoinstall.conf on your installation media.

Table 4.7.2 summarizes the additional variables that are available for fully automatic installations. More detailed descriptions can be found in the /usr/share/examples/pc-sysinstall/pc-autoinstall.conf file. Note that the variables in this file use a different syntax than those in Table 4.7.1 (e.g. values follow a colon and space rather than the equals sign).

Table 4.7.2.: Additional Variables for Automated Installations

Variable

Options

Description

pc_config

URL or /path/to/file

location of customized pc-sysinstall.conf

confirm_install

yes or no

should be set to yes, otherwise booting the wrong disk will result in a system wipe

shutdown_cmd

shutdown -p now

good idea to run a shutdown, but can be any command/script you wish to execute post-install

nic_config

dhcp-all or <interface name> <IP address> <subnet mask>

will attempt dhcp on all found NICs until the installation file can be fetched or will setup specified interface

nic_dns

IP address

DNS server to use

nic_gateway

IP address

default gateway to use

4.7.3Create a Custom Installation Media

The installation media can be a CD, DVD, USB, or a directory on an HTTP, FTP, or SSH+rsync server.

The easiest way to create a custom installation media is to modify an existing installation image. For example, if you have downloaded an ISO (CD or DVD) for the PC-BSD version that you wish to customize, the superuser can access the contents of the ISO as follows:

Make sure you have cd 'd into a directory where you would like to copy the contents of the ISO. In the following examples, /tmp/custominstall/ was created for this purpose:

cd /tmp/custominstall

tar -C /mnt -cf - . | tar -xvf -

umount /mnt

Alternately, if you have inserted an installation CD or DVD, you can mount the media and copy its contents to your desired directory:

mount -t cd9660 /dev/cd0 /mnt

cp -R /mnt/* /tmp/custominstall/

umount /mnt

NOTE: if you are using an HTTP, FTP, or SSH server as the installation media, untar or copy the files to a directory on the server that is accessible to users. Be sure to configure the server so that the installation files are accessible to the systems that you wish to install.

If you are creating an automated installation, copy your customized pc-autoinstall.conf to /tmp/custominstall/boot/.

Copy your customized configuration file to /tmp/custominstall/. Double-check that the installMedium= variable in your customized configuration file is set to the type of media that you will be installing from.

You may also need to add some extra files if you set the following variables in your custom configuration file:

- installComponents= make sure that any extra components you wish to install exist in extras/PBI/ (if they end in the .pbi extension) or extras/components/ (if they end in .tbz)

- runCommand= make sure the command exists in the specified path

- runScript= make sure the script exists in the specified path

- runExtCommand= make sure the command exists in the specified path

If the installation media is a CD or DVD, you will need to create a bootable media that contains the files in your directory. To create a bootable ISO:

cd /tmp/custominstall

mkisofs -V mycustominstall -J -R -b boot/cdboot -no-emul-boot -o myinstall.iso

You can then use your favourite burning utility to burn the ISO to the CD or DVD media.

To begin an installation that requires user interaction:

pc-sysinstall -c /path_to_your_config_file

To begin a fully automated installation, insert the installation media and reboot.

In a PXE boot environment, cp your pc-sysinstall.conf file to /boot/. Then, setup a call in /etc/rc.local that runs this command:

pc-sysinstall start-autoinstall /boot/pc-autoinstall.conf

That will start the installation process, fetching your main configuration file and doing the actual installation.

Additional Reading

Installing FreeBSD with pc-sysinstall: pages 26-28, June 2011 issue of BSD Mag

5Desktops

Once you have installed PC-BSD, you will want to become familiar with your desktop environment. This section discusses the desktops which can be selected during the installation of PC-BSD or installed afterwards using System Manager.

NOTE: Fluxbox is always installed and available in the login menu of a PC-BSD system.

These desktops are fully supported, meaning that all of the PC-BSD utilities are integrated into the desktop environment:

- GNOME2

- KDE4

- LXDE

- XFCE4

By default, three PC-BSD icons will appear on these desktops:

AppCafe™: used to install, uninstall, and upgrade PBIs. See section 6.1 Using AppCafe™ for more details.

PC-BSD Control Panel: contains applications for administering the computer. See section 7 Control Panel for more details.

PC-BSD Handbook: a PDF version of the PC-BSD 9.0 Handbook (this document).

The following desktops are called "unsupported" in the PC-BSD installer as they are meant for more advanced users who are comfortable working at the command line. The PC-BSD utilities will work in these environments, but the user may need to start some utilities manually from the command line if they do not appear as an icon on the desktop or in the desktop's application menu:

- Awesome

- Fluxbox

- FVWM

- IceWM

- Openbox

- ScrotWM

- Window Maker

Advanced users can also install other desktops using the FreeBSD ports and packages collection. You can browse the 180+ available desktops in the x11-wm category at Freshports.

The rest of this section provides an overview of each of the desktops that can be installed with PC-BSD.

5.1GNOME2

GNOME2 is a popular desktop environment that provides many built-in utilities.

NOTE: As of PC-BSD 9.0-RELEASE, GNOME3 has not yet been ported to FreeBSD. Once it has, it may be added as a desktop component in the PC-BSD installer.

Figure 5.1a shows a screenshot of GNOME2 on a PC-BSD 9.0 system with the Applications menu open:

Figure 5.1a: GNOME2 on PC-BSD

Each category in the Applications menu contains many applications and the Settings and System categories contain many utilities for configuring your system. If you are new to GNOME2, take some time to discover which applications best suit your needs. Some of the applications which are provided by GNOME include:

- Eye of GNOME: image viewer found in Graphics -> Image Viewer.

- Epiphany: web browser found in Internet -> Epiphany Web Browser.

- Brasero: CD/DVD burning software found in Multimedia -> Brasero Disk Burner.

- Totem: movie player found in Multimedia -> Movie Player.

- Evolution: email client with address book and calendar. Found in Office -> Evolution Mail and Calendar.

- Nautilus: file manager found in Utilities -> File Browser.

NOTE: some games, such as Gnibbels, Lights Off, Quadrapassel, and Swell Foop require 3D acceleration. If your video driver does not support this, you will not be able to launch those games.

You can find additional themes and wallpapers at gnome-look.org.

5.2KDE4

The KDE desktop environment provides many features and applications. However, it is hardware intensive and may run slowly on a computer with an older processor or a small amount of RAM. Figure 5.2a shows a screenshot of KDE4 running on PC-BSD 9.0 with the Applications menu open:

Figure 5.2a: Applications Menu of KDE4

Each category in the Applications menu contains many applications and the Settings and System categories contain many utilities for configuring your system. If you are new to KDE4, take some time to discover which applications best suit your needs. Some of the applications which are provided by KDE4 include:

- Gwenview: image viewer found in Graphics -> Image Viewer.

- Digikam: photo management program found in Graphics -> Photo Management Program.

- Konqueror file manager, web browser, and SSH client found in Internet -> Web Browser.

- KMPlayer: media player found in Multimedia -> Media Player. Plays most MPEG/VOB, AVI, Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT, NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files, supported by many native, XAnim, and Win32 DLL codecs. You can watch VideoCD, SVCD, DVD, 3ivx, DivX 3/4/5, WMV and even H.264 movies.

- Okular: document viewer and annotator found in Office - Document Viewer. Supports PDF, OpenOffice, and Postscript files.

- KOrganizer: organizer utility and reminder daemon found in Office -> Personal Organizer.

- Dolphin: file manager found in System -> File Manager. Dolphin provides many features for manipulating files such as comments, tags, search, encryption, and dealing with zipped archives.

By default, desktop effects are disabled as not all video cards support them. If your video card supports 3D effects and you would like to enable them in KDE, go to System Settings -> Desktop Effects -> General and check the box "Enable desktop effects at startup".

Some of KDE's games require 3D support. If your video card does not support 3D, these games will fail to start.

If you have KDE installed and are currently logged into a different window manager, you can still run any KDE application by specifying its name. For example, type konqueror to run the Konqueror web browser or dolphin to access the Dolphin File Manager.

Additional Resources:

KDE Applications: includes descriptions and screenshots of all of KDE's applications as well as links to their Handbooks.

kde-look.org contains additional themes and wallpapers.

5.3LXDE

LXDE is the Lightweight X11 Desktop Environment. It is an excellent choice for older hardware or for users who wish for a complete window manager without all of the overhead required by KDE or GNOME. Since it is XDG-compliant, the PC-BSD Control Panel, AppCafe™, and Life Preserver will be available on the desktop and will integrate into LXDE's menus.

Figure 5.3a shows a screenshot of the default LXDE installation with the LXPanel open.

Figure 5.3a: LXDE Desktop on a PC-BSD System

In addition to PC-BSD's utilities, LXDE provides the following utilities:

- LXPanel: desktop panel which is launched by clicking on the PC-BSD icon in the lower right corner of the desktop. To configure the panel, right-click the PC-BSD icon and select "Panel Settings" or "Add/Remove Panel Items" from the right-click menu.

- PCManFM: found in Accessories -> File Manager. A file manager with features like drag and drop, tabbed browsing, built-in file search, file association with default application, thumbnails for images, bookmarks, and support for non-UTF-8 encoded filenames.

- GPicView: fast image viewer found in Accessories -> Image Viewer.

- LXTerminal: terminal emulator found in Accessories -> LXTerminal

- Xarchiver: archiver utility that supports the 7z, ARJ, bzip2, gzip, lzma, RAR, RPM, DEB, tar, and ZIP file formats. Found in Accessories -> Xarchiver.

- epdfview: a PDF viewer found in Office -> ePDFViewer.

- LXAppearance: a theme switcher for customizing the widgets, colors, icons, mouse cursors, and sound effects used by applications. Found in Preferences -> Customize Look and Feel.

- LXInput: a tool to configure your keyboard and mouse found in Preferences -> Keyboard and Mouse.

- Openbox: the window manager used by LXDE. You can configure settings such as themes, appearance, mouse, and margins by going to Preferences -> Openbox Configuration Manager.

- LXTask: task manager and system monitor found in System Tools -> Task Manager.

- Leafpad: a light-weight graphical text editor found in Accessories -> Leafpad.

LXDE does not ship with a web browser. However, you can use AppCafe™ to install your web browser of choice. Once you install a browser, an Internet category will be added to the LXPanel menu.

5.4XFCE4

Xfce is a lightweight desktop environment that aims to be fast and low on system resources, while still being visually appealing and user friendly.

5.4.1XFCE Applications

The first time you start XFCE4, you will see the message shown in Figure 5.4a:

Figure 5.4a: Panel Welcome Message

In XFCE, a panel is a bar which can hold many items such as application launchers, windows lists, clock, notification area, and applications menus. Your initial panel setup options are:

- Migrate old config: select this option if you wish to have a panel with an application launcher as shown in Figure 5.4b.

- Use default config: this option will install a minimal panel. To access the application launcher menu, right-click the desktop and select Applications as shown in Figure 5.4c.

- One empty panel: this option will install a panel with no icons. To access the application launcher menu, right-click the desktop and select Applications.

Figure 5.4b shows a screenshot of XFCE4 running on a PC-BSD 9.0 with the application menu open:

Figure 5.4b: XFCE with Complete Panel Migrated From Old Config

Figure 5.4c: XFCE with Minimal Panel Using Default Config

In addition to PC-BSD's utilities, XFCE provides the following utilities:

- Ristretto: fast and light-weight picture viewer found in Graphics -> Ristretto Photo Viewer.

- Midori: light-weight graphical browser found in Internet -> Midori.

- Xfburn: CD/DVD burning tool found in Multimedia -> Xfburn.

- Orage: calendar and reminder daemon found in Office -> Orage Calendar.

- Xfesktop: desktop manager found in Settings -> Desktop. Sets the background image, provides a right-click menu to launch applications, and can show files (including application launchers) or iconified windows.

- Xfwm4: window manager found in Settings -> Window Manager. It provides window decorations, virtual desktops, multiscreen mode, transparency and a keyboard shorcuts editor.

- Thunar: file manager found in System -> Thunar File Manager.

A list of recommended applications for XFCE can be found on the XFCE Wiki.

5.4.2Editing the Menu

XFCE 4.8 no longer includes a graphical menu editor. The XFCE team recommends using alacarte which is included with PC-BSD's version of XFCE4 and which can be started by typing alacarte within an xterm.

Figure 5.4d shows a screenshot of alacarte running on PC-BSD.

Figure 5.4d: Using alacarte to Customize Applications Menu

Any entry with a checkbox will appear in your menu. To remove an item from the menu, simply uncheck its box. To create a new menu category, either highlight a top-level menu (e.g. KDE Menu or System) or an existing category and click the New Menu button. To add a new entry, highlight the category where you wish the entry to appear and click the New Item button. Input a name for the entry, browse to the path of the application and press OK.

5.4.3Mounting Devices

XFCE recently announced that it would no longer support the hald device notifier (used by most open source operating systems, including PC-BSD) in favour of udev which is only supported on Linux. This meant that device notification and auto mounting within XFCE would no longer work on BSD systems.

PC-BSD uses an amount script and daemon to monitor devd for insert and removal notifications and to notify the running desktop. This means that if you insert a device while running XFCE, it will be automatically mounted. Since the script and daemon are part of the operating system, it will not matter which window manager you are running, automounting should "just work”.

5.4.4XFCE Plugins

XFCE supports many plugins which provide additional applications that are separate from the official XFCE distribution. You can browse for plugins and read descriptions for each at the XFCE goodies website If you find a plugin that is not available within AppCafe™, this README explains how to determine if a FreeBSD port is available, how to request a PBI if a port is available, and how to request a port if one does not already exist.

After installing a plugin, go to Settings -> Panel -> Items and click the + button to see the Add New Items screen shown in Figure 5.4.e.

Figure 5.4.e: Adding a Plugin to the Panel

Simply select your new plugin from the list, and click the +Add button. It will immediately be added as an icon in the panel.

5.5Awesome

Awesome is a highly configurable and fast window manager that is primarily targeted at power users who prefer to use the command line within their graphical environment.

Figure 5.5a shows a screenshot of Awesome running on PC-BSD 9.0. The user has right-clicked the desktop in order to launch the awesome application manager.

Figure 5.5a: Awesome Window Manager on PC-BSD

If you click awesome -> manual, the man page for awesome will open in a terminal. If you click awesome -> edit config, the awesome configuration file will open in the ee text editor. The numbers in the upper left corner represent virtual desktops. For example, you can have different terminals open in each virtual desktop.

Update Manager, Wireless Configuration Manager (if your wireless card is detected), and Life Preserver are located in the system tray near the clock in the upper right corner. If you wish to access Control Panel type pc-controlpanel in a terminal. To launch AppCafe™, type appcafe in a terminal or use the pbi_* commands.

5.6Fluxbox

Fluxbox is a light-weight and fast window manager. Regardless of the window managers that you have selected to install, Fluxbox is always available as an option in the login menu.

Figure 5.6a shows a screenshot of Fluxbox running on PC-BSD. In this example, the user has launched the Application menu by right-clicking on the desktop.

Figure 5.6a: Fluxbox on PC-BSD

The Features page of the Fluxbox website lists the available configuration files and links to instructions for getting the most out of Fluxbox.

Additional Resources:

Creating the Perfect Fluxbox Desktop on Linux

5.7FVWM

FVWM is a powerful and highly configurable desktop window manager for the X Window system. It supports any number of virtual desktops, each divided into multiple pages. It also supports side title bars, including vertical text.

When you install FVWM on PC-BSD, it also installs FVWM-Crystal. Both window managers will be added to the login menu.

Figure 5.7a shows the default PC-BSD desktop if you select FVWM from the login menu. The application menu was opened by clicking the mouse anywhere on the desktop.

Figure 5.7a: FVWM Running on PC-BSD

Figure 5.7b shows the default PC-BSD desktop if you select FVWM-Crystal from the login menu. To open an xterm in FVWM-Crystal, right-click any area of the desktop.

Figure 5.7b: FVWM-Crystal Running on PC-BSD

This article provides a good overview of the features and configurable options for FVWM-Crystal.

The FVWM Documentation provides further information about configuring FVWM.

5.8IceWM

IceWM is a light-weight window manager.

Figure 5.8a shows a screenshot of IceWM running on PC-BSD. In this example, the user has launched the Application menu by clicking on the IceWM button in the lower left corner. This menu can also be launched by right-clicking anywhere on the desktop.

Figure 5.8a: IceWM on PC-BSD

5.9Openbox

Openbox is a highly configurable, minimalist window manager. It is the window manager used by LXDE but can also be run separately from LXDE.

Figure 5.9a provides a screenshot of Openbox running on a PC-BSD system. The application menu was launched by right-clicking on an area of the desktop.

Figure 5.9a: Openbox on a PC-BSD System

The application menu contains an entry for the Openbox Configuration Manager which can be used to customize settings such as themes, appearance, mouse, and margins. A screenshot of this configuration utility is shown in Figure 5.9b.

Figure 5.9b: Openbox Configuration Manager

A list of websites containing additional themes is available from the Openbox wiki.

5.10ScrotWM

ScrotWM is a minimalist window manager written by OpenBSD hackers. It provides keyboard shortcuts, a configuration file, and assumes that the user prefers to use the command line. If you haven't used ScrotWM before, spend some time reading through its man page first.

Figure 5.10a provides a screenshot of ScrotWM running on a PC-BSD system:

Figure 5.10a: ScrotWM on a PC-BSD System

To launch applications within ScrotWM, start an xterm by pressing ALT SHIFT RETURN. Once you have an xterm, you can start any program you wish. For example, to start Control Panel, type pc-controlpanel.

NOTE: ScrotWM does not provide minimize, maximize, or close buttons within its windows. To close a GUI application, use CTRL c within the xterm you used to launch the application.

5.11Window Maker

Window Maker is a light-weight window manager that was designed to reproduce the elegant look and feel of the NEXTSTEP user interface.

Figure 5.11a shows a screenshot of Window Maker running on PC-BSD. In this example, the user launched the Application menu by right-clicking an area of the desktop.

Figure 5.11a: Window Maker on PC-BSD

In addition to PC-BSD's utilities, Window Maker provides the following applications:

- WPrefs: located in Appearance -> Preferences Utility. Allows you to configure window focus, window placement, menu alignment, icons, keyboard actions, mouse, fonts, and various other window manager settings.

- FSViewer: a file manager found in Utils -> File Manager.

- wmakerconf: found in Utils -> wmaker.conf. Allows you to fine-tune your menu entries as well as your desktop's appearance, themes, background, mouse, and special effects. Figure 5.11b shows wmakerconf with the Menu button selected.

Figure 5.11b: Editing the Application Menu using wmakerconf

5.11.1Working with the Dock

Window Maker uses a "dock" to store application shortcuts. The dock appears as a series of icons in the upper right corner of the desktop. Docked applications always show on the desktop, even after you close an application or close and restart your Window Maker session.

Whenever you start an application, an icon will appear in the lower left corner of the screen. You can move that icon elsewhere on the desktop with your mouse. If you right-click the icon, you have the option to hide/unhide the icon, set icon (change its picture), or kill the application. If you drag the icon onto the dock, it will remain on the desktop.

Once an icon is "docked", a settings menu is added to the icon's right-click menu. Figure 5.11c demonstrates how to configure an icon for AppCafe™.

Figure 5.11c: Configuring an Icon

5.11.2DockApps

Window Maker supports dockapps or applications that were designed to work with Window Maker but which are separate from the Window Maker project. Dockapps tend to be small and designed to perform a particular function. For example, there are clocks, weather applications, and CPU monitors. Most dockapps have been ported to FreeBSD and the port always begins with "wm". You can search for these at freshports.org by entering a "Short Description" "containing" "dockapp".

If your favourite dockapp has not been ported to FreeBSD, you can request that a port be created on the Ports Requests forum using these instructions. If a port already exists and you would like to see it made into a PBI, you can request that a PBI be created on the PBI Requests forum using these instructions

6Installing Applications and Keeping PC-BSD Updated

There are several methods of managing software on a PC-BSD system:

1. PBIs and AppCafe™, the easy PC-BSD way (recommended).

2. Binary packages, the quick FreeBSD way.

3. The ports collection, the slow FreeBSD way.

AppCafe™ provides an intuitive, graphical method for managing software. Binary packages and ports use command-line tools and require previous knowledge or some time to learn how to use these tools. If you are unfamiliar with how to use FreeBSD packages or ports, it is recommended that you practice first using section 7.1 Ports Jail before trying to install software directly onto your PC-BSD system. Advanced FreeBSD users can continue to use ports and packages as they would on a FreeBSD system.

This section demonstrates the following PC-BSD tools for managing software on your PC-BSD system:

- AppCafe™ to install PBI software from a graphical application

- PBI Manager to manage PBI software from the command line

- Update Manager to manage operating system and software updates from a graphical application

6.1Using AppCafe™

PC-BSD provides a unique file format known as a PBI (push button installer). PBI files end with the .pbi extension and are self-contained installation programs. When a PBI is installed using PC-BSD's AppCafe™, even novice users can safely install and uninstall PBIs without inadvertently overwriting or deleting files needed by the operating system or other applications.

A PBI file includes all the runtime and library dependencies required by the application. This means that a PBI is a large file, but this does not necessarily mean that the installed PBI will be that large. During installation, the PBI system compares the currently installed libraries and files with the ones contained within the PBI file and only installs the ones that are not already installed on the system. A hash database is used to eliminate dependency problems while allowing the computer to share libraries between different programs.

AppCafe™ does not require the root password to install most of the applications that users require, such as web browsers, games, mail clients, and productivity software. This means that you don't have to give out the root password on multi-user systems. However, server applications, such as web servers or databases, will prompt for the superuser password. This is to prevent a regular user from installing server software.

When a regular user installs an application, they have the option to "add to desktop for all users", meaning that an application only needs to be installed once on a multi-user system.

6.1.1Installing and Uninstalling PBI Software

To install a PBI, start AppCafe™ by double-clicking its icon on the Desktop, going to Control Panel -> AppCafe™, or by typing appcafe from a command prompt. The Browse tab in AppCafe™ can be used to browse for available software, as seen in Figure 6.1a:

Figure 6.1a: Browsing for Software Using PC-BSD's AppCafe™

If you know the name of the application you would like to install, type its name into the Search bar. Alternately, you can click on a software category (for example, Archivers) to browse for available software. Use the back arrow or home icon to navigate within the browser. Figure 6.1b shows an example of the type of information that is available for each application:

Figure 6.1b: Browsing the Information Available for a PBI

Once you find a PBI that you would like to install, click on its Download icon. AppCafe™ will automatically detect your PC-BSD version and architecture and install the correct PBI for you. When the installation is complete, the new PBI will be displayed in the Installed tab. Figure 6.1c shows a screenshot of this tab from a system with several PBIs installed.

Figure 6.1c: Viewing the List of Installed PBIs in AppCafe™

If you right-click an installed PBI, you can:

- View details: Figure 6.1d shows an example of a PBI's details. In addition to the information usually available for a PBI in the Browse tab, the details will indicate that the PBI is installed and a checkbox is added for Automatic Updating. Check this box if you would like Update Manager to automatically update this PBI, rather than just notify you that a newer version is available.

- Install Desktop Icons: will create a shortcut to the application on the user's desktop.

- Install Menu Icons: will add an entry for the application to the supported desktop's application menu.

- Install Menu Icons (All Users): will add an entry for the application to the application menu of every user.

- Uninstall: will uninstall the PBI. Once the PBI removal is complete, it will be removed from the Installed list.

Figure 6.1d: Viewing an Installed PBI's Details

6.1.2Updating Installed PBIs

The Installed tab will also indicate if there are any newer versions available for the PBIs that you have installed. PBIs are created from the original FreeBSD package and are automatically available as an upgrade whenever the underlying package version changes. Figure 6.1e provides an example of a PBI that has a newer version available:

Figure 6.1e: Using the Installed Tab to Upgrade Installed PBIs

In this example, the currently installed version of Firefox is 7.0.1 and version 8.0 is available. To upgrade this PBI, highlight its entry and click the Update button. The status of the update will be displayed next to the entry, indicating the status of the download. When the upgrade is complete, the entry will be updated to show the new version. The upgrade process will save all of the current version's settings; for example, when you upgrade Firefox, it will keep all of your bookmarks, history, and cache.

6.1.3Repositories

If you click Repositories -> Configure Repository, you will see the screen shown in Figure 6.1f:

Figure 6.1f: Managing Available Repositories

This screen will list the known available repositories. AppCafe™ reads this list in order when connecting to the software repository. You can use the up and down arrows to reorder the list. If you have created your own software repository of PBIs, use the Add button to add the URL of the repository.

If you have created your own .rpo file using the pbi_makerepo command, you can use Repositories -> Add Repository to browse to the location of the .rpo file. This is the equivalent of manually running the pbi_addrepo command.

6.2PBI Manager

PC-BSD 9.0 introduced PBI Manager, a suite of BSD-licensed command line utilities for managing PBIs. PBI Manager's command-line tools can be used to install, remove, create and manage PBIs.

NOTE: PBI files previously created for PC-BSD 7.x or 8.x will NOT work with PBI Manager as they use the old PBI format.

6.2.1New Features

The new PBI format introduces the following features:

- Upgrade deltas: since PBIs are self-contained, installation files tend to be large. In the previous implementation, updating a PBI required the re-downloading of the entire installation archive. For larger applications this could be a time-consuming process, especially over low bandwidth connections. The new PBI specification performs updates using binary diff patches known as PBP (Push Button Patch) files. PBPs are a fraction of the PBI's size; in some cases less than 5% of the original PBI archive. An upgrade automatically checks for for the presence of a PBP file and attempts to use it, only falling back to the original archive should the process fail.

- Library and file sharing: in the previous implementation of the PBI format it was common that identical files existed between various applications. These duplicates, while necessary to provide self-contained functionality, wasted both disk space and runtime memory. This waste of space has been greatly reduced through the use of a hash-dir directory where libraries and common files are shared through a system of hard links. When an identical file is found in a PBI, the original will be removed and a hard-link stored in the hash-dir. After a PBI has been removed, any unneeded files left in the hash-dir are cleaned up by the pbid(8) daemon which monitors and maintains the integrity of the shared files.

- Repository management: allows administrators and PBI builders to create and manage their own repositories of PBIs. This repository system provides a number of tools for PBI distribution, release management, and repository browsing.

- Digitally signed PBIs: each repository includes an openssl public key file which is installed on the end user's system. Each PBI includes several signatures for the content archive and installation and removal scripts. During the PBI installation process, these signatures are checked to confirm that the archive has not been tampered with during transit. This key file is also used to associate a particular PBI with a parent repository for upgrade purposes, since it is possible that multiple repositories will have the same applications.

- Root password not required: most applications can be installed and upgraded by regular user (non-root) accounts. This allows enhanced security in office or home situations, where users can now add/remove desktop applications without needing access to the root password. PBIs that impact on the security of the system (e.g. installing a web server) will require root access.

- Implementation: the previous PBI design was developed in QT/KDE C++, making it inappropriate for use at the command line. The new format is implemented 100% in shell and is comprised of command-line utilities, each with an associated man page. These utilities are discussed in more detail in the rest of this section.

Additional Resources:

The PBI Format Re-implemented for Free/PC-BSD (conference slides)

The PBI Format Re-implemented for Free/PC-BSD (formal paper)

The PBI Format for 9.0 and Beyond

6.2.2What is the PBI format?

One of the things holding back mainstream adoption of open source desktops is the package management format. With almost all open source desktops, software is simply treated as part of the operating system. Thus, when performing an update of some seemingly trivial application, you run the risk of potentially needing to upgrade other packages which could break other critical parts of your desktop.

While package management systems have gotten better at resolving dependency issues, trying to fix conflicts to prevent breakage before it occurs, they still don't address the underlying problem: every software package is a part of the system, and pulling on any one thread has the potential of causing a break somewhere farther down the line.

The PBI format tries to correct this underlying flaw. Rather than making every application a part of the base system, PBIs are self-contained, including their own dependent library tree and related data. As a result, when you install a PBI there are no dependency issues to resolve, and applications can be added or removed freely, without fear of causing breakage to the desktop or any other installed software.

6.2.3Underlying File / Directory Structure

The underlying files and directories used by PBI Manager are as follows:

- /usr/local/etc/pbi.conf: location of the PBI Manager configuration file

- /usr/pbi/: where PBIs are installed on the system

- /var/db/pbi/: contains data files related to installed PBIs and repositories

- /usr/local/sbin/pbi_*: location of the PBI Manager commands

- /usr/local/share/pbi-manager/module-examples/convertoldmod.sh: script which can be used to convert an existing 7.x or 8.x PBI module to the new 9.x format

6.2.4Command Reference

The following is a list of commands installed by PBI Manager, along with a small synopsis of each. For more details, please refer to the command's man page.

6.2.4.1pbi_add(1)

Similar to FreeBSD's pkg_add, the pbi_add command is used for adding/installing PBIs on a system, either from a local file or remotely from a repository. This utility supports the options listed in Table 6.2.4.1:

Table 6.2.4.1: pbi_add Options

Switch

Description

-e

extract only, do not install; will extract the archive to ~/<pbidirname> unless the -o option is used

-f

force installation, overwriting an already installed copy of the application

-g

show path to icons and images for GUI installations

-i

display information about specified PBI

-l

display license for specified PBI

-o outdir

specify the directory to use when extracting the PBI with -e

-r

remote fetch installation file from update server; the system architecture and version will be automatically determined in order to fetch the correct file

-R

remote fetch the install file from the update server but do not install

-v

enable verbose output

--checkscript

display any custom scripts used in the installation/removal of the PBI

--licagree

agree to license terms and conditions; to view the license, use -l

--no-checksig

skip the openssl signature verification of the PBI data

--no-checksum

skip the checksum verification of the archive data

--no-hash

disable using the shared hash dir

--repo repoid

specify which repository to use

--rArch arch

manually specify the PBI architecture type of i386 or amd64

-rVer version

specify which version of the PBI to install

For security reasons, it is recommend that users first use the -e and --checkscript options to view archive contents and installation scripts prior to installing a PBI file.

To install a PBI, use: pbi_add -r PBINAME. The following example will install the alpine PBI:

pbi_add -r alpine

Downloading ftp://ftp.pcbsd.org/pub/mirror/PBI/mail/alpine/9/x32/alpine-2.00_3-i386.pbi

/usr/pbi/.alpine-2.00_3-i386.pbi.42391   100% of  11 MB 295 kBps 00m00s

Verifying Checksum...OK

Extracting to: /usr/pbi/alpine-i386

Installed: Alpine-2.00_3

6.2.4.2pbi_addrepo(8)

The pbi_addrepo command is used to register a new PBI repository on a system. If the pbid daemon is running, the repository's index and meta files will be automatically fetched and made ready for browsing. The command has one argument: the name of the repository file. Repository files have a .rpo extension and are created with the pbi_makerepo command.

6.2.4.3pbi_autobuild(8)

The pbi_autobuild command is used on the PBI build system to build any out-of-date or new packages. The utility is also of interest to PBI testers and system administrators who create and maintain their own internal repository of PBIs. It can traverse the FreeBSD ports and Meta-data trees, building missing PBI files or PBIs in which the target port version has been updated. Table 6.2.4.3 summarizes this command's options:

Table 6.2.4.3: pbi_autobuild Options

Switch

Description

-c confdir

specify the directory containing the PBI configuration modules; any found pbi.conf files will be parsed, and if PBI_MAKEPORT is set, the target port will be used for the build; if PBI_MAKEPORT is unset, the auto-build will attempt to match the module to a FreeBSD port based upon the dirname of pbi.conf

-d portsdir

specify an alternative ports directory; defaults to /usr/ports/

-h script

specify a helper script to call after building a PBI

-o outdir

the directory to place the finished PBI files; also used to determine which apps are in need of a rebuild if the associated FreeBSD port has been updated

--genpatch

when building a new PBI, check for archived copies and generate smaller patch updates to the new version (*.pbp files)

--keep num

when building new PBIs, keep <num> copies of past versions of working PBI in <outdir>/archived/ folder; these archived copies can be used with the --genpatch command to generate update patch files

--prune

remove any PBIs which no longer have an associated module in confdir

--tmpfs

automatically create and mount a tmp filesystem and use it for WRKDIRPREFIX; can speed up port compiles on systems with available RAM

--sign keyfile

digitally sign the PBI file with the specified openssl private key file

6.2.4.4pbi_browser(1)

The pbi_browser command provides a CLI front-end to browsing a repository's available PBIs. Options for viewing categories and searching by keyword are available, and once the desired PBI is located, it will show the pbi_add command which can be used to install the application. Table 6.2.4.4 summarizes the available options.

Table 6.2.4.4: pbi_browser Options

Switch

Description

-c category

displays a list of PBIs in the specified category

-s search

search for PBIs containing the specified string in the name, description, or keywords

--listcats

list the available categories

--viewall

list all available PBIs

6.2.4.5pbi.conf(5)

pbi.conf is an ASCII text configuration file containing values that are used by the various pbi_* commands The proxy variables are only needed if the system uses a proxy server to access the Internet. Table 6.2.4.5 lists the supported variables.

Table 6.2.4.5: pbi_conf Variables

Switch

Description

PBI_INDEXREFRESH

number of hours representing how often pbid refreshes the index and meta files from repos; default is every 24 hours

PBI_PROXYPASS

password used to authenticate with proxy server

PBI_PROXYPORT

proxy server port number

PBI_PROXYTYPE

can be HTTP or SOCKS5

PBI_PROXYURL

proxy server IP address

PBI_PROXYUSER

username used to authenticate with proxy server

PBID_REFRESH

wakeup time in seconds for pbid to run its checks

6.2.4.6pbi_create(1)

The pbi_create command provides a way for packagers to manually specify a target directory to be compressed into a PBI file. The option -b can also be used to re-package an already installed PBI back to an archive. This command replaces the 8.x PBI Module Builder functionality. PBI creators are encouraged to send a tarball of the resulting PBI module to the PBI-testing mailing list so they can be added to the PC-BSD PBI repository and made available to other PC-BSD users.

Table 6.2.4.6 summarizes the available options:

Table 6.2.4.6: pbi_create Options

Switch

Description

-a author

specify the author for this PBI

-b

make a backup of an installed PBI; specify the target PBI name instead of the PBI directory

-c confdir

specify the metadata configuration directory; while not required it is highly recommended as metadata is required to create icons and binary entry-points

-d portsdir

specify an alternative ports directory; defaults to /usr/ports/

-i icon

specify a default icon, relative to pbidir/

-n name

specify a name for this PBI

-o outdir

place the finished .pbi file into the specified directory; defaults to $HOME

-p port

use the given port to get PBI name and version

-r version

specify a version for this PBI

-u weburl

specify a website URL for the PBI

--no-hash

disable using the shared hash directory which uses hard links to share files between applications

--sign keyfile

digitally sign the PBI file with the specified openssl private key file

Creating a PBI with the pbi_create command is relatively simple. As the superuser, use the syntax:

pbi_create -a <author> -n <name> -r <version> -w <weburl> <target directory>

Inside the target directory place the application's binaries or scripts along with any required dependencies. To indicate which file(s) represent the runtime command(s), include a file named external-links in the target directory. That file contains an entry for each command, as seen in the following example:

# Files to be symlinked into the default LOCALBASE

# One per-line, relative to %%PBI_APPDIR%% and LOCALBASE

# Defaults to keeping any existing files in LOCALBASE

# Use bin-files/ for binaries that need wrapper functionality

# TARGET LINK IN LOCALBASE ACTION

bin/myapp bin/myapp binary,nocrash

This entry instructs pbi_create to make the wrapper scripts for the myapp binary, along with placing it in the user's PATH at install time.

It is also possible to include desktop icons and mime entries using the xdg-mime/, xdg-desktop/ and xdg-menu/ directories. Section 10.7 Create PBIs contains more details about creating these files. These directories should be created as subdirectories of the target directory of your application.

6.2.4.7pbi_delete(1)

Similar to FreeBSD's pkg_delete, the pbi_delete command removes an installed PBI from the system. It also schedules cleaning for the shared library directory, which is performed by pbid. Table 6.2.4.7 summarizes its options:

Table 6.2.4.7: pbi_delete Options

Switch

Description

-v-

enable verbose output

--clean-hdir

perform a full cleaning of the shared hash directory, removing any unused files; should only be required after a system crash or failure in removing a PBI

When removing a PBI, you must give its full name. The full name can be found in the output of pbi_info. The following example searches for the ntop PBI and removes it:

pbi_info | grep ntop

ntop-4.0.1_1-i386

pbi_delete -v ntop-4.0.1_1-i386

Running pre-removal script: /var/db/pbi/installed/ntop-4.0.1_1-i386/pre-remove.sh

Removing: /usr/pbi/ntop-i386

Removing: /var/db/pbi/installed/ntop-4.0.1_1-i386

6.2.4.8pbi_deleterepo(8)

The pbi_deleterepo command can be used to remove a registered repository from the system. It takes the repository's ID as the only command argument.

6.2.4.9pbi_icon(1)

The pbi_icon command provides a number of options for adding desktop icons, menu entries, and mime data for an installed PBI. Not all PBIs will contain desktop/menu/mime data. Additionally, the window manager must be XDG-compliant to understand a PBI's icon and mime settings. Table 6.2.4.9 summarizes this command's options:

Table 6.2.4.9: pbi_icon Options

Switch

Description

add-desktop

installs desktop icon; should be run as regular user

add-menu

installs menu icons; should be run as root

add-mime

installs mime information; should be run as root

add-pathlnk

installs any $PATH links to ~/bin when run as user or to $LOCALBASE when run as root

del-desktop

removes desktop icon; should be run as regular user

del-menu

removes menu icons; should be run as root

del-mime

removes mime information; should be run as root

del-pathlnk

removes any $PATH links to ~/bin when run as user or to $LOCALBASE when run as root

6.2.4.10pbi_indextool(1)

The pbi_indextool command is useful for repository maintainers. It allows PBI files to be added and removed from the repository's INDEX file rather than editing the file manually. Table 6.2.4.10 summarizes the available options:

Table 6.2.4.10: pbi_indextool Options

Switch

Description

add

adds a PBI to the target INDEX file

rem

removes a PBI from the target INDEX file

Run the command with the desired switch to receive detailed usage options.

6.2.4.11pbi_info(1)

Similar to FreeBSD's pkg_info command, the pbi_info command is used to determine which PBIs are currently installed. Table 6.2.4.11 summarizes the available options:

Table 6.2.4.11: pbi_info Options

Switch

Description

-a

list all PBIs installed on the system; same as running pbi_info without an argument

-i

list all available PBIs from any repo

-v

enable verbose output

6.2.4.12pbi_listrepo(1)

The pbi_listrepo command manages installed repositories on a system. Table 6.2.4.12 summarizes this command's options:

Table 6.2.4.12: pbi_listrepo Options

Switch

Description

--down

move the targeted repoID down a single number in priority

--mirror URL

change the specified repoID's mirror URL

--up

move the targeted repoID up a single number in priority

Run the command without any options to list the IDs of the available repositories.

6.2.4.13pbi_makepatch(1)

The pbi_makepatch command is automatically used by pbi_autobuild to create small *.pbp (Push Button Patch) files. These files can be downloaded to a user's system in order to update a PBI's version without re-downloading the entire archive. This allows users to download only the incremental changes when a PBI is upgraded. The command can also be run manually by providing two PBI archives to compare and generate a patch file for.

Table 6.2.4.13 summarizes the available options:

Table 6.2.4.13: pbi_makepatch Options

Switch

Description

-o outdir

save the resulting *pbp file to the specified directory

--sign keyfile

use the specified openssl key to digitally sign the patch file

6.2.4.14pbi_makeport(1)

The pbi_makeport command can be used by packagers to build a target FreeBSD port and convert it into a PBI file. Many options are provided to fine-tune the build process, and metadata modules can also be specified to further improve the resulting PBI file. The first time this command is run, it will build a fresh chroot sandbox environment which can be used for clean-room building of the target port without affecting the host system. PBI creators are encouraged to send a tarball of the resulting PBI module to the PBI-testing mailing list so they can be added to the PC-BSD PBI repository and made available to other PC-BSD users.

NOTE: Starting in version 0.9.7, the pbi_makeport command has support for using ccache to speed up the compile process. If ccache is installed on the host system and the CCACHE_DIR variable is set, the pbi_makeport command will automatically utilize it for the port compile phase. This can be disabled by setting NO_CCACHE=yes in /etc/pbi-make.conf on the host system, or as an optional make flag in a module's pbi.conf file.

Table 6.2.4.14 summarizes the available options:

Table 6.2.4.14: pbi_makeport Options

Switch

Description

-B

build-only; generally used with -k to build a port before running pbi_create manually

-c confdir

specify the metadata configuration directory; while not required it is highly recommended as metadata is required to create icons and binary entry-points

-d portsdir

specify an alternative ports directory; defaults to /usr/ports

-k

keep the build files after building the PBI

-o outdir

the directory to place the finished PBI file; defaults to user's $HOME directory

-p prefix

manually provide a PREFIX which determines the location where the PBI will be installed on the end-user's system

--delbuild

remove any existing build directories before starting the build

--mkdebug

will drop to a debugging shell should the port make fail

--no-prune

disable auto-pruning of non-REQUIREDBY ports after the compile phase; by default any ports which are used solely for building and which are not required for program execution will be pruned

--tmpfs

automatically create and mount a tmp filesystem and use it for WRKDIRPREFIX; can speed up port compiles on systems with available RAM

--sign keyfile

digitally sign the PBI file with the specified openssl private key file

6.2.4.15pbi_makerepo(1)

The pbi_makerepo command allows repository maintainers to create a single *.rpo file containing various information about the new repository. This .rpo file can then be installed on the target system with pbi_addrepo. Table 6.2.4.15 summarizes the available options.

Table 6.2.4.15: pbi_makerepo Options

Switch

Description

--desc description

required; description of the repo to be shown in the repo list

--key keyfile

required; OpenSSL public key used to verify the digital signature of PBIs installed from this repo

--mirror URL

required; URL in http://, https://, or ftp:// format to download PBIs and updates from

--url URL

required; URL in http://, https://, or ftp:// format to use when downloading the master INDEX file of available PBIs

6.2.4.16pbi_metatool(1)

The pbi_metatool command provides a way for repository maintainers to modify the PBI metadata in their repository in order to add or remove application categories or specified PBIs. This metadata may contain information such as Name, Description, Icon, Keywords, License, and more for the respective PBI file. Table 6.2.4.16 summarizes the available options:

Table 6.2.4.16: pbi_metatool Options

Switch

Description

add

add a category or application to the target metafile

rem

remove a category or application to the target metafile

Run the command with the desired switch to receive detailed usage options.

6.2.4.17pbi_patch(1)

The pbi_patch command is used to update an installed PBI to a different version using the small diff Push Button Patch *.pbp file. This allows the user to perform an incremental upgrade of an installed PBI. The available options are summarized in Table 6.2.4.17.

Table 6.2.4.17: pbi_patch Options

Switch

Description

-e

extract only, do not install; will extract the archive to ~/<pbidirname> unless -o is used.

-g

extract image data from header; commonly used for GUI installations

-i

display information about this PBI file

-o outdir

specify the directory to use when only extracting the PBI with -e

--checkscript

display any custom scripts used in the installation/removal of this PBI file; recommended if the PBI file is suspect in any way

--no-checksig

skip the openssl signature verification of the PBI data

--no-hash

disable using the shared hash directory which uses hard links to share files between applications

6.2.4.18pbi_update(1)

The pbi_update command is used to display information about which PBIs have available updates and to perform the updates. Table 6.2.4.18 summarizes the available options.

Table 6.2.4.18: pbi_update Options

Switch

Description

-c

check only the specified PBI for available updates

--check-all

run a full check of all installed PBIs and display list of available updates

--disable-auto

disable auto-updating of the target PBI

--enable-auto

enable auto-updating of the target PBI

--update-all

update all installed PBIs to the latest versions

6.2.4.19pbi_update_hashdir(1)

The pbi_update_hashdir command is used by the pbid daemon to merge the contents of a PBI into the hash directory.

6.2.4.20pbid(8)

The pbid command runs a small daemon which performs maintenance of installed PBIs, merges files into the shared hashdir, fetches the repository INDEX and meta files, and makes the adding and removing of PBIs much faster. It will automatically be started from the /usr/local/etc/rc.d/pbid startup script if pbid_enable="YES" is in the /etc/rc.conf file.

This utility supports the option summarized in table 6.2.4.20:

Table 6.2.4.20: pbid Options

Switch

Description

-v

enable verbose output when the daemon starts

--refresh

schedule a refresh of index and meta files

This command logs its output to /var/log/pbid.log. Check this log for errors should you experience any problems with PBI maintenance.

6.3Update Manager

PC-BSD 9.0 introduced a redesigned Update Manager to make it easy to update the underlying FreeBSD world or kernel, drivers, software installed via packages, ports, or PBIs, and to apply security updates. Unlike previous versions of PC-BSD, PC-BSD 9.0 uses the GENERIC FreeBSD kernel in order to ease kernel updating. Update Manager provides an easy to use GUI; however, the underlying mechanism is based on shell scripts. This means that advanced users don't need to run a window manager in order to use the upgrade functionality. These shell scripts use sudo so that regular user accounts can run upgrades without requiring access to the root password.

An icon located in your system tray lets you tell at a glance if any of your PBIs are out-of-date or if a system update is available. This icon has several possible states:

your system is up-to-date

the system is currently checking for updates and patches; this happens automatically whenever you boot your system

your operating system is out-of-date and system update(s) or patch(es) are available

newer versions of installed PBI(s) are available; click this icon to open AppCafe™ so that you can update the PBI(s), as described in section 6.1.2

the system was unable to check for updates, meaning you should check your Internet connection

If you right-click the icon, you will see the menu shown in Figure 6.3a:

Figure 6.3a: Right-click Menu for Update Manager

Selecting "Start the Update Manager" from the right-click menu or double-clicking the icon will open Update Manager so that you can review the available update(s).

Figure 6.3b shows a screenshot of Update Manager:

Figure 6.3b: Update Manager

If any updates are available, they will be listed; if your system is fully up-to-date, there won't be any entries.

If you hover over a listed update, a pop-up menu will provide some details about the update.

To install an update, check the update(s) that you wish to install and click the "Install selected updates" button. You can watch the update's progress as seen in Figure 6.3c:

Figure 6.3c: Installing a System Update

If the update requires a reboot, you will be notified to do so after the update has been installed. If a reboot is needed, clicking the OK button at the informational message won't reboot the system. Update Manager won't automatically reboot, meaning you can continue to use your computer for other tasks while the system is being updated. Finish whatever you are doing and reboot the computer at a time that is convenient for you.

You can see which updates are available, which have been ignored, and which have been applied by looking at the contents of /var/db/pc-updatemanager.

You can see which updates are available, which have been ignored, and which have been applied by looking at the contents of /var/db/pc-updatemanager. Each update ends in a .upd extension and has an associated SHA checksum. This .upd file contains information about the update, as seen in the following example:

Name: Fix issue with incorrect version showing as root

Date: 12-20-2011

MD5: fecd1cd157cc4092989e90c5b83e1a9f

Size: 1

Mirror: ftp://ftp.pcbsd.org/pub/

FileURL: /system-updates/9.0-RC3/patch-12202011-fixrc.txz

StandAlone: NO

RequiresReboot: NO

DetailsURL: http://www.pcbsd.org/

7Control Panel

Beginning with version 9.0, PC-BSD provides a Control Panel which contains tools for managing your system. The Control Panel is available from any desktop, meaning it is available regardless of which desktop you log into.

NOTE: if an unsupported desktop does not contain an icon or menu item for Control Panel, simply type pc-controlpanel to launch the Control Panel.

A screenshot of Control Panel can be seen in Figure 7.a:

Figure 7.a: PC-BSD Control Panel

If an icon includes a yellow exclamation mark, you will need the superuser password in order to access that configuration utility.

NOTE: your user account must be a member of the wheel group in order to use the superuser password. If your account is not a member of this group, you will not see the configuration utilities that require superuser access in the Control Panel. By default, the first user account that you create is made a member of the wheel group. You can log in as that user and use Control Panel -> User Manager to add other accounts to this group.

Control Panel includes a desktop selector menu which allows you to load the configuration utilities from KDE3 and 4, GNOME2, XFCE3 and 4, and LXDE. Figure 7.b shows the desktop selector menu. In this example, the user is currently logged into the LXDE desktop but they have chosen to view the GNOME utilities. You can tell that this is the case as the icon is the GNOME foot and the menu indicates that LXDE is "(current).

Figure 7.b: Desktop Selector Menu

NOTE: if you select another desktop or "All", you will see which additional utilities are available. However, if that desktop is not currently installed, no additional icons will be added to Control Panel. You can install additional desktops using System Manager as described in section 7.3.

This section demonstrates how to use the following utilities which are found in the Control Panel of a PC-BSD system, regardless of the desktop that is installed:

- Ports Jail

- Service Manager

- System Manager

- User Manager

- Display

- Printing

- Network Configuration

- Firewall Manager

- Life Preserver

- Warden

- Thin Client

7.1Ports Jail

Control Panel -> Ports Jail provides an environment where users who are new to FreeBSD packages and ports can safely experiment and learn how to use the FreeBSD software management command line tools without affecting the software that was installed with the operating system. A jail is a type of virtual environment where anything that occurs inside the jail does not affect the rest of the operating system.

NOTE: advanced FreeBSD users can continue to use FreeBSD packages and ports on their PC-BSD installation without using Ports Jail. However, if you do not consider yourself to be an advanced FreeBSD user, you should experiment learning how to use ports and packages within the Ports Jail utility. That is, do not run the commands described in this section from a command prompt; only run these commands from within the Ports Jail console.

This section demonstrates how to initialize the Ports Jail then how to install FreeBSD packages and compile FreeBSD ports within the Ports Jail.

7.1.1Initializing Ports Jail

To start Ports Jail, go to PC-BSD Control Panel -> Ports Jail. If you haven't yet initialized the Ports Jail, a screen will open with the following error message:

Error: The portjail is not yet installed! Please run 'portjail init' as root. Press ENTER to exit

This message is normal as 300 MB of disk space is saved by not initializing Ports Jail during PC-BSD's installation. To initialize the Ports Jail, open a terminal, become the superuser and enter this command:

portjail init

Would you like to download a pre-compiled base jail from a FreeBSD mirror via FTP/HTTP or would you like to build one from source? Enter d for download or b to build from source [d/b]:

If you enter d, you'll see messages similar to this example:

Fetching PC-BSD environment. This may take a while...

Downloading ftp://ftp.pcbsd.org/pub/mirror/9.0-RELEASE/amd64/netinstall/fbsd-release.tbz

<snip a lot of output>

Extraction finished.

Portjail setup finished! Please run 'portjail start' to enable the jail.

This method is the quickest way to initialize the Ports Jail and, depending upon the speed of your network, should only take a few minutes.

If you prefer to compile the Ports Jail yourself, instead enter b. You should be aware that depending upon your hardware, the build process may take several hours to complete. You will need to have system source installed and will receive this error if you do not:

Error: You will need a copy of FreeBSD sources in /usr/src to build the portjail.

You may checkout sources via the System Manager, CVS, SVN or other method.

You can install system source using the "Fetch System Source" button in the Tasks tab of System Manager.

Once system source is installed, you'll see messages similar to the following if you press b:

portjail init

Would you like to download a pre-compiled base jail from a FreeBSD mirror via FTP/HTTP or would you like to build one from source? Enter d to download or b to build from source [d/b]: b

Starting build of portsjail, this may take a while...

<snip a lot of output>

Extraction finished.

Portjail setup finished! Please run 'portjail start' to enable the jail.

Regardless of whether you selected d or b, when the command is finished, run portjail start to finish the jail initialization. You can now leave the command prompt and double-click the Ports Jail icon in the PC-BSD Control Panel to enter the Ports Jail.

As you can see from Figure 7.1a, Ports Jail opens in a console terminal:

Figure 7.1a: Ports Jail

The jail itself is like a self-contained FreeBSD installation. You can see what this means if you spend a few minutes comparing the outputs of commands such as ls /, pkg_info, and more /etc/rc.conf between the ports jail and a regular console. It should be noted that "self-contained" does impose limitations. For example, any ports you compile within the jail will not exist outside of the jail. However, you can still access any application installed into a jail by typing portjail run name_of_command. You can also use that command when creating a desktop icon or menu item for the installed application.

7.1.2Installing FreeBSD Packages

A FreeBSD package is an installation file that contains an application as well as installation information useful to the operation system, such as a list of dependencies (other software required by the application). Packages have been pre-tested for FreeBSD, meaning that they should be fairly easy to install and should work once installed. There are over 23,000 FreeBSD packages to choose from. FreshPorts is an excellent place to browse for packages and to research the files that get installed with a FreeBSD package.

When dealing with FreeBSD packages, the following command line utilities are used:

pkg_add: used to install packages. If you have never used this command before, take the time to read man pkg_add to get an overview of how this command works.

pkg_delete: used to uninstall packages. If you have never used this command before, take the time to read man pkg_delete to get an overview of how this command works.

pkg_info: used to get more information about the packages that have been installed. This command provides many useful switches so it is well worth your time to read through man pkg_info and to experiment with various switches.

To install a package, become the superuser from within Ports Jail and use the remote (-r) switch to install the specified package from the FreeBSD packages repository. For example, this command will install the electric package:

pkg_add -r electric

Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/Latest/electric.tbz... Done.

You should receive a message indicating that the package was successfully fetched, then your prompt back. Depending upon what is already installed in your Ports Jail, your messages may indicate that dependent packages were also fetched. Some packages include post-installation instructions that will be displayed in the message. Occasionally you will see a warning about a version mismatch; you can ignore these as they do not affect the installation of the package. Unless the message includes an error indicating that the system was unable to fetch or install the package, the installation was successful.

Since the command is issued from within Ports Jail, the installed package will not appear as a menu entry or as an icon on the desktop.

Most packages install their binary (executable) in /usr/local/bin and configuration files in /usr/local/etc/. You can find out exactly what was installed using the -L (list) switch. If you include -x, you will not have to type in the entire name and version of the package as pkg_info will match any installed packages containing your query string.

pkg_info -Lx electric | more

Information for electric-7.0.0_4:

Files:

/usr/local/bin/electric

/usr/local/share/electric/lib/.cadrc

/usr/local/share/electric/lib/ALS.help

/usr/local/share/electric/lib/AllDialogs.c

<snip rest of output>

The pkg_delete command can be used to uninstall either a package or a port from within Ports Jail. If you include the -x switch, you do not have to give the full name and version of the software. Be sure to give enough of a name so that you do not inadvertently uninstall other software matching the name:

pkg_delete -x electric

If you just get the command prompt back, the delete was successful. You can verify this by checking that the package no longer exists in the package database:

pkg_info | grep electric

You will just get your prompt back if no installed software matches that name.

If the software has other applications that depend upon it, pkg_delete will refuse to uninstall it. If you wish to override this setting, you can use the -xf switch to force the delete. However, use the force switch with caution as forcibly removing software can adversely affect the applications that required it as a dependency.

7.1.3Compiling FreeBSD Ports

A FreeBSD port is a set of instructions (contained within a Makefile) for successfully compiling the source code for an application on a FreeBSD system. The FreeBSD ports collection has been arranged into a series of software categories; each category contains a subdirectory for each application in that category. The application's directory contains the application's Makefile as well as any other files needed to compile and install the application. If you click on the CVSWeb link of an application at FreshPorts, you can read the port's Makefile. Figure 7.1b shows the CVSweb info for the electric port. To navigate to this page in your browser, go to FreshPorts, search for "electric", then click the link for electric 7.0.0_4, then click on CVSWeb.

Figure 7.1b Viewing a Port's Information at FreshPorts

If you click the link for Makefile, you can read the commit messages for every version of the Makefile; this can give you a good idea of how long the port has been available, how often it is updated, and any major changes that have occurred. Alternately, to view the current Makefile, click on the Rev. number--in this case, 1.24. The distinfo contains the checksums for the source files; again, you can either read the current revision or scroll through the list of commits. The pkg-descr contains a description of the software; if you read the revision, it will begin with the commit message. The pkg-plist contains a list of what is installed (i.e. it is the equivalent of running pkg_info -Lx as described in the FreeBSD packages section). When reading this list, mentally replace anything between %% markers with /usr/local/.

If you wish to learn how to compile ports, you will need to first install the ports collection into the Ports Jail. There are several ways to accomplish this so you should select one of the following methods. You will know that you have the ports collection when /usr/ports/ is populated with many subdirectories, each representing a category of software.

Method 1: Go to Control Panel-> System Manager. After inputting the administrative password, click on the Tasks tab, seen in Figure 7.1c:

Figure 7.1c: Installing the Ports Collection using the Tasks Tab of System Manager

In the "Ports Console" section, click "Fetch Ports Tree" and a pop-up window will indicate that it is fetching ports and that it may take a while. Be patient, as it is downloading and installing a tarball that is about 50MB in size. Note that you do not want to select the option to "Fetch System Ports Tree" as this will install ports onto the main system rather than into the Ports Jail.

Method 2: Make sure that you are in the Ports Jail, become the superuser using the su command, then issue these commands:

cd /usr

fetch ftp://ftp.freebsd.org/pub/FreeBSD/ports/ports/ports.tar.gz

tar xzvf ports.tar.gz

Method 3: Make sure that you are in the Ports Jail, become the superuser using the su command, then issue this command:

portsnap fetch extract

Once you have the ports collection installed into your Ports Jail, change to the subdirectory of the application you wish to install, for instance /usr/ports/cad/electric, and issue the command to make and install the application:

cd /usr/ports/cad/electric

make install clean

How long this command will take can range from a few minutes to many hours, depending upon the size of the application and the speed of your system. The make command will spit out many messages, most of which you can ignore as they are simply indications of what source is currently being compiled. Occasionally a menu will appear asking you to select from a list of options. When in doubt, keep the default options. If you understand the options, you can use your arrow and enter keys to toggle an option on or off. When finished, use the tab key to navigate to OK and press enter to continue the compilation process. Occasionally, make will encounter an error and will stop with an error message. If the solution for the error is not obvious to you, try Googling for the keywords in the error message. Keep in mind that this is a learning exercise and that you may be forced to learn some things along the way.

7.2Service Manager

Service Manager, seen in Figure 7.2a, provides an easy-to-use graphical utility for managing PC-BSD services. The listed services can be enabled/disabled at system startup and their current status can be toggled to stopped or running. To access this utility, go to PC-BSD Control Panel -> Service Manager. You will be prompted to input the administrative password.

Figure 7.2a: Managing Services Using Service Manager

By default, services will be listed alphabetically. You can reorder the services by clicking on the Service Name, Running, or Enabled header.

Service Manager is a graphical front-end to the rc scripts located in /etc/rc.d. PC-BSD 9.1 will include an Info button where you can get a short description of the highlighted service.

If you don't know what a service does, you shouldn't change its settings in Service Manager. If you'd like to learn more about a service, try seeing if there is a man page for it. For example, type man apm or man bootparamd. If a man page does not exist, try seeing what man pages are associated with that keyword. For example:

apropos accounting

ac(8)                    - connect time accounting

acct(2)                  - enable or disable process accounting

acct(5)                  - execution accounting file

accton(8)                - enable/disable system accounting

ipfw(4)                  - IP packet filter and traffic accounting

pac(8)                   - printer/plotter accounting information

pam_lastlog(8)           - login accounting PAM module

sa(8)                    - print system accounting statistics

7.3System Manager

This section describes the various tasks that can be performed using System Manager.

7.3.1Generating a Diagnostic Report

System Manager, shown in Figure 7.3a, is launched by clicking Control Panel -> System Manager. You will have to input the administrative password to allow the System Manager window to open.

Figure 7.3a: General Tab of System Manager Utility

The General tab displays the following system information:

- the version of PC-BSD

- the version of the underlying FreeBSD base

- the CPU type and speed

- the amount of physical memory

The Generate button can be used to create a report that includes the following items:

- the output of the dmesg command, which shows messages from the kernel

- the last few lines of the /var/log/messages log file

- the output of the pciconf -lv command, which lists all the devices that were found when the system booted

- your X configuration file, which shows your display settings

- your /etc/rc.conf file, which shows your startup settings

- your /boot/loader.conf file, which shows which drivers are loaded at boot time

- the output of the command df -m, which shows your amount of free disk space

- a listing from the top command, which shows the currently running processes

When you click the Generate button, you will be prompted to input the name and location of the text file that will be created. Since it is a text file, you can view its contents in any text editor. When troubleshooting your system, this file is handy to include in your forum post or mailing list message.

7.3.2Setting an Update Mirror

The Mirrors tab of System Manager, seen in Figure 7.3b, allows you to configure which PC-BSD mirror is used in order to check for and install updates to the operating system or installed PBIs. The default selection is to use the closest geographic mirror. Occasionally, this mirror is busy or may not contain the PBI or update that you wish to install. To change the default mirror, click the "Select Mirror from list" button and select a mirror from the drop-down list.

Figure 7.3b: Mirrors Tab of the System Manager Utility

If your company maintains its own repository of PBIs or updates, you can select the "Specify a custom mirror" button and input the IP address of the company's server.

7.3.3Install/Uninstall Desktops and System Components

During the installation of PC-BSD you had an opportunity to install desktops and system components. Should you wish to review these components, install missing components, or remove installed components, you can do so in Control Panel -> System Manager. After inputting the superuser password, click on the System Packages tab, shown in Figure 7.3c:

Figure 7.3c: Available Components in System Manager

Check the boxes for the components that you wish to install, uncheck the boxes for the components that you wish to remove, then click the Apply Changes button to perform the requested operations.

7.3.4Install FreeBSD Source and Ports

During the installation of PC-BSD you had an opportunity to install FreeBSD source and ports. If you did not and wish to do so after installation, use the Tasks tab of System Manager, shown in Figure 7.3d:

Figure 7.3d: Tasks Tab of the System Manager Utility

This tab is divided into two sections:

Ports Console: this section contains one option, to "Fetch Ports Tree". This will install the FreeBSD ports collection into the Ports Jail.

System Tasks - Advanced Users Only: this section contains two options, to "Fetch System Source" and to "Fetch System Ports Tree". These options will install source or the ports tree into /usr/. If you are not familiar with how to build FreeBSD kernels, world, or ports, you should not perform these tasks on your primary desktop. Instead, practice inside a virtual machine or on a test system.

If you click the "Fetch System Source" button, you will see the screen shown in Figure 7.3e:

Figure 7.3e: Downloading System Source Using System Manager

The first time you access this screen, the Selected CVSup server will show as UNSET, meaning you will get an error if you click the Start button until you select a server to download source from. To select the server, click the Find Fastest button to open the screen shown in Figure 7.3f:

Figure 7.3f: Finding the Fastest Server to Download Source From

By default the All box is checked, meaning that System Manager will connect to each possible server to determine which server has the fastest response time. If you already know which server you would like to use or wish to narrow the choices down to a geographic region, uncheck this box, highlight the desired country name(s) and use the right arrow button to move the selection to the Selected box. When ready, click the Start button. After a few moments, the progress bar will move to 100% and System Manager will list the name of the fastest server. Click Yes to select the server and its address will now appear as the Selected CVSup server.

By default, the checkbox next to "all" is checked (as seen in Figure 7.5f) as you typically want to download all system source. Advanced users can uncheck this box and check the sections of source they wish to download. To download source, click the Start button; System Manager will show its progress by indicating which source files are being downloaded. Once the download is complete, the word "Finished!" will appear in the upper left corner and you can click the Close button to exit this screen.

7.3.5Set Miscellaneous Options

The Misc tab of System Manager is seen in Figure 7.3g:

Figure 7.3g: Misc Tab of the System Manager Utility

The Boot Screen section of this tab allows you to configure whether or not the PC-BSD splash image appears during boot and the language of the splash screen. Uncheck this box if you prefer to watch the boot messages instead of the splash image. Localized versions of the PC-BSD splash screen are installed in the /usr/local/share/pcbsd/splash-screens/ directory. If you click the Custom button, you can browse to the location of a customized splash screen. Note that the splash screen must be in the .pcx format.

The Other Options section of this tab contains a checkbox to "Force IBUS keyboard input. Check this box if you wish to to input Chinese, Japanese, Korean or Indic characters using a Latin keyboard.

7.4User Manager

The PC-BSD User Manager utility allows you to easily add and delete users and groups on your system, as well as change a user's or the administrative password. To access this utility, go to Control Panel -> User Manager. After inputting the administrative password, you should see a screen similar to Figure 7.4a, though the names of your users accounts will vary:

Figure 7.4a: Viewing User Accounts in User Manager

In this example, the system has 2 user accounts. The "dru" account has the ability to become the superuser as the "Can administrate system" checkbox is checked.

The password for any user can be changed by first highlighting the user name then clicking the "Change Password" button. Since the superuser is using this utility, you will not be prompted for the old password in order to reset the password; this can be handy if a user has forgotten their password and can no longer log into the PC-BSD system. If you click the "Change Admin Password" button, you can change the password that is used whenever you are prompted for administrative access.

If you click the "Advanced View" button, this screen will change to show all of the accounts on the system, not just the user accounts that you created. An example is seen in Figure 7.4b.

Figure 7.4b: Viewing All Accounts and Their Details

The accounts that you did not create are known as system accounts and are needed by the operating system or installed applications. This means that you should not delete any accounts that you did not create yourself; doing so may cause a previously working application to stop working. Advanced view provides additional information associated with each account, such as the user ID number, full name (description), home directory, default shell, and primary group. System accounts usually have a shell of "nologin" for security reasons, meaning that an attacker can't try to login to the system using that account name.

Figure 7.4c shows the add user account creation screen--click the Add button to open this screen:

Figure 7.4c: Creating a New User Account

NOTE: if you click the Add button while in Simple View, you will only be prompted to enter the username, full name, and password.

The following information is needed to create a new user or system account:

Username: this is the name the user will use when they log in to the system; it is case sensitive and can not contain any spaces. If you are creating a system account needed by an application, use the name provided by the application's installation instructions. If the name that you type in already exists as an account, it will be highlighted in red and the utility will prompt you to use another name.

Full Name: this field provides a description of the account and can contain spaces. If it is a user account, use the person's first and last name. If it is a system account, you can input a description to remind you which application uses the account.

Home Directory: you can leave this field empty for a user account as the system will automatically create a home directory for them under /home/username. However, if you are creating a system account it is important to override this default by typing in /var/empty or /nonexistent unless the application's installation instructions specify that the account needs a specific home directory.

Shell: this drop-down menu contains the shells that are available for user accounts when they work from a command prompt. You can either keep the default or select a shell which the user prefers.

Primary Group: if you leave the default button of "New Group" selected, a group will be created with the same name as the user. This is usually what you want unless you are creating a system account and the installation instructions specify a different group name. Note that the drop-down menu for specifying a group name will only show existing groups, but you can quickly create a group as described in the groups tab below.

Password: the password is case-sensitive and needs to be typed in twice in order to confirm the password.

Once you have made your selections, press the Ok button to create the account.

If you click the Groups tab, you can view all of the groups on the system, as seen in Figure 7.4d. If you click the Groups tab while in Simple View, you will only see the groups that you created or which were created for you when you added a new user.

Figure 7.4d: Managing Groups Using User Manager

This screen has 3 columns:

Groups: shows all of the groups on the system.

Available: shows all of the system and user accounts on the system in alphabetical order.

Members: indicates if the highlighted group contains any user accounts.

To add an account to a group, highlight the group name in the first column. Then, highlight the account name in the available column. Click the right arrow and the selected account will show in the members column. You should only add user accounts to groups that you create yourself or when an application's installation instructions indicate that an account needs to be added to a group.

If you click the Add button, a pop-up menu will prompt you for the name of the new group. Once you press OK, the group will be added to the Groups column.

If you click the Remove button, the highlighted group will automatically be deleted after you press the Apply button, so be sure to do this with care. Again, don't remove any groups that you did not create yourself or applications that used to work may stop working.

7.5Display

PC-BSD's display wizard can be used to configure your video driver and display settings.

NOTE: if you have an NVIDIA card, install the NVIDIA driver first in Control Panel -> System Manager -> System Packages -> Hardware-Drivers.

To access the display wizard, go to Control Panel -> Display. You will receive the message shown in Figure 7.5a:

Figure 7.5a: Save Your Work Before Changing Display Settings

If you need to save any work first, press No and restart the Display wizard when you are ready. Once you select Yes, you will be prompted for the superuser password. The system will reboot into the display wizard, shown in Figure 7.5b:

Figure 7.5b: Display Settings Wizard

Here you can select your desired screen resolution, color depth and the video driver. PC-BSD should list the name of your video card, however, it may select the "vesa" driver which should always work but will provide sub-optimal performance. Click on the drop-down menu to select the driver that most closely matches your video card name.

You can also use the drop-down menus to change the screen resolution and color depth values. If the value you desire is not listed, it may be that the selected driver does not support that resolution or depth.

Advanced users can select their monitor's horizontal sync and vertical refresh rate in the Advanced tab, seen in Figure 7.5c:

Figure 7.5c: Advanced Tab of Display Settings

Use caution and refer to your monitor's documentation if you make any changes here. If you're not sure what you're doing, leave the default values as-is.

If your computer is connected to two monitors, check the box "Enable Dual-Head support".

When you are finished, click the Apply button for your settings to be tested. If anything goes wrong during testing, you should be taken back to this Display Settings screen so that you can amend the details. Once you are satisfied with the settings, click Yes when prompted to accept them.

7.5.1Desktop Effects and Compiz

To prevent problems with video cards that do not support desktop effects, these are disabled by default. You can enable these effects if your video card supports them. How to do so depends upon the desktop.

Within KDE, click Control Panel -> System Settings -> Desktop Effects to access the configuration screen shown in Figure 7.5d:

Figure 7.5d: Enabling Desktop Effects in KDE

Check the box "Enable desktop effects at startup". You can use the All Effects tab to get more information about each possible effect and to enable the effects that interest you.

For the other desktops, you can install Compiz using Control Panel -> System Manager -> System Packages -> Misc -> Compiz. Once installed, you can configure Compiz within GNOME by clicking System -> Preferences -> CompizConfig Settings Manager. This will open the screen shown in Figure 7.5e:

Figure 7.5e: Configuring Compiz in GNOME

You can also open this screen by typing ccsm from any desktop.

7.5.2Troubleshooting

Until DRI/GEM/KMS is fully supported in PC-BSD, certain video drivers will not take full advantage of the hardware feature set. This typically affects 3d effects on ATI and Radeon cards. If the screen goes blank or otherwise doesn't work when you select the HD version of the driver, selecting the non-HD version should allow you to use the card.

If you are having problems with your display settings and would like to manually edit /etc/X11/xorg.conf or run Xorg --config, you will want to first tell the PC-BSD system to not automatically start X for you. You can do this by putting a # (comment) in front of the following line in /etc/ttys:

ttyv8 "/usr/PCBSD/bin/pdm" xterm on secure

Reboot the system after saving your change and it will boot into the console only. You can then try the instructions in the FreeBSD Handbook to manually configure and test Xorg. Once you have a configuration that works for you, save it to /etc/X11/xorg.conf, remove the # from that line in /etc/ttys, and restart the system.

If your graphics white-out after a suspend or resume, try running this command as the superuser:

sysctl -w hw.acpi.reset_video=1

If that fixes the problem, carefully add this line to /etc/sysctl.conf:

hw.acpi.reset_video=1

7.6Printing

Like many open source operating systems, PC-BSD uses the Common Unix Printing System (CUPS) to manage printing. PC-BSD's Control Panel provides a graphical printing utility for adding and managing printers.

While the graphical utility is easy to use, it may or may not automatically detect your printer depending upon how well your printer is supported by an open source print driver. This section will walk you through a sample configuration for a HP PhotoSmart 3210 printer. Your printer may “just work", allowing you to breeze through the configuration screens. If it does not, you will want to read this section more closely for hints on how to locate the correct driver for your printer.

7.6.1Researching your Printer

Before configuring your printer, it is worth the time to see if a print driver exists for your particular model, and if so, which driver is recommended. If you are planning to purchase a printer, this is definitely good information to know beforehand. You can look up the vendor and model of the printer in the Open Printing Database which will indicate if it is supported and if there are any known caveats with the print driver.

Figure 7.6a shows a search for our example printer. While the particular model is 3210, the closest driver is in the 3200 series.

Figure 7.6a: Using Open Printing Database to Locate a Driver

Once the model is selected, click on the “Show this printer” button to see the results, as demonstrated in Figure 7.6b.

Figure 7.6b: Driver Recommendation from Open Printing Database

For this model, the HPLIP driver is recommended and the printer is compatible to the HP DeskJet 990C. In PC-BSD 9.0, the HPLIP driver is available as an optional system component. You can see if the driver is installed, and install it if it is not, using Control Panel -> System Manager -> System Packages -> Hardware-Drivers as seen in Figure 7.6c.

Figure 7.6c: Installing the HPLIP Driver

7.6.2Adding a Printer

Once you know that your printer is supported, make sure that the printer is plugged into your computer or, if the printer is a network printer, that both your computer and the printer are connected to the network. Then, go to Control Panel -> Printing. After inputting the administrative password, you will see a window similar to Figure 7.6d:

Figure 7.6d: Printer Configuration Utility

To add a new printer, click New -> Printer. The printing utility will pause for a few seconds as as the wizard searches to see if any printers are connected to your computer or network. When it is finished, you should see a screen similar to Figure 7.6e.

Figure 7.6e: Select a Print Device

In this example, the wizard has found this printer and highlighted the entry for HP Photosmart 3200 (MY65BB21VW045K). The wizard should find any supported printer that is attached to the computer or network and list it as the highlighted entry in the Devices frame. If it doesn't automatically find your printer, read section 7.6.3 Manually Adding a Driver.

If it finds your printer, simply click Forward to advance to the screen shown in Figure 7.6f:

Figure 7.6f: Describe Printer Screen

Since the configuration wizard found the printer in the previous screen, the Describe Printer screen automatically fills out the printer model series, a description, and the hostname of your computer, if the printer is locally attached, or the hostname of the network printer. If you wish, you can change the printer's name or description. Once you click the Apply button, the wizard will ask if you would like to print a test page. Ensure the printer has paper and click Yes to print the test page. If you can not print a successful test page, see section 7.6.4 Printer Troubleshooting.

Once the printer is created, a screen will open where you can set the properties of the printer. Our sample printer's properties screen is shown in Figure 7.6g:

Figure 7.6g: Viewing the Settings of the Newly Created Printer

You may wish to take a few minutes to review the settings in Policies, Access Control, Printer Options, and Job Options tabs as these allow you to configure options such as print banners, permissions, the default paper size, double-sided printing, etc.

7.6.3Manually Adding a Driver

If the print configuration wizard doesn't automatically list your printer, double-check that it is supported as described in section 7.6.1 Researching your Printer and that HPLIP is installed if it is a HP printer. Also check that the printer is plugged in and powered on.

You can also try to manually add your printer. In the Select Device screen (Figure 7.6e) you will need to highlight and configure the type of connection to the printer:

USB: this entry will only appear if a printer is plugged into a USB port and the number of entries will vary depending upon the number of USB ports on the system. If there are multiple USB entries, highlight the one that represents the USB port your printer is plugged into.

Other: this option allows you to manually type in the URI to the printer. A list of possible URIs is available here.

AppSocket/HP JetDirect select this option if you are connecting to an HP network printer. You will need to input the IP address of the printer in the Host field and change the port number if the printer is using a port other than 9100.

IPP: select this option if you are connecting to a printer cabled to another computer (typically running a Microsoft operating system) that is sharing the printer using IPP. You will need to input the IP address of the printer in the Host field and the name of the print queue. You can then click the Verify button to ensure that you can connect to the print queue.

LPD/LPR: select this option if you are connecting to a printer which is cabled to a Unix computer that is using LPD to share the printer. You will need to select the hostname and queue name from the drop-down menus.

After making your selection and clicking Forward, you will see the screen in Figure 7.6h.

Figure 7.6h: Manually Selecting a Driver

This screen provides three options for installing the driver. When selecting the driver, look for the one that was recommended by the Open Printing Database for your model.

1. Select printer from database: if you highlight the manufacturer name and click Forward, you will see a list of drivers to choose from. In the example shown in Figure 7.6i, the user has selected HP as the manufacturer. If you see the recommended driver, highlight it and click Forward to continue with the printer configuration. If you do not see the recommended driver, click the Back button and try option 2 or 3.

2. Provide PPD file: a PostScript Printer Description (PPD) is a driver created by the manufacturer that ends in a .ppd extension; sometimes the file will end with a .ppd.gz extension, indicating that it has been compressed with gzip. If the driver you are looking for was not in the database, see if there is a PPD file on the driver CD that came with the printer or available for download from the manufacturer's website. If so, you can browse to the location of that file using the screen shown in Figure 7.6j, then click Forward to continue with the printer configuration.

3. Search for a printer driver to download: if you know the name of the driver that you are looking for, try typing its name or number into the Search box. If found, it will display in the Printer model drop-down menu.

Figure 7.6i: Selecting a Driver from the Database

Figure 7.6j: Selecting a PPD

7.6.4Printer Troubleshooting

If you have followed these instructions but still can't successfully print, you may find your answer here. Here are some solutions to common printing problems:

A test page prints but it is all garbled: this typically means that you are using the wrong driver. If your specific model was not listed, click the Change button in the "Driver Details" section of the Settings tab of the printer and try choosing another driver model that is close to your model number. If trial and error does not fix the problem, see if there are any suggestions for your model in the Open Printing database. A Google search for the word freebsd followed by the printer model name may also help you to find the correct driver to use.

Nothing happens when you try to print: in this case it is useful to review the messages in the print error log which is located at /var/log/cups/error_log. A useful test is to type tail -f /var/log/cups/error_log in a console and then to try printing. Any new messages will be printed to the console. If the solution is not obvious from the error messages, try Googling the error message. If you're still stuck, post the error, the model of your printer, and your version of PC-BSD to either the Hardware Support forum or the Support Mailing List.

7.7Network Configuration

During installation, PC-BSD configures your network interfaces to use DHCP. In most cases, this means that your connected interfaces should "just work" whenever you use your PC-BSD system.

PC-BSD 9.0 also includes a wireless configuration icon in the system tray. If you have an enabled wireless interface, PC-BSD will automatically scan for wireless networks and, if you have created any network profiles, try to associate using the listed order of your profiles. If you hover over the wireless icon, as seen in Figure 7.7a, it will indicate if the interface is associated and provide information regarding the IP address, IPv6 address, SSID, connection strength, connection speed, MAC address, and type of wireless device.

Figure 7.7a: Wireless Information in System Tray

If you right-click the wireless icon, you will see a listing of all found wireless networks. Simply click the name of a network to associate with it. The right-click menu also provides options to configure the wireless device, start the Network Manager, restart the network (useful if you need to renew your DHCP address), and to close the network monitor so that the icon no longer shows in the system tray. If you have multiple wireless devices, each will have its own icon in the system tray. If you don't use one of the devices, use "close the network monitor" to remove it from the tray.

You still have the ability to view or manually configure your network settings using Control Panel -> Network Configuration, seen in Figure 7.7b.

Figure 7.7b: Network Configuration Utility

If a new device has been inserted (e.g. a USB wireless interface), a pop-up message will open when you start Network Configuration,indicate the name of the new device and ask if you would like to enable it. Click Yes and the new device will be displayed with the list of network interfaces that PC-BSD recognizes. In the example seen in Figure 7.7b, this system has one Realtek Ethernet interface that uses the re driver and a wireless interface that uses the wlan driver.

NOTE: the 0 next to each driver name indicates that it is the first interface that uses that driver. If, for example, the system had two Realtek cards, the second interface would be labeled as re1. You can learn more about the capabilities of a driver by reading its manpage (without the number). In this example, the associated man pages are man re and man wlan.

The rest of this section will describe each tab of the Network Configuration utility and demonstrate how to view and configure the network settings for both Ethernet and wireless devices. It will then present some common troubleshooting scenarios, known issues, and suggestions for when a device does not have a built-in driver.

7.7.1Devices: Ethernet Adapters

If you highlight an Ethernet interface in the Devices tab and either click the Configure button or double-click the interface name, you will see the screen shown in Figure 7.7c:

Figure 7.7c: Network Settings for an Example re0 Ethernet Interface

There are two ways to configure an Ethernet interface:

1. Use DHCP: this method assumes that your Internet provider or network assigns your addressing information automatically using the DHCP protocol. Most networks are already setup to do this. This method is recommended as it should "just work".

2. Manually type in the IP addressing information: this method requires you to understand the basics of TCP/IP addressing or to know which IP address you should be using on your network. If you don't know which IP address or subnet mask to use, you will have to ask your Internet provider or network administrator.

By default, the "Obtain IP automatically (DHCP)” option is selected. If you wish to manually type in your IP address, uncheck this box. Type in the IP address, using the right arrow key or the mouse to move between octets. Then, double-check that the subnet mask (Netmask) is the correct value and change it if it is not.

By default, the "Disable this network device" box is unchecked. If you do not want this interface card to be configured whenever you boot your computer, uncheck this box. If you decide later that you do want to use this network card, go back into the Network Configuration utility and recheck this box.

The Advanced tab, seen in Figure 7.7d, allows advanced users to change their MAC address and to use DHCP to automatically obtain an IPv6 address. Both boxes should remain checked unless you are an advanced user who has a reason to change the default MAC or IPv6 address and you understand how to input an appropriate replacement address.

Figure 7.7d: Advanced Tab of an Ethernet Interface's Network Settings

The Info tab, seen in Figure 7.7e, will display the current network address settings and some traffic statistics. If you check the checkbox to disable the network device, it will immediately stop the interface from using the network. The interface will stay inactive until this checkbox is unchecked.

Figure 7.7e: Viewing an Ethernet Interface's Network Settings and Traffic Statistics Using the Info Tab

If you make any changes within any of the tabs, click the Apply button to activate them. Click the OK button when you are finished to go back to the main Network Configuration window.

You can repeat this procedure for each network interface that you wish to view or configure.

7.7.2Devices: Wireless Adapters

If your wireless interface does not automatically associate with a wireless network, you probably need to configure a wireless profile that contains the security settings required by the wireless network. To access these settings, either double-click the wireless icon in the system tray or highlight the wireless interface displayed in the Devices tab of Network Configuration and click the Configure button. Figure 7.7f demonstrates that this system's wireless interface is currently not associated with any wireless networks as there aren't any listed in the "Configured Wireless Network Profiles" section:

Figure 7.7f: Wireless Configuration Window of Network Configuration Utility

To associate with a wireless network, click the Scan button to receive the list of possible wireless networks to connect to. Highlight the network you wish to associate with and click the "Add To Profiles" button. If you add multiple networks, use the arrow keys to place them in the desired connection order. PC-BSD will try to connect to the first profile in the list and will move down the list in order if it is unable to connect.

If the network is open and does not require any authentication no further configuration is required. If the network uses privacy, a pop-up message will indicate that you need to set the proper security encryption and the icon next to the entry will have a red X over the lock to indicate that it is an unconfigured connection to a secured wireless network. Highlight the profile and click the Edit button to enter the configuration screen shown in Figure 7.7g.

Figure 7.7g: Configuring Wireless Authentication Settings

If the SSID of the network is not displayed (in the example seen in Figure 7.7g the value "signal 100%)" is shown instead of the correct SSID), replace the incorrect value with the correct SSID. If the wireless network uses a BSSID, check the box "Using BSSID".

This screen allows you to configure the following types of wireless security:

- Disabled: indicates that the network is open and no additional configuration is required.

- WEP: this type of network can be configured to use either a hex or a plaintext key. If you click WEP then the Configure button, you will see the screen shown in Figure 7.7h. Type the key into both network key boxes. If the key is complex, check the "Show Key" box to make sure that the passwords are correct and that they match; you can uncheck this box when you are finished to replace the characters in the key with the * symbol. A wireless access point that uses WEP can store up to 4 keys; the number in the key index indicates which key you wish to use.

- WPA Personal: this type of network uses a plaintext key. If you click WPA Personal then the Configure button, you will see the screen shown in Figure 7.7i. Type in the key twice to verify it. If the key is complex, you can check the "Show Key" box to make sure the passwords match.

- WPA Enterprise: if you click WPA Enterprise then the Configure button, you will see the screen shown in Figure 7.7j. Select the authentication method (EAP-TLS, EAP-TTLS, or EAP-PEAP), input the EAP identity, browse for the CA certificate, client certificate and private key file, and input and verify the password.

NOTE:If you are unsure which type of encryption is being used, ask the person who setup the wireless router. They should also be able to give you the value of any of the settings seen in these configuration screens.

Figure 7.7h: WEP Security Settings

Figure 7.7i: WPA Personal Security Settings

Figure 7.7j: WPA Enterprise Security Settings

Once you have input the correct values for the wireless network, click the Close button, then the Save button. The icon for the entry should now be a lock without the red X. To connect to the wireless network, click the Apply button. If all went well, there should be an IP address and status of "associated" when you hover over the wireless icon in the system tray. If this is not the case, double-check for typos in your configuration values and read section 7.7.6 Troubleshooting Network Settings.

If you wish to disable this wireless interface, check the box "Disable this wireless device". This setting can be desirable if you want to temporarily prevent the wireless interface from connecting to untrusted wireless networks.

The Advanced tab, seen in Figure 7.7k, allows you to input a custom MAC address or to assign a static IP address. This is similar to the Advanced tab for an Ethernet interface in that these settings are meant for advanced users.

Figure 7.7k: Advanced Tab of a Wireless Interface

The Info tab, seen in Figure 7.7l, shows the current network status and statistics for the wireless interface:

Figure 7.7l: Info Tab of a Wireless Interface Displays its Network Status and Statistics

7.7.3Network Configuration (Advanced)

The Network Configuration (Advanced) tab of the Network Configuration utility is seen in Figure 7.7m:

Figure 7.7m: Network Configuration (Advanced) tab of the Network Configuration Utility

This tab is divided into three sections. If you wish to edit these settings, make sure that the interface that you wish to configure is highlighted in the Devices tab.

The following settings can be modified in the "System configuration settings" section:

DNS 1: the IP address of the primary DNS server.

DNS 2: the IP address of the secondary DNS server.

Search Domain: the name of the domain served by the DNS server.

Hostname: the name of your computer.

Gateway: the IP address of the network's default gateway.

The following settings can be modified in the "Enable IPv6 Support" section:

Enable IPv6 support: if this box is checked, the specified interface can participate in IPv6 networks and the IPv6 settings will no longer be greyed out.

IPv6 gateway: the IPv6 address of the default gateway used on the IPv6 network.

IPv6 DNS 1: the IPv6 address of the primary DNS server used on the IPv6 network.

IPv6 DNS 2: the IPv6 address of the secondary DNS server used on the IPv6 network.

The Misc section contains one configurable option:

Enable wireless/wired failover via lagg0 interface: the lagg interface allows you to seamlessly switch between using an Ethernet interface and a wireless interface. If you want this functionality, check this box.

NOTE: some users experience problems using lagg. If you have problems connecting to a network using an interface that previously worked, uncheck this box and remove any references to "lagg" in your /etc/rc.conf file.

If you make any changes within this window, click the Save button to apply them.

7.7.43G and PPP Settings

The 3G/PPP tab, shown in Figure 7.7n, is used to tether a 3G phone or to configure a modem connection to a PPP or PPPoE network.

Figure 7.7n: Configuring 3G or PPP Networking

Your Internet provider will provide you with the settings they require to negotiate a connection. To configure your connection, check the "PPP/3G wireless configuration" check box. This will un-grey out the following settings so you can input the required values:

Username: input the username given to you by your provider.

Password: input the password given to you by your provider.

Service name (optional): some providers require a service name. If you have one, input it here; otherwise, leave this field empty.

Dialer AT commands: if your provider requires any AT commands, input them here.

PPPoE Device: click the drop-down menu to select the device name for your modem. If it is a dialup modem, the device name will begin with cua. If it is a PPPoE connection, select the name of the Ethernet device attached to the modem.

Always on connection: do not check this box if you are charged by the amount of time that you are connected.

Internet Connection Sharing: if you wish to share your Internet connection with the rest of the computers in your network, check this box.

Obtain DNS via PPP: check this box to receive the DNS settings from the provider's DHCP server.

Send 3G PIN: if your phone requires you to send a 4 digit PIN before it can enter tether mode, input the PIN and click the "Send 3G PIN" button.

7.7.5Proxy Settings

The proxy settings tab, shown in Figure 7.7o, is used when your network requires you to go through a proxy server in order to access the Internet.

Figure 7.7o: Proxy Settings Configuration

Check the "Proxy Configuration" check box to activate the settings. The follow settings can be configured in this screen:

Server Address: enter the IP address or hostname of the proxy server.

Port Number: enter the port number used to connect to the proxy server.

Proxy Type: if the proxy server uses the SOCKS5 protocol, select this option. Otherwise, leave it at the default of HTTP.

Specify a Username/Password: check this box and input the username and password if they are required to connect to the proxy server.

NOTE: proxy settings are saved to the /usr/local/etc/pcbsd.conf configuration file which is read by PBI and PC-BSD related utilities. Other applications, such as web browsers or window managers, may require you to configure proxy support in their own configuration utility.

7.7.6Troubleshooting Network Settings

While Ethernet networking usually "just works" on a PC-BSD system, users sometimes encounter problems, especially when connecting to wireless networks. Sometimes the problem is due to a configuration error; sometimes a driver is buggy or is not yet available. This section is meant to help you pinpoint the problem so that you can either fix it yourself or give the developers the information they need to fix or create the driver.

7.7.6.1Useful Files and Commands

When troubleshooting your network configuration, you need to be aware of the following files and commands:

1. /etc/rc.conf

This file is read when the system boots up. In order for the system to configure an interface at boot time, an entry must exist for it in this file. Entries are automatically created for you during installation for each interface that is active. An entry will be added (if it does not exist) or modified (if it already exists) when you use the Configuration section of an interface using the Network Configuration utility.

Here is an example of the rc.conf entries for an ethernet driver (re0) and a wireless driver (run0):

ifconfig_re0="DHCP"

wlans_run0="wlan0"

ifconfig_wlan0="WPA"

When reading through your own file, look for lines that begin with ifconfig. For a wireless interface, also look for lines containing wlans.

NOTE: unlike Linux interface driver names, FreeBSD/PC-BSD interface driver names indicate the type of chipset. Each driver name has an associated man page where you can learn which devices use that chipset and if there are any configuration options or limitations for the driver. When reading the man page, don't include the interface number. In the above example, you could read man re and man run.

2. /etc/wpa_supplicant.conf

This file is used by wireless interfaces and contains the information needed to connect to a WPA network. If this file does not already exist, it is created for you when you enter the Configuration screen of a wireless interface.

3. ifconfig

This command shows the current state of your interfaces. When reading through its output, check that your interface is listed, has a status of "active", and has an IP address. Here is a sample ifconfig output showing the entries for the re0 Ethernet interface and the run0 wireless interface:

re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500

options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>

ether 60:eb:69:0b:dd:4d

inet 192.168.1.3 netmask 0xffffff00 broadcast 192.168.1.255

media: Ethernet autoselect (100baseTX <full-duplex>)

status: active

run0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290

ether 00:25:9c:9f:a2:30

media: IEEE 802.11 Wireless Ethernet autoselect mode 11g

status: associated

wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500

ether 00:25:9c:9f:a2:30

media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)

status: no carrier

ssid "" channel 10 (2457 MHz 11g)

country US authmode WPA1+WPA2/802.11i privacy ON deftxkey UNDEF

txpower 0 bmiss 7 scanvalid 60 protmode CTS wme roaming MANUAL

bintval 0

In this example, the ethernet interface (re0) is active and has an IP address. However, the wireless interface (run0, which is associated with wlan0) has a status of "no carrier" and does not have an IP address. In other words, it has not yet successfully connected to the wireless network.

4. dmesg

This command lists the hardware that was probed during boot time and will indicate if the associated driver was loaded. If you wish to search the output of this command for specific information, pipe it to grep as seen in the following examples:

dmesg | grep Ethernet

re0: <RealTek 8168/8111 B/C/CP/D/DP/E PCIe Gigabit Ethernet> port 0xc000-0xc0ff mem 0xd0204000-0xd0204fff,0xd0200000-0xd0203fff irq 17 at  device 0.0 on pci8

re0: Ethernet address: 60:eb:69:0b:dd:4d

dmesg |grep re0

re0: <RealTek 8168/8111 B/C/CP/D/DP/E PCIe Gigabit Ethernet> port 0xc000-0xc0ff mem 0xd0204000-0xd0204fff,0xd0200000-0xd0203fff irq 17 at  device 0.0 on pci8

re0: Using 1 MSI messages

re0: Chip rev. 0x28000000

re0: MAC rev. 0x00000000

miibus0: <MII bus> on re0

re0: Ethernet address: 60:eb:69:0b:dd:4d

re0: [FILTER]

re0: link state changed to DOWN

re0: link state changed to UP

dmesg | grep run0

run0: <1.0> on usbus3

run0: MAC/BBP RT3070 (rev 0x0201), RF RT2020 (MIMO 1T1R), address 00:25:9c:9f:a2:30

run0: firmware RT2870 loaded

5. pciconf

If your interface does not show up in ifconfig or dmesg, it is possible that a driver for this card is not provided with the operating system. If the interface is built into the motherboard of the computer, you can use the pciconf command to find out the type of card. Here is an example:

pciconf -lv | grep Ethernet

device     = 'Gigabit Ethernet NIC(NDIS 6.0) (RTL8168/8111/8111c)'

pciconf -lv | grep wireless

device     = 'Realtek RTL8191SE wireless LAN 802.11N PCI-E NIC (RTL8191SE ?)'

In this example, there is a built-in Ethernet device that uses a driver that supports the RTL8168/8111/8111c chipsets. As we saw earlier, that driver is re0. The built-in wireless device was also found but the ? indicates that a driver for the RTL8191SE chipset was not found. A Google search for "FreeBSD RTL8191SE" will give an indication if a driver exists (perhaps in a version of FreeBSD that has not been released yet) or if a driver is being developed. You can also use Google to locate a Windows driver and try using the ndisgen command, as described here, to convert it to a FreeBSD driver.

The FreeBSD Handbook chapter on Wireless Networking provides a good overview of how wireless works and offers some troubleshooting suggestions.

7.7.7bwn(4) and bwi(4) Drivers

Due to licensing restrictions, the bwn and bwi drivers require that their firmware is compiled on the individual's computer. This means that Broadcom BCM43xx IEEE 802.11b/g wireless network adapters will not “just work” after installing PC-BSD.

To compile the firmware, you will need to install both the ports tree and source on your PC-BSD system. You can do so by going to Control Panel -> System Manager. After inputting the administrative password, click on the Tasks tab, seen in Figure 7.7p:

Figure 7.7p: Using System Manager to Install Ports and Source

In the "System Tasks - Advanced Users Only" section, click "Fetch System Source" if /usr/src/ does not currently exist on your system.

In the "System Tasks - Advanced Users Only" section, click "Fetch System Ports Tree" if /usr/ports/ does not currently exist on your system.

Both src and ports are large so it will take a few minutes for each fetch to finish. When the fetch is finished, compile the firmware using the instructions for the driver that you need. You will need to be the superuser in order to compile the firmware.

7.7.7.1For the bwn driver:

cd /usr/ports/net/bwn-firmware-kmod && make install clean

This will create two kernel modules:

- bwn_v4_ucode module (used by most adapters)

- bwn_v4_lp_ucode (used by low power PHY adapters)

It's a good idea to test which module is used by your adapter, so type:

kldload bwn_v4_ucode

If that command just gives your prompt back without an error, that is the correct module. If you receive an error, try loading the low power module instead which should just give you your prompt back without an error:

kldload bwn_v4_lp_ucode

Now carefully add the following two lines to /boot/loader.conf:

bwn_v4_ucode_load="YES"

if_bwn_load="YES"

NOTE: replace bwn_v4_ucode_load="YES" with bwn_v4_lp_ucode_load="YES" if your adapter is a low power one.

7.7.7.2For the bwi driver:

cd /usr/ports/net/bwi-firmware-kmod && make install clean

This will create the following kernel module:

- bwi_v3_ucode.ko

To load the module:

kldload bwi_v3_ucode.ko

And carefully add the following line to /boot/loader.conf so the module will automatically load whenever you boot:

bwi_v3_ucode_load="YES"

7.7.8If a Driver Does Not Exist

If your driver does not exist, you may be able to convert a Windows driver to a FreeBSD kernel module using the instructions on the Wireless Testing page. If your chipset is not listed in Table 1 of that page, please add an entry indicating whether or not you were able to successfully convert and use the driver for your architecture.

If you are still unable to get your network interface to work, see section 9 Finding Help. When describing your problem, include the following information:

- the version and architecture of PC-BSD you are using (e.g. PC-BSD 9.0, 32-bit)

- the name of the chipset used by the interface

- the applicable entries in /etc/rc.conf

- if you include the /etc/wpa_supplicant.conf for your wireless adapter, sanitize the psk value so you don't tell the world what the password is on your wireless network (e.g. replace the actual password with ***** or something similar)

7.8Firewall Manager

PC-BSD uses the PF firewall to protect your system. By default, the firewall is configured to let your system make Internet connections, use the ping utility, and to communicate with other Windows and Unix-like systems using SMB and NFS.

Advanced users who are already familiar with pf will find the default rulebase in /etc/pf.conf. Users who aren't familiar with directly editing this file can instead use the Firewall Manager GUI utility to view and modify the existing firewall rules.

NOTE: typically it is not necessary to change the firewall rules. You should not remove any existing rules unless you fully understand what the rule does. Similarly, you should only add rules if you understand the security implications of doing so, especially if the rule allows connections to your computer.

To access the Firewall Manager, go to Control Panel -> Firewall Manager and input the administrative password. Figure 7.8a shows the initial screen when you launch this utility:

Figure 7.8a: Firewall Manager Utility

The General Settings tab of this utility allows you to:

- determine whether or not the firewall starts when the system boots; unless you have a reason to do so and understand the security implications, this box should remain checked so that your system is protected by the firewall

- start, stop, or restart the firewall: if you add, delete, or modify a firewall rule, you should restart the firewall for your changes to take effect

- restore default configuration: this button allows you to return to the original, working configuration should you not like the changes you make to your firewall rules

To view or modify the firewall rules, click on the Exceptions tab, seen in Figure 7.8b:

Figure 7.8b: Adding a New Firewall Rule

In this example, the user has clicked on the "Add entry" button to add a new firewall rule. The following information is needed when creating a rule:

- Service or Port: you can either select the name of the service you wish to allow or block from the drop-down menu or type in the number of the port used by the service. Which you choose does not matter as the firewall will match the name and number for you and display both after you save the rule.

- Policy: you need to choose whether to allow or block this service/port.

- Direction: use the drop-down menu to determine whether the policy applies to incoming or outgoing connections; the direction is from the perspective of your computer i.e. do you want others to connect to your service (incoming) or do you want to connect the service running on another system (outgoing).

- Protocol: use the drop-down menu to select whether the service uses the TCP or UDP protocol.

- Interface: use the drop-down menu to select the interface that will make or receive the connection.

Once you have made your selections, press Ok to save the new rule.

NOTE: the new rule will not be used by the firewall until the firewall is restarted. Click the Restart button if you wish to test the rule or start using it immediately.

You should take a moment to test that your new rule(s) work as expected. For example, if you create a rule to allow an SSH connection, try connecting to your PC-BSD system using SSH to verify that the firewall is now allowing the connection.

7.9Life Preserver

The built-in Life Preserver utility allows you to automate backups of your home directory. Backups are stored on a remote system; for the purposes of this section, we'll refer to the remote system as a backup server. Life Preserver uses SSH and rsync, meaning that the backup server must have SSH and rsync installed. If the backup server is another PC-BSD system, these are already installed and configured for you. If the remote system is running another operating system, you will have to ensure that SSH and rsync are installed and that SSH is listening for connections. Regardless of the operating system on the backup server, you will need to open TCP ports 22 and 873 using the firewall software installed on the backup server.

NOTE: you can also use FreeNAS, an open source NAS solution based on FreeBSD, as the backup server. Instructions for configuring FreeNAS to accept Life Preserver backups can be found in the September 2011 issue of BSD Magazine.

Life Preserver is not the only way to make a backup. For example, you may find it easier to drag and drop the files/directories that you wish to backup to an external device, such as a USB drive, using one of the file manager utilities listed in section 8.6.1 File Managers and File Structure. You'll also find a few PBIs of backup utilities using AppCafe™. The advantage of Life Preserver is that it allows you to easily schedule backups of your home directory to a backup server.

7.9.1Creating a Backup

A shortcut to the Life Preserver utility, seen in Figure 7.9a, can be found in your system tray. This icon is animated and will show when a backup is taking place.

Figure 7.9a: Life Preserver Icon in System Tray

Simply double-click the icon to start the backup wizard shown in Figure 7.9b. You can also find this utility in Control Panel -> Life Preserver Backup.

Figure 7.9b: Life Preserver Welcome Screen

Once you click the Get Started button, the Add New Life Preserver Wizard will launch, allowing you to configure a backup. Click Next to see the screen in Figure 7.9c:

Figure 7.9c: Remote Device Configuration Screen

You will need to input the following information:

Host Name: of the remote system that will store your backup. If the backup server is on your local network, the host name must be in your hosts file or in the database of the local DNS server. You may find it easier to instead input the IP address of the backup server as this will eliminate any host name resolution problems.

User Name: this user must have permission to log in to the system that will hold the backup. If the account does not already exist, you should create it first on the backup server.

SSH Port: port 22, the default port used by SSH is selected for you. You only need to change this if the remote system is using a non-standard port to listen for SSH connections. In that case, use the up/down arrows or type in the port number.

NOTE: if there is a firewall protecting the remote system, make sure that it allows connections to the specified port number from the IP address of the system that you wish to backup. If the backup server is running PC-BSD, you can use Control Panel -> Firewall Manager to add an entry for SSH.

Once you click the Next button, you can decide whether or not to schedule regular backups, as seen in Figure 7.9d:

Figure 7.9d: Selection Screen to Automate Backups and Determine Their Frequency

By default, automatic backups are disabled, meaning you will have to manually start a backup when you wish to do so. If you decide to automate backups, you can choose to backup daily or weekly. After making your selection, click Next and you will see the informational message in Figure 7.9e:

Figure 7.9e: Life Preserver is Now Ready to Test the Connection to the SSH Server

Click the Finish button and a terminal will open where you can enter the password for the user account you specified, as seen in Figure 7.9f:

Figure 7.9f: Logging into the SSH Server

If this is the first time you have ssh'd to this host, you will have to type yes to accept the RSA key fingerprint before being prompted to type in the password. If the connection is successful, the terminal will close and your new preserver will show in the main panel, shown in Figure 7.9g:

Figure 7.9g: Life Preserver Shows a New Preserver

The entry contains the following information:

Preserver Name: will indicate the user account and IP address of the backup server.

Last Backup: will indicate whether or not the last backup was successful. If you chose to automate backups, the first backup will happen immediately. Otherwise, a backup will not occur until you press the Start button. How long the first backup takes depends upon the size of your home directory and the speed of your network.

Frequency: will indicate disabled, daily, or weekly.

Status: running indicates that the backup is occurring now, otherwise will show as not running.

The backup will be stored on the remote system in the home directory of the user that was used by Life Preserver to login. The contents of the backup will be found in the life-preserver/<backup>/ subdirectory where <backup> is named according to the date and time stamp of the backup. The contents of the directory will mirror the directory structure of your home directory, making it very easy to find and restore individual files or directories from the backup server to your PC-BSD system.

7.9.2Configuration Options

If you right-click a preserver and select Edit, you will see the configuration screen shown in Figure 7.9h.

Figure 7.9h: Life Preserver Configuration Options

This screen allows you to configure the following:

Number of backups to keep: make sure that there is enough disk space on the backup server to store this amount of backups. If you do daily backups, a setting of 7 will keep a week's worth. If you do weekly backups, a setting of 4 or 5 will keep about a month's worth.

Remove incomplete or failed backups: by default, Life Preserver attempts to conserve disk space on the backup server by removing any failed backups. Uncheck this box if you are troubleshooting Life Preserver.

Disable automatic backups: if this is selected, a backup will only occur when you manually press the Start button.

Backup daily: if this is selected, a backup will occur once per day.

Backup weekly: if this is selected, a backup will occur on the day of the week you select.

Remote directory: a subdirectory with the name you specify will be created in the home directory of the user that logs in to the SSH server; this is where backups will be stored. The default subdirectory name is life-preserver.

Modify include list: provides a graphical interface for adding files/directories to include in the backup. Clicking this button will open the List Editor seen in Figure 7.9i:

Modify exclude list: opens the List Editor for adding files/directories to exclude from backups.

Figure 7.9i: Adding Entries to the Include List

When using List Editor, be sure to type the full pathname to the file or directory that you wish to include or exclude from the backup.

7.9.3Restoring a Backup

To restore files from a backup, right-click the preserver entry and select "Restore From". Life Preserver will query the backup server and show a list of available backups as seen in the example in Figure 7.9j:

Figure 7.9j: Selecting a Backup from the List of Available Backups

When reading the backup name, the number before the "T" is the date in YYYY-MM-DD format and the number after the T is the date stamp in HH_MM_SS format. Highlight the backup you wish to restore and click the "Select Backup" button to open the window seen in Figure 7.9k:

Figure 7.9k: Selecting the Files to Restore

If you wish to restore an individual file or directory, input its full path. In the example shown in Figure 7.9k, the user is restoring the directory /usr/home/dru/Documents--in other words, the Documents subfolder backed up from the home directory of the user named dru.

If you just input the name of the file or directory and click the Restore button, it will be restored to its original location and replace any files with the same name at that location.

If you instead check the "Restore Relative to specified directory" box, the selected file/directory will be restored to the location you specify.

7.10Warden™

The Warden™ is an easy to use jail management program. Using The Warden™, it is possible to create virtual environments which can be used to run services,such as Apache, PHP, or MySQL in a secure manner. Each jail is considered to be a unique FreeBSD operating system and whatever happens in that jail will not effect your operating system or other jails running on the system.

7.10.1Installing Warden™

Use AppCafe™ to install Warden™.The installation will prompt you for the administrative password. Once installed, it will be added as an entry to Control Panel. Figure 7.10a shows a search for warden within AppCafe™:

Figure 7.10a: Installing The Warden™ Using AppCafe™

Once the PBI is installed, you can launch The Warden™ by clicking on Control Panel -> Warden™. You will be prompted for the administrative password as only the superuser can create and manage jails.

NOTE: Warden™ also installs an ncurses version which allows you to perform the same tasks from a console. To access this version, type sudo warden menu from a terminal. The screen layout for this version is different and the screens are accessed using the arrow and enter keys rather than the mouse.

7.10.2Using the Warden™ GUI

The first time you start The Warden™, you will be presented with the main window, which should be empty as seen in Figure 7.10b:

Figure 7.10b: Initial Warden™ Screen

To create your first jail, go to File -> New Jail. A pop-up menu, seen in Figure 7.10c, will prompt you to enter the details for the jail.

Figure 7.10c: Creating the New Jail

The following information is needed to create a jail:

IP Address: this is the address you will use to ssh into the jail and access its contents. Choose an address that is not already in use on your network by another computer or jail. Use your arrow keys to move between the octets of the address as you type it in.

Hostname: you can change the default of "Jailbird" to another value. The hostname must be unique on your network.

Include system source: if you check this box, /usr/src/ will be populated with FreeBSD source. Source is needed if you wish to build world or recompile the kernel within this jail.

Include ports tree: if you check this box, the ports tree will be installed into /usr/ports/. This will allow you to compile FreeBSD ports within this jail.

Start jail at system bootup: if this box is checked, the jail will be started (become available) whenever you boot your main system. If the box is not checked, you can manually start the jail whenever you wish to access it using The Warden™.

When you are finished, click the Create button. You will be prompted to set the root password and create a user account for this jail, as seen in Figure 7.10d. Since the jail will be accessible using ssh, both of the passwords should be secure.

Figure 7.10d: Setting the Login Information for the Jail

Once you click the Save button, The Warden™ will display status messages as it builds the new jail, as seen in Figure 7.10e. When it is finished, a Close button will appear that you can click on to return to the main screen.

Figure 7.10e: The Warden™ is Creating the New Jail

Once the jail is created, it will be listed in the main screen. In the example shown in Figure 7.10f, there is one jail with an IP address of 192.168.0.23 and a hostname of Jailbird. This jail is currently stopped and it is not set to automatically start when the PC-BSD system boots.

Figure 7.10f: Viewing the Current Status of a Jail

To view the jail's configuration, highlight its entry then select Jails -> Configuration. Figure 7.10g shows an example of this jail's configuration:

Figure 7.10g: Viewing a Jail's Configuration

The following information is configurable:

Jail Network Interface: Warden™ will automatically select the interface that is connected to the network containing the jail's IP address. In this example, the IP address is on an internal, private network attached to the re0 Ethernet address.

Jail Directory: this is the directory on the PC-BSD system that contains the jail's filesystem. There will be a sub-directory for each jail with the same name as the jail's IP address. If you ever wish to backup your jail, this is the directory to backup.

Temp Directory this is the directory that will hold any temporary files created by the jail.

To start a jail, right-click its entry and select "Start this Jail" from the menu seen in Figure 7.10h. Once the jail has been started, you will be able to ssh to its IP address using the username and password you configured for the jail. Once you have logged into the jail, you can do anything that you could do on a FreeBSD system. This is a good way to learn how to use FreeBSD without affecting your PC-BSD desktop. The FreeBSD Handbook is a handy reference for learning how to perform almost any task on a FreeBSD system.

Figure 7.10h: Options Available For a Jail

A jail's right-click menu contains the following options:

Start this Jail: will change a jail's Status from Stopped to Running. You will not be able to ssh into a jail until it is Running.

Toggle Autostart: will toggle a jail's Autostart between Disabled (does not automatically start when the PC-BSD system is booted) and Enabled (will start the jail when the PC-BSD system is booted).

Install Inmate into jail: an inmate is a pre-configured software installation that allows you to quickly get a service up and running within a jail. This feature will be re-implented in 9.1 so that you can add inmates from within Warden™.

View installed packages: will show the output of pkg_info to determine which software, if any, has been installed within the jail.

Export jail to .wdn file: this type of file is described in the Exporting/Importing Jails section.

Delete Jail: this will remove the jail and all of its contents from the PC-BSD system.

7.10.3 Exporting/Importing Jails

Exporting a jail allows you to save the jail (and all of its software, configuration, and files) as a .wdn file. This allows you to quickly clone a pre-configured jail to a new jail.

To create a .wdn file, right-click the jail and select "Export jail to a .wdn file". You will be prompted to choose the directory in which to store the backup. A progress bar will indicate that the backup is in progress. Creating the file may take some time, especially if you have installed src, ports, or software.

NOTE: you should not be logged into the jail while exporting it as Warden™ will need to stop the jail in order to back it up. If your jail is running services (e.g. a webserver), you should select to export the jail at a time that will least impact network connections to the jail.

The exported jail will end with a .wdn extension and the filename will be the IP address of the jail.

To create a new jail using the .wdn backup, select File -> Import Jail. You will be prompted to browse to the location of the .wdn file. Once selected, you will be prompted whether or not to use the same IP address for the new jail. If you are creating a new jail on the same system that still has the original jail installed, select No and input the IP address for the new jail. However, if you have deleted the original jail or need to restore that same jail on another computer (for example, there was a hardware failure on the system containing the original jail), you can choose to use the same IP address. You will then be prompted whether or not to use the same hostname. Again, only say Yes if that hostname is no longer in use; otherwise, select No and input a unique hostname for the jail. Warden™ will then recreate the jail with all of the original settings. Whether or not those settings include the original IP address and hostname depends upon your selections.

7.11Thin Client

Beginning with PC-BSD 9.0, a script to create a thin client server is included with the operating system. This allows your PC-BSD system to automatically configure a network of diskless computers. Each computer will need a network interface card capable of PXE booting. Once connected, users at these workstations can access and modify the contents of their home directory, which is saved on the thin client server, as well as run any applications which have been installed on the PC-BSD system.

7.11.1Building the Thin Client Server

To prepare your PC-BSD system for thin client server configuration, perform these tasks first:

1. If the diskless clients will require Internet access, install two network cards where one NIC is connected to the Internet and the other is connected to a private LAN from which the thin clients can PXE boot from.

2. The PC-BSD system should have lots of RAM installed, especially if multiple clients will be connecting. It is recommended to use a 64-bit system with as much RAM installed as possible.

3. Make sure system ports is installed in /usr/ports/. If this directory is empty or does not exist, you can install ports using the "Fetch System Ports Tree" button in the Tasks tab of System Manager.

4. Set aside a few hours as the system will need to rebuild its world and the applications it needs in order to support the PXE environment. The script will automatically build a 32-bit environment (even on a 64-bit system) as most PXE boot clients are 32-bit.

To configure the PC-BSD system as a PXE server, run the following script as the superuser:

pc-thinclient

/usr/local/bin/pc-thinclient will install the components to convert this system into a thin-client server.

Continue? (Y/N) y

If you have not installed a DHCP server, a menu will appear where you can select the configure options for the DHCP server. Use your arrow keys to navigate to an option and the enter key to toggle between selecting and deselecting the highlighted option. If you're unsure, leave the options at their default settings. When finished, use the tab key to navigate to OK and press enter to start the build of the DHCP server. Once the DHCP server is installed, the script will build the PXE environment:

Fetching FreeBSD environment... This may take a while...

Extracting FreeBSD environment... This may take a while...

Copying /usr/ports -> /home/thinclient/usr/ports

<snip long output>

Setting up system for PXE booting...

What NIC do you wish DHCPD to listen on? (I.E. re0) em0

Input the name of the interface that is attached to the local network containing the diskless workstations. In the example shown here, the user has input the em0 interface. The script will now configure the specified interface and start the required services:

Starting /etc/rc.d/nfsd...OK

Starting /etc/rc.d/inetd...OK

Starting /usr/local/etc/rc.d/isc-dhcpd...OK

Your system is now setup to do PXE booting! Reboot for all the changes to take effect.

You can now reboot the system into the new PXE environment.

The thin client script installed and configured the following services:

NFS: the Network File System is a protocol for sharing files on a network. It has been configured to allow clients on the network attached to the interface that you specified to connect to the thin client server. Its configuration file is located in /etc/exports.

TFTP: the Trivial File Transfer Protocol is a light-weight version of FTP used to transfer configuration or boot files between machines. The PXE network cards on the diskless computers will use TFTP to receive their configuration information. This service was enabled in /etc/inetd.conf with a home directory of /home/thinclient.

DHCP: the Dynamic Host Configuration Protocol is used to configure IP addressing info on the diskless workstations. It has been configured to assign addresses for the network attached to the interface that you specified. Its configuration file is located in /usr/local/etc/dhcpd.conf.

The thin client script also created the pxeboot user with the default password thinclient. This username and password is used to save the working Xorg configuration files for each of the diskless computers. It is highly recommended that you change this password right away by running this command as the superuser:

passwd pxeboot

7.11.2Using the Thin Client Server

Using the Thin Client Server is relatively easy. After a successful installation and reboot of the server, DHCPD should now be running on the NIC you specified during the installation. Simply connect a hub/switch to this NIC and connect a PXE capable system to the switch. When you boot the thin client system, PXE should obtain an IP address and begin to load PC-BSD.

After the boot process has finished, the client will be brought to this prompt:

No saved xorg-config for this MAC: <Mac Address>

Do you wish to setup a custom xorg.conf for this system? (Y/N)

If you wait 10 seconds, this message will timeout, and the client will bring up X in 1024x768 mode. However, if this isn't the resolution you wish to use, type "Y" and hit enter to bring up the Xorg Configuration screen. In this menu, you will be able to setup your own custom xorg.conf file, auto-detect settings, and test the new configuration.

After you have tested the Xorg configuration for the client, choose "Save working config" to send this configuration to the Server. You will be prompted for the password of the pxeboot user. The file will be saved by the client's MAC address in /home/pxeboot/mnt/xorg-config/<mac>.conf. Now when you reboot the client, it will automatically startup using this saved xorg.conf file and bring the system to the login screen.

The client's boot environment is located in /home/pxeboot. This is mounted read-only during the PXE boot process to allow the client to bootup and create an XDCMP connection to the server.

8Common Tasks

This section discusses how to perform common tasks that weren't discussed in the Control Panel section. This section contains the following categories:

- Java, Flash, and Fonts

- Multimedia

- MythTV

- XBMC

- Windows Emulation

- Files and File Sharing

- Remote Desktop

- Media Streaming

- Video Conferencing

- Security

8.1Java, Flash, and Fonts

This section demonstrates how to install Java, Flash, and fonts to improve your desktop experience.

8.1.1Java

The OpenJDK PBI provides an open source implementation of the Java Platform. It includes the IcedTea java browser plugin which automatically works within the FireFox, Chrome, and Opera web browsers without any additional configuration. To install this PBI, search for "jdk" within AppCafe™.

8.1.2Flash

PC-BSD installs and configures the Adobe Flash player (version 10) plugin for you. This means that flash should "just work" when browsing the web. You'll find several web browsers in the Web Browsers category of AppCafe™, including Firefox, Opera, and Chromium.

If flash does not seem to be working, running the following command as your regular user account should fix the problem:

flashpluginctl on

8.1.3Fonts

8.1.3.1Installing Microsoft True Type Fonts

If you would like to install Microsoft True Type fonts, click on the AppCafe™ icon on your Desktop. Search for "fonts" in the search bar and you should see a result similar to Figure 8.1a:

Figure 8.1a: Using AppCafe™ to Install MS TrueType Fonts

Click the download button to install the fonts PBI. It will automatically setup your system to use these fonts.

8.1.4Installing Custom Fonts

If you already have a collection of fonts that you have downloaded or purchased, you can configure your PC-BSD system to use these fonts. Which utility you use depends upon which desktop(s) you have installed.

NOTE: many fonts are available from FreshPorts by searching for "font". If you find a font you like, FreshPorts will indicate the pkg_add command that is used to add that font to your system. Any font installed using pkg_add should not require any additional configuration to "just work". The rest of this section demonstrates how to install fonts that you have downloaded manually or purchased from the Internet.

To install custom fonts within KDE, go to System Settings → Font Installer. In Figure 8.1b, "All Fonts" is currently selected under the Group column, showing all of the fonts installed on this system.

To install your fonts, highlight "Personal Fonts" under the Group column, then click the +Add button. This will allow you to browse to the font you wish to add. You can add multiple fonts in the same directory by holding down the Ctrl key while making your selection. Click the Open button, which will install the font for you. When it is finished, a pop-up message will indicate that you will need to restart any open applications for the font change to take affect. Your newly installed font(s) should now show up in the "Personal Fonts" section in the Groups column and be available to the applications you use.

Figure 8.1b: Using KDE's Font Installer to Install Custom Fonts

To install custom fonts within GNOME, go to Applications -> Utilities -> File Manager. Navigate to the location of the font that you would like to install and either double-click the font name or select Font Viewer from the icon's right-click menu. This will open the font in Font Viewer, allowing you to view it. If you like the font, click the Install Font button to make it available to your applications. In the example shown in Figure 8.1c, the user is installing the BlackFlag font.

Figure 8.1c: Using GNOME's Nautilus to Install a Custom Font

To install custom fonts within XFCE, use System -> Thunar File Manager. Once you browse to the location of the font and double- or right-click it, you will see the same Font Viewer used by GNOME.

For any desktop, you can use nautilus or thunar to install fonts. Depending upon which desktop(s) you have installed, these utilities may or may not already be installed. If nothing happens when you type their name, you can install either utility using AppCafe™.

8.2Multimedia

Your PC-BSD system has been pre-configured to allow you to play multimedia in many formats. For example, if you insert a music CD or a video DVD, supported desktops will indicate that a new media is available and will offer options for accessing that media. Depending upon the desktop, several player applications may already be installed for playing various media formats. Most desktops also provide a graphical utility for configuring sound devices and inputs/outputs.

For desktops that don't provide a built-in device notifier or who don't support PC-BSD's built in devd system, an amountd script runs in the background to provide this functionality for USB devices. This means that the desktop should still notify you if a media is inserted into a USB CD/DVD device. If you insert a CD/DVD media into an internal CD/DVD device and your desktop does not notify you, you can still mount the media manually as the superuser. This command will mount a CD inserted into the first internal CD device:

mount -t cd9660 /dev/cd0 /media

While web browsing, you should be able to play most media formats, including Youtube videos, Internet radio, and many trailer and movie sites.

NOTE: If you happen to come across a file that you can not play in a web browser or media player, it is probably because it is in a proprietary format that requires a licensing fee or restricts distribution of the codec that is required to play that media format.

The Multimedia category of AppCafe™ contains several dozen applications for playing and editing multimedia. It includes these popular applications (click the links to view screenshots):

- Amarok: music player that includes integrated support for many web services such as Last.fm, Magnatune, Echo Nest, Ampache, MP3Tunes, Jamendo, OPML, and Librivox.

- Ardour: digital audio workstation that provides non-destructive, non-linear editing with unlimited undo and more than 200 LADSPA & LV2 plugins.

- aTunes: full-featured audio player and manager that can play mp3, ogg, wma, wav, flac, mp4 and radio streaming, allowing users to easily edit tags, organize music and rip audio CDs.

- Audacity: multilingual audio editor and recorder.

- gtkpod: graphical user interface for the Apple iPod.

- Miro: HD video player that can play almost any video file and offers over 6,000 free Internet TV shows and video podcasts.

- Rhythmbox: integrated music management application

8.2.1Troubleshooting Sound

By default, PC-BSD loads the snd_hda.ko driver at boot time. This is a meta-driver that automatically loads all supported sound cards. This means that sound usually "just works".

If your sound does not work, type mixer. You should receive output similar to the following:

Mixer vol      is currently set to 100:100

Mixer pcm      is currently set to 100:100

Mixer mic      is currently set to  50:50

Mixer mix      is currently set to  60:60

Mixer rec      is currently set to  75:75

Mixer igain    is currently set to 100:100

Mixer ogain    is currently set to 100:100

If any of these settings are set to 0, set them to a higher value, by specifying the name of the mixer setting as seen in this example:

mixer vol 100

Setting the mixer vol from 0:0 to 100:100.

If you only get one or two mixer settings instead of the settings shown above, you need to change the default mixer channel. As the superuser, try this command:

sysctl -w hw.snd.default_unit=1

To see if that changed to the correct channel, type mixer again. If you still only have one or two mixer settings, try setting the sysctl value to 2, and if necessary, to 3.

Once you have all of the mixer settings and none are set to 0, your sound should work. If it does not, see the section 9 Finding Help. When reporting your problem, include your version of PC-BSD and the name of your sound card.

Recommended Reading

FreeBSD Sound Wiki

8.3MythTV

MythTV is an open source software digital video recorder (DVR) that is an alternative to Tivo or Windows Media Center. It allows you to pause and rewind live TV shows, skip commercials, schedule TV show recordings, and control a settop box using an infrared remote or firewire. In order to use MythTV, you will need a video capture card. Hardware requirements are described on the MythTV Wiki.

NOTE: in PC-BSD, webcamd is used to provide the drivers for video capture cards. This is enabled by default, meaning any devices supported by Video for Linux should “just work”.

During the installation of PC-BSD the installer provided an option to install MythTV. If you wish to install MythTV afterwards, use Control Panel -> System Manager -> System Packages -> Misc. Once MythTV is installed, an entry should be added to the Multimedia section of the application menu of your desktop. You can also run MythTV from the command line by typing /usr/local/share/pcbsd/scripts/mythtv.sh.

8.3.1Running MythTV for the First Time

The PC-BSD version of MythTV provides an initialization script to properly setup the database backend used by MythTV. The first time you run MythTV, you will be prompted for the superuser password in order to configure MythTV. After inputting the superuser password, a console will temporarily open indicating that the MySQL service is starting and the MySQL database is being created. Once that is complete, you will see the configuration GUI shown in Figure 8.3a.

Figure 8.3a: MythTV Configuration GUI

NOTE: your mouse will not work in this GUI. This is by design as MythTV was meant for use with a remote control or a keyboard. Use your arrow and tab keys to highlight the desired options and press enter to select.

The initial screen will prompt you to select your Country and Language. Once the desired options are highlighted, navigate to Save and press enter. The next screen, shown in Figure 8.3b indicates that MythTV will update your database schema. Navigate to Upgrade and press enter.

Figure 8.3b: Upgrading the Database Schema

Once you press enter, you should receive a message indicating the location of the backup file that will be created should the upgrade fail. Navigate to Upgrade again and press enter to perform the upgrade. After a few seconds, you should see the MythTV front-end screen shown in Figure 8.3c:

Figure 8.3c: MythTV Configuration Screen

Use your arrow keys to navigate to the configuration screen you wish to access, then press enter. To leave a screen, press ESC. To exit the front-end completely, press ESC, arrow to "Yes please" and press enter.

Chapters 10-12 of the MythTV Howto demonstrate the possible configurations and how to schedule recordings.

Additional Resources:

MythTV Documentation

FreeBSD Webcam and DVB Compatibility List

8.4XBMC

XBMC is a GPL licensed software media player and entertainment hub for digital media. XBMC can play most popular audio and video formats. It can play CDs and DVDs from a disk or image file and even files inside ZIP and RAR archives. It can scan all of your media and automatically create a personalized library with album covers, descriptions, and fan art.

NOTE: before installing XBMC, make sure that your system meets the minimum hardware requirements. The XBMC team recommends using an NVIDIA GeForce 6150 or later.

During the installation of PC-BSD the installer provided an option to install XBMC. If you wish to install XBMC afterwards, use Control Panel -> System Manager System Packages -> Misc. Once XBMC is installed, an entry should be added to the Multimedia section of the application menu of your desktop. You can also start XBMC by typing xbmc from a command prompt.

If you have never used XBMC before, take some time to skim through the XBMC Quick Start Guide and the XBMC Online Manual.

8.5Windows Emulation

Wine is an application that allows you to create a Windows environment for installing Windows software. This can be useful if your favourite Windows game or productivity application has not been ported to Linux or BSD.

Wine is not guaranteed to work with every Windows application. If you are unsure if the application that you require is supported, search for it in the Browse Apps section of the Wine Application Database. The Wine Wiki contains many resources to get you started and to refer to if you encounter problems with your Windows application.

8.5.1Installing and Using Wine

Wine can be installed from AppCafe™. In Figure 8.5a, the user has performed a search to find the Wine PBI. You should install the version that is correct for your architecture (32-bit or 64-bit).

Figure 8.5a: Installing Wine from AppCafe™

Once installed, an icon for Wine Configuration will be added to the Control Panel and, depending upon your desktop, a desktop icon may be created as well. Double-clicking this icon will load the Wine configuration menu shown in Figure 8.5b. You can also start this program by typing winecfg at the command line.

Figure 8.5b: Wine Configuration Menu

Click the Add application button to browse to the application's installer file. By default, the contents of your hard drive will be listed under "drive_c". If the installer is on a CD/DVD, use the drop-down menu to browse to your home directory -> .wine -> dosdevices folder. The contents of the CD/DVD should be listed under d:. If they are not, the most likely reason is that your CD/DVD was not automatically mounted by the desktop. To mount the media, type the following as the superuser:

mount -t cd9660 /dev/cd0 /cdrom

You should hear the media spin and be able to select the installer file. Once selected, press Apply then OK to exit the configuration utility.

To install the application, click the Wine File Manager icon on the desktop or type winfile to see the screen shown in Figure 8.5c:

Figure 8.5c: Installing the Application Using winfile

Click the button representing the drive containing the installer (in this example, D:\) and double click on the installation file (e.g. setup.exe). The installer should launch and you can proceed to install the application as you would on a Windows system.

NOTE: if you had to manually mount the CD/DVD, you will need to unmount it before it will eject. As the superuser, use the command umount /mnt.

Once the installation is complete, browse to C:\ and find the application's location. Figure 8.5d shows an example of running Internet Explorer within winfile.

Figure 8.5d: Running the Installed Application

8.6Files and File Sharing

This section describes the various file managers that are available for managing the files on your PC-BSD system. It then shows how you can configure your PC-BSD system to share files with other systems in your network using Samba.

8.6.1File Managers and File Structure

Depending upon which desktops you have installed, different graphical file manager utilities are available for PC-BSD. Note that you don't need to be logged into a window manager to use an installed file manager. For example, if KDE is installed, you can run its file manager from any desktop by typing dolphin. The supported desktops provide their own file managers while most of the unsupported desktops assume that you will install your favourite file manager. Table 8.6a summarizes the available file managers and indicates which desktop they are installed with. Some file managers can be installed independent of a desktop using AppCafe™ to install the PBI. Once a file manager is installed, type its name if you wish to run it from another desktop.

Table 8.6a: Available File Managers

File Manager

Desktop/PBI

Screenshots

dolphin

KDE

http://dolphin.kde.org/features.html

emelfm2

PBI

http://emelfm2.net/wiki/ScreenShots

/usr/local/GNUstep/Apps/

FSViewer.app/FSViewer

Window Maker

http://www.bayernline.de/~gscholz/linux/fsviewer/

krusader

PBI

http://www.krusader.org/screenshots.php

mucommander

PBI

http://www.mucommander.com/screenshots.php

nautilus

GNOME

http://live.gnome.org/Nautilus/Screenshots

pcmanfm

LXDE or PBI

http://lxde.org/easy_fast_file_management_pcmanfm

thunar

XFCE or PBI

http://www.xfce.org/projects/thunar

xfe

PBI

http://roland65.free.fr/xfe/index.php?page=screenshots

When working with files on your PC-BSD system, save your own files to your home directory. Since most of the files outside of your home directory are used by the operating system and applications, you should not delete or modify any files outside of your home directory, unless you know what you are doing.

Table 8.6b summarizes the directory structure found on a PC-BSD system. man hier explains this directory structure in more detail.

Table 8.6b: PC-BSD Directory Structure

Directory

Contents

/

pronounced as "root" and represents the beginning of the directory structure

/bin/

applications (binaries) that were installed with the operating system

/boot/

stores the startup code, including kernel modules (such as hardware drivers)

/compat/linux/

Linux software compatibility files

/dev/

files which are used by the operating system to access devices

/etc/

operating system configuration files

/etc/X11/

the xorg.conf configuration file

/etc/rc.d/

operating system startup scripts

/home/

subdirectories for each user account; each user should store their files in their own home directory

/lib/

operating system libraries needed for applications

/libexec/

operating system libraries and binaries

/media/

mount point for storage media such as DVDs and USB drives

/mnt/

another mount point

/proc/

the proc filesystem required by some Linux applications

/rescue/

necessary programs for emergency recovery

/root/

administrative account's home directory

/sbin/

operating system applications; typically only the superuser can run these applications

/tmp/

temporary file storage; files stored here may disappear when the system reboots

/usr/bin/

contains most of the command line programs available to users

/usr/local/

contains the binaries, libraries, startup scripts, documentation, and configuration files used by applications installed from ports or packages

/usr/pbi/

contains the binaries, libraries, startup scripts, documentation, and configuration files used by installed PBIs

/usr/local/share/fonts/

system wide fonts for graphical applications

/usr/local/share/icons/

system wide icons

/usr/ports/

location of system ports tree (if installed)

/usr/share/

system documentation and man pages

/usr/sbin/

command line programs for the superuser

/usr/src/

location of system source code (if installed)

/var/

files that change (vary), such as log files and print jobs

8.6.2Samba

Samba allows any operating system to share volumes using Microsoft's CIFS protocol. There are two components to Samba:

- client libraries: this allows an operating system to access existing CIFS shares. The client is built into the Windows and Mac OS X operating systems and is installed for you during the PC-BSD installation. Most Linux distros also install the Samba client; if your Linux distro does not, search its software repository.

- server: this allows a computer to act like a Windows server in that it can create shares and printers that are available to any CIFS client on the same network.

This section will demonstrate how to access shares using the Samba client as well as how to configure your PC-BSD system as a Samba server.

8.6.2.1Using the Samba Client

Since the Samba client libraries are pre-installed for you, you simply have to decide which utility you prefer to access the Windows shares on your network. Remember, if a desktop is installed, you do not have to be logged into that desktop in order to use that utility.

Table 8.6c summarizes the available utilities (type a utility's name to launch it in any desktop), which desktop it installs with and whether or not a separate PBI is available, and a short description of how to access the available shares using that utility.

Table 8.6c: Utilities that Support Windows Shares

Utility

Desktop/PBI

How to Access Existing Shares

dolphin

KDE

in the left frame, click on Network -> Samba Shares, then the Workgroup name; if the network requires a username and password to browse for shares, set this in Control Panel -> System Settings -> Sharing

konqueror

KDE

in the location bar, type smb:/

krusader

PBI

add Local Network to toolbar by going to Settings -> Configure Toolbars; once in toolbar click Local Network -> Samba Shares

mucommander

PBI

click on Go -> Connect to server -> SMB; here you can input the NETBIOS name of server, name of share, name of domain (or workgroup), and the share's username and password

nautilus

GNOME

click on Go -> Network -> Windows Network

thunar

XFCE or PBI

in the left frame, click on Network -> Windows Network

8.6.2.2Installing and Configuring the Samba Server

If you would like to share folders or a printer attached to your PC-BSD system with other users in your network, install and configure the Samba server. Go to Control Panel -> System Manager -> System Packages -> Services -> Samba and click Apply Changes.

In order to create your shares, you need to modify Samba's configuration file, smb.conf. You can either edit this file manually or use a GUI utility such as SWAT. This section will demonstrate both methods.

1. Edit smb.conf Manually

To modify the file manually, become the superuser and copy the sample file to the configuration directory:

cp /usr/local/share/examples/samba34/smb.conf.sample /usr/local/etc/smb.conf

Open the copied file in your favorite editor and review the default settings, editing them to match your network. In particular, check these global settings:

- workgroup = must match the Windows workgroup or domain name; unless the administrator has changed it, the default workgroup name is WORKGROUP

- security = the security modes are described here

- hosts allow = you should input the network address to restrict connections to the local network

In the share definitions section, review the [homes] settings. You can also define your own shares. This example will share the Downloads directory of user1 as read-only:

[Downloads]

path = /usr/home/user1/Downloads

public = yes

writable = no

To test your changes, restart the Samba service:

/usr/local/etc/rc.d/samba restart

and try browsing to the share from another system. Note that you may have to first map a drive to the share in order for it to appear in Windows Explorer or within the file manager utility of another PC-BSD or Linux system.

2. Create Shares Using SWAT

SWAT provides a graphical front-end to smb.conf through a web browser.

To enable SWAT, remove the # at the beginning of this line in /etc/inetd.conf:

#swat stream tcp nowait/400 root /usr/local/sbin/swat swat

Add the following line to /etc/rc.conf:

inetd_enable=”YES”

And start inetd:

/etc/rc.d/inetd start

To connect to SWAT, open a web browser and input the IP address of the PC-BSD computer followed by :901. When prompted, input the username root and the password associated with the superuser account. In the example shown in Figure 8.6a, the user has clicked on the Globals button in order to view the global settings.

Figure 8.6a: SWAT Graphical Menu

One of the nice features of SWAT is the built-in help system. If you need more information about an option, simply click its Help hyperlink to access that section of the Samba documentation. The shares button allows you to quickly create shares and the view button allows you to review the current configuration.

8.7Remote Desktop

Occasionally it is useful allow connections between desktop sessions running on different computers. This can be very handy when troubleshooting a problem as both users will be able to see the error on the problematic system and either user can take control of the mouse and keyboard in order to fix the problem. Typically this is a temporary situation as providing access to one's computer allows a remote user the ability to both view and modify its settings.

This section will demonstrate two remote desktop scenarios: how to configure an RDP connection to another computer from PC-BSD and how to invite another computer to connect to your desktop session.

8.7.1Connecting to Another Computer Using RDP

The remote desktop protocol (RDP) protocol can be used to make a connection to another computer. This section will demonstrate what is needed on the remote computer for an RDP connection, how to connect using KDE's KRDC, and how to connect using VNC.

8.7.1.1Preparing the Remote System

Depending upon the operating system, you may have to first install or enable RDP software on the remote computer:

- not every edition of Windows provides a fully functional version of RDP; for example, it may not be fully supported in a Home Edition of Windows. Even if the full version of RDP is included, remote access may or may not be enabled by default. If you have trouble connecting using RDP, do a Google search for "remote desktop" and the name of the version of Windows you are using to find out how to configure its remote desktop settings. If you still can't connect, you will need to download, install and configure VNC server software on the system.

- if the other computer you are connecting to is a Mac, Linux, or BSD system, you will have to first install either xrdp or a VNC server on the other system. Depending upon the operating system, either software may or may not already be installed. If it is not, check the software repository for the operating system or use Google to find out how to install and configure one of these applications on that operating system. If you are connecting to another PC-BSD system, the krfb VNC server is automatically installed with KDE and additional VNC server software is available in AppCafe™.

If the remote system is protected by a firewall, you will need to check that it allows connections to the TCP port required by the type of connection that you will be using:

RDP: uses port 3389

VNC: uses port 5900 (for the first connection, 5901 for the second connection, etc.)

If you need to manually add a firewall rule, it is best to only allow the IP address of the computer that will be connecting. You should immediately remove or disable this firewall rule after the connection is finished so that other computers do not try to connect to the computer. Since your PC-BSD system is considered to be the client and will be initiating the connection, you do not have to modify the firewall on the PC-BSD system.

8.7.1.2Connecting with KDE's KRDC

If your PC-BSD system has the KDE desktop installed, you can initiate a connection request using KRDC. To launch this application, go to Application Launcher -> Internet -> Remote Desktop Client within KDE or type krdc at the command line within any desktop. If you click F1 while in KRDC you can access the Remote Connection Desktop Handbook to learn more about how to use this application.

Figure 8.7a shows the initial KRDC screen which allows you to specify which system you wish to connect to.

Figure 8.7a: Creating a Connection Using KRDC

Use the drop down menu to indicate whether the remote system is using RDP or VNC for the connection. Then type in the IP address of the system you wish to connect to. If you are connecting to a VNC system, the IP address needs to be followed by a colon and a number indicating the number of the session. Typically, the number will be 1 unless the VNC server is hosting multiple simultaneous connections. Once you press enter, the connection will be initiated and, if it is an RDP connection, you will see the screen shown in Figure 8.7b:

Figure 8.7b: Settings for the RDP Connection

Here is a quick overview of the settings:

Desktop resolution: since the contents of the screen are sent over the network, select the lowest resolution that still allows you to see what is happening on the other system. If you have a very fast network connection, you can choose a higher resolution; if you find that the other system is very slow to refresh its screen, try choosing a lower resolution.

Color depth: choose the lowest color depth that allows you to see the other system; you can choose a higher color depth if the network connection is fast.

Keyboard layout: this drop down menu allows you to select the desired keyboard layout.

Sound: this drop down menu allows you to choose whether any sounds heard during the connection are produced on this system, the remote system, or to disable sound during the connection.

Console login: if you are connecting to a Unix-like system, you can check this box if you wish to have access to the other system's command line console.

Extra options: allows you to specify rdesktop switches that aren't covered by the other options in this screen.

Show this dialog again for this host: if you plan on using the same settings every time you connect to this computer, you can uncheck this box. If you need to change the settings at a later time, you can right-click the connection (which will appear in a list as a past connection) and choose Settings from the right-click menu.

Remember password: KWallet is KDE's password storage system. If this box stays checked, you will only need to input the password the first time you make this connection as it will be saved for you. If this is the first time you have stored a password using KWallet, it will prompt you for some information to set up your wallet.

If it is a VNC connection, you will be able to choose your connection type (speed), screen resolution, and have the option to remember the password.

Once you press OK, the connection should be initiated and you will receive pop-up messages asking for a username then a password; the details you provide must match a user account on the system you are connecting to. Once your authentication details are confirmed, you should see the desktop of the other system. If you move your mouse, it will move on the other desktop as well. Click the "View Only" button in the top toolbar whenever you wish to disable this mouse behaviour. When you are finished your session, you can click the "Disconnect" button in the top toolbar.

NOTE: if the connection fails, check on the remote computer that either the RDP software is enabled or that the VNC server is listening for connections. Also double-check that a firewall is not preventing the connection.

8.7.2Allowing Another Computer to Connect Using Desktop Sharing

If you wish another user to connect to your computer and have the KDE desktop installed, you can use the KDE Desktop Sharing application to generate a connection invitation. To launch this application within KDE, go to Application Launcher -> Internet -> Desktop Sharing or type krfb from the command prompt of any desktop. If you press F1 while in this application, it will open the Desktop Sharing Handbook where you can learn more about using this utility. Figure 8.7c shows the initial screen for this application:

Figure 8.7c: Initiating a Connection Request Using Krfb

There are two types of invitations that you can create:

Personal Invitation: if you click this button it will display the hostname that the other person will use to connect, a temporary password to use for the connection, and a connection request expiration time of one hour. It will include a warning reminding you to only give this information to the person you wish to connect as anyone can connect using that information. The connection itself can be made from any VNC client. If the person is using PC-BSD, they can use kdrc or vncviewer as described above. On other operating systems, they will need to check if VNC is installed and download a VNC client if it is not. Once you press the Close button, the invitation expiry date will be listed in the main screen.

Email Invitation: if you click this button it will display a warning that anyone who reads the email containing the invitation can connect. Once you click the Continue button, the default email program will open the invitation so that you can input the email address of the recipient and send the email.

It should be noted that the most secure way to convey the invitation information is through an alternate communications channel such as a phone call. Ideally, you are speaking to the other person as they connect so that you can walk them through the problem you are experiencing and they can let you know what they are doing to your system as you watch them do it.

Figure 8.7d shows an example of a personal invitation:

Figure 8.7d: Connection Invitation Created Using krfb

Once the other person has the invitation, they should input the information in the invitation into their VNC client in order to start the connection. You will know when they try to connect as a pop-up message will appear on your screen similar to Figure 8.7e:

Figure 8.7e: The Other User is Trying to Connect Using the Invitation

In this example, a computer with an IP address of 192.168.1.111 is trying to connect. Buttons are provided to either accept or refuse the connection. You can also check or uncheck the box to "allow remote user to control keyboard and mouse". If you accept the connection, the other user will be prompted to input the invitation password. Once the password is accepted, they will see your desktop.

8.8Security

Your PC-BSD system is secure by default. This section provides an overview of the built-in security features and additional resources should you like to learn more about further increasing the security of your system.

PC-BSD's security features include:

- naturally immune to viruses and other malware: most viruses are written to exploit Windows systems and do not understand the binaries or paths found on a PC-BSD system. Antivirus software is available in the Security section of AppCafe™ as this can be useful if you send or forward email attachments to users running other operating systems.

- built-in firewall: the default firewall ruleset allows you to access the Internet and the shares available on your network. If there are no shared resources on your network, you can use Firewall Manager to further tighten the default ruleset.

- very few services are enabled by default: you can easily view which services are started at boot time using Services Manager or by reading through /etc/rc.conf. You can also disable the services that you do not use by disabling that service in Services Manager or by commenting out that line with a # in /etc/rc.conf.

- SSH is disabled by default: and can only be enabled by the superuser. This setting prevents bots and other users from trying to access your system. If you do need to use SSH, change the NO to a YES in the line sshd_enable= in the file /etc/rc.conf. You can start the service right away by typing /etc/rc.d/sshd start. You will need to add a firewall rule to allow SSH connections from the systems that require SSH access.

- SSH root logins are disabled by default: if you enable SSH, you must login as a regular user and can use su or sudo when you need to perform administrative actions. You should not change this default as this prevents an unwanted user from having complete access to your system.

- sudo is installed: and configured to allow users in the wheel group sudo access by typing their own password. In other words, they do not need to know the root password. By default, the first user you create during installation is added to the wheel group. You can use User Manager to add other users to this group. You can change the default sudo configuration using the visudo command as the superuser.

- denyhosts is automatically enabled: this script is used to thwart SSH attacks.

- automatic notification of security advisories: Update Manager will automatically notify you if an update is available as the result of a FreeBSD security advisory that affects PC-BSD. This allows you to keep your operating system fully patched with just the click of a mouse.

If you would like to learn more about security on FreeBSD/PC-BSD systems, man security is a good place to start. These resources are also available:

- FreeBSD Security Information

- Security Section of FreeBSD Handbook

- Hardening FreeBSD

9Finding Help

While professional PC-BSD support is available from iXsystems, most users turn to the Internet for help. We are doing our best to make PC-BSD as easy as possible for newcomers. Should you need help, there are plenty of ways to get in touch with the PC-BSD community. This section discusses the following help resources:

- PC-BSD Forums

- FAQS

- IRC Channel

- Mailing lists

- FreeBSD Handbook and FAQ

- Social Media

- Search and Portals

- Other Resources

9.1PC-BSD Forums

The PC-BSD Forums contain a wealth of information, tips and solutions which you can access from a web browser. There are many active members and you will find that most questions are replied to quickly. If you are having problems with something on your PC-BSD system, try using the forum's search utility. You'll often find that someone else has posted a similar question and that other users have responded with a fix or a how-to.

The Forums have been categorized, allowing users to skim through the categories that interest them while learning some things along the way. You do not have to create a login account in order to search or read through the forums. However, if you wish to ask or answer a question on a forum or subscribe to a forum or a thread (to be automatically notified when a new post is added), you will need to be logged in. To subscribe to a forum, open the page for the forum and select Forum Tools -> Subscribe to this Forum. You will be prompted to choose how often to be notified whenever a post is added to the forum. If you wish to subscribe to a specific post, open the post and select Thread Tools -> Subscribe to this Thread. You will be notified whenever someone responds to that post.

The current categories and the forum descriptions are described below:

The General category contains the following forums:

- Announcements: this is a read only forum containing announcements of new releases and news related to PC-BSD. Subscribing to this forum is a good way to keep up-to-date with the latest news about PC-BSD.

- General Questions: use this forum if your question does not fit into any of the other forum categories.

- The Lounge: this is a general discussion area for PC-BSD users. Posts in this forum are not of a technical nature. Posts should be of interest to other PC-BSD users and not contain any mature or slanderous content.

- Advocacy: this is a brainstorming area for promoting PC-BSD.

- Guides: this forum contains how-tos and guides for performing specific tasks on PC-BSD.

- Tips and Tricks: this forum contains suggestions for configuring and tweaking your PC-BSD system.

- Books on PC-BSD: this forum contains errata and discussion for published books about PC-BSD.

The PC-BSD Software (PBI files) category is helpful for PBI developers so that they may become aware of any problems with current PBIs and to receive requests for software that should be made into a PBI. If you start a post in any of these forums, you should subscribe to it so you can be notified of any responses to your post. The forums in this category include:

- PBI Discussion: a general discussion area for resolving PBI problem reports. If you have a problem installing or using a PBI, post the details in this forum.

- PBI Requests: do you have a favourite software that is not currently available as a PBI? You can request it in this forum. Be sure to read the Readme first post if this is your first PBI request.

- Finished PBIs: once a new PBI is created as the result of a PBI request, the original request is moved to this forum.

- Port Requests: do you have a favourite software that is not currently available as a FreeBSD port? You can request it here; if someone does make a port it can also be converted into a PBI as PBIs are based on FreeBSD ports. Again, read the Readme first file if this is your first port request.

The Support category deals with the following types of support questions. PC-BSD developers are subscribed to this list so they can help determine what is causing the problem, and if a fix is made available, can commit it for the next version of PC-BSD. If you start a post a in any of these forums, you should subscribe to it so you can be notified of any responses to your post.

- General Bug Reports: if you are having a problem on your PC-BSD system that does not match any of the other forum categories, you can report it here. Read any posts marked as "sticky" (they will always be at the top of the forum) if this is your first bug report.

- Installing PC-BSD: if you are having problems installing PC-BSD, post the details of your problem to this forum.

- Startup Bug Reports: if you have been able to install PC-BSD but are having problems booting into PC-BSD, post the details of your problem in this forum.

- Usage Bug Reports: if you are having problems performing a task or using the software that was installed with your PC-BSD system, post the details of your problem to this forum.

- FreeBSD Help: if you suspect that your problem is not with PC-BSD but with the underlying FreeBSD operating system, post the details of your problem in this forum. The Looking for FreeBSD Help? README FIRST! post should be read first.

The Hardware Support category is for reporting hardware-related problems. PC-BSD developers are subscribed to this list so they can help determine what is causing the problem, and if a fix is made available, can commit it for the next version of PC-BSD. If you start a post in any of these forums, you should subscribe to it so you can be notified of any responses to your post. Be sure to read the README first before posting.

- General Support: if your hardware problem does not match any of the other forum categories, post the details of your problem in this forum.

- Graphics Cards: if you are having problems with your video card settings, post the details of your problem to this forum.

- Sound and Multimedia: if you are having problems with sound or in playing multimedia such as CDs or videos, post the details of your problem to this forum.

- Networking: if you are having problems using or configuring a network interface, post the details of your problem to this forum.

- Laptops: if you are having problems with power management or other laptop-specific issues, post the details of your problem to this forum.

- Drives: if you are having problems accessing or formatting CD, DVD, USB or hard drives, post the details of your problem to this forum.

The Development category contains the following forums:

- Creating PC-BSD Packages (.pbi files): this is a discussion area for PBI developers who need help with or have questions about creating a PBI.

- Feature Requests: do you have an idea for a feature that you would like to be available in PC-BSD? This is the forum to request it.

- Translations: this is a discussion area for translators who localize PC-BSD menus or translate PC-BSD documentation.

- Documentation Project: this is a discussion area for those who wish to help with PC-BSD documentation.

- PC-BSD Installer: this is a discussion area for feature requests and testing of the PC-BSD installation program.

The Testing category is for PC-BSD beta testers to report problems found in upcoming versions of PC-BSD. It contains the following forums:

- General Testing: if your problem is not related to one of the following desktop environments, report the problem in this forum. Be sure to read the sticky threads first as they contain useful information about beta testing and any known issues with the testing snapshot.

- KDE: if your problem is related to the KDE desktop or KDE applications, report the problem in this forum. Be sure to read README first for instructions before posting.

- Gnome: if your problem is related to the GNOME desktop or GNOME applications, report the problem in this forum. Be sure to read README first for instructions before posting.

- XFCE: if your problem is related to the XFCE desktop, report the problem in this forum. Be sure to read README first for instructions before posting.

- LXDE: if your problem is related to the LXDE desktop, report the problem in this forum. Be sure to read README first for instructions before posting.

- Fluxbox: if your problem is related to the Fluxbox desktop, report the problem in this forum. Be sure to read README first for instructions before posting.

- Ports Testers: if your problem is related to a FreeBSD package or port, you can report the problem in this forum. Be sure to read README first for instructions before posting.

The International category contains forums for non-English speakers for PC-BSD related discussions in their native language. Each forum has its own categories for organizing posts. The following forums are available:

- Spanish - Español

- French - Français

- German - Deutsch

While logged into the forums, a link called UserCP will appear in the upper left hand corner. This is your control panel and it contains many settings to customize your forums experience. You should review the settings in your Control Panel.

Before asking a question on the forums or starting a new thread, first use the search utility to see if a similar thread already exists. If one does, you can add to the conversation by using the Reply button. If you find a thread useful, feel free to click the Thanks button to let the original poster know that you benefited from their knowledge.

If a similar thread doesn't already exist, review the forum categories to determine which one is the best fit for your post. When creating a new thread, use a useful Title name to describe your problem or question--remember, other users may be researching a similar issue and you want them to find your thread. Include enough details in your message so that others can quickly understand what you are experiencing--otherwise, they will have to ask you additional questions to understand your problem. Make sure you are subscribed to your thread so that you will receive a notification when someone responds to it.

You can ask a question by clicking on the "New Thread" button in the forum category that most closely matches your question. For example, if you are having problems with your video settings, you should create a new thread in the Graphics Card forum. If you don't see a category that matches your question, try the General Support category.

In addition to the forums available from the PC-BSD Forums website, the following forums may assist you in troubleshooting your PC-BSD system:

- FreeBSD Forums: many PC-BSD problems are related to the underlying FreeBSD operating system. The FreeBSD forums are very active and full of useful information that can apply to your PC-BSD system.

- BSD Nexus: contains categories for each of the BSD operating systems as well as general BSD information.

- BSD Foren: these forums are in German and contain many categories for each of the BSD operating systems.

- FreeBSD Mexican Community: these forums are in Mexican Spanish and contain categories for the FreeBSD operating system.

- BSD Guru PC-BSD Forum: this forum is in Polish and is specific to PC-BSD. Additional Polish forums for the other BSD operating systems are available here.

9.2IRC Channel

Like many open source projects, PC-BSD has an IRC channel to connect supporters and users. To get connected, use the following information in your IRC client:

Server name: irc.freenode.net

Channel name: #pcbsd (note that the # is required)

AppCafe™ has an IRC category where you can find PBIs for IRC clients. If you are unsure which IRC client to use, we suggest KVirc or XChat.

IRC is a great way to chat with other users and get answers to your questions. A few things to keep in mind if you ask a question on IRC:

- Most of the regular users are always logged in, even when they are away from their computer or are busy doing other computing tasks. If you do not get an answer right away, do not get mad, leave the channel and never come back again. Stick around for a while to see if anyone responds.

- IRC users represent many different time zones. It is quite possible that it is late at night or very early in the morning for some users when you ask a question.

- Do not post error messages in the channel as the IRC software will probably kick you out. Instead, use a pasting service such as pastebin and refer to the URL on channel. If you prefer to paste an image of your error, you can upload it to a temporary screenshot hosting service such as Upload Screenshot and post the URL to your uploaded image.

- Be polite and do not demand that others answer your question.

- It is considered rude to DM (direct message) someone who does not know you. If no one answers your question, do not start DMing people you do not know.

- The first time you join a channel, it is okay to say hi and introduce yourself.

9.3Mailing Lists

Mailing lists are a handy way to discuss problems, solutions, and requested features as they create a searchable archive of discussions. The PC-BSD Project offers the following mailing lists to cover a wide variety of discussion topics:

- Announcements: a read-only, low frequency list used by the PC-BSD team to make announcements to the community.

- Commits: lists SVN commits as PC-BSD code is added or modified by developers.

- Dev: for discussion related to PC-BSD technical development.

- Docs: for communications between those who are involved, or interested in contributing to, the PC-BSD documentation effort.

- Installer: for discussions about the backend to the pc-sysinstall utility.

- PBI-bugs: for users to report and discuss bugs found in PBI applications.

- PBI-dev: for discussions between PBI developers and users concerning PBI construction and maintenance.

- PBIbuild: lists SVN commits as PBIs are added or modified by PBI developers.

- PCBSD-Malaysia: general discussion list for Malaysian users in their native language.

- PCBSD-warden: the place to discuss The Warden software for PC-BSD.

- Public: general public list for discussion not related to the other mailing lists.

- Support: if you have a problem, you should report your issue or error messages on this list.

- Testing: for those wishing to participate in PC-BSD beta testing and feedback.

- Trac-bugs: lists notifications about changes to PC-BSD bug reports in Trac database.

- Translations: for those involved in translating for PC-BSD.

Each mailing list includes a description of topics suitable for discussion on that list and indicates if it is read only or available for user discussion. Anyone can read the archives of a list. If you wish to send an email to mailing list, you will need to first subscribe to the list. The link for each mailing list provides an interface for subscribing to that list. When you send an email to the list, remember to use the mailing address that you used when you subscribed to the list.

Several of the mailing lists are archived at gmane. Gmane allows you to read the archives in several different formats. It also provides RSS feeds in various formats for keeping up-to-date on new messages and topics.

In addition to the official mailing lists, there are mailing lists set up by PC-BSD users. Many of these lists are designed for discussion in other languages. A list of alternative PC-BSD mailing lists can be found here.

9.4FreeBSD Handbook and FAQ

PC-BSD has FreeBSD as its underlying operating system, so everything in the FreeBSD Handbook and FreeBSD FAQ applies to PC-BSD as well. Both are very comprehensive and cover nearly every task you can accomplish on a FreeBSD system. They are also an excellent resource for learning how things work "under the hood" of your PC-BSD system.

NOTE: some configurations described in the FreeBSD Handbook already "just work" on your PC-BSD system as they have been pre-configured for you. In these instances, reading that FreeBSD Handbook section can help you to understand how your system was configured and why it works.

9.5Social Media

The PC-BSD project maintains several social media sites to help users to keep up-to-date with what is happening and to provide venues for developers and users to network with each other:

- Official PC-BSD Blog

- PC-BSD on Twitter

- PC-BSD Facebook Group

- PC-BSD LinkedIn Group

- Spread PC-BSD Wiki

9.6Search and Portals

Many BSD related search portals exist. If you can't find the answer that you're looking for in the forums or mailing lists, try searching these websites:

- The OpenDirectory

- FreeBSD mail archives search (with Russian help text)

- FreeBSD Search (including: mailing list archives, man pages, and web pages)

- FreeBSD News

- BSD News Network

- About BSD

- BSD Guides

- Slashdot BSD

- DistroWatch

- LinuxBSDos

9.7Other Resources

The following BSD sites and resources may also contain useful information:

- PC-BSD Germany

- PC-BSD Poland

- PC-BSD Russia

- The FreeBSD Diary

- BSD Guru (Polish)

- Mfaridi.com (Farsi)

- BSD Youtube channel

- PC-BSD Youtube channel

- PC-BSD Videos

- BSD Talk

- The BSD Show

- BSD Magazine (free, monthly download)

- BSD Hacks (book)

- Definitive Guide to PC-BSD (book)

- PC-BSD Section at Jaki Linux (Polish)

- Screaming Electron's tutorials

10Supporting PC-BSD

PC-BSD is a community project and relies on involvement from its users and supporters. This section lists some ideas for becoming involved. We also have a list of Tasks Looking for People if you are looking for a specific task to assist with.

- Become a Beta Tester

- Become a Translator

- Become a Developer

- Report Bugs

- Submit PBI Requests

- Test PBIs

- Create PBIs

- Donate Money

- Host a Mirror

- Seed a Torrent

- Become an Advocate

10.1Become a Beta Tester

If you like playing around with operating systems and have a bit of spare time, one of the most effective ways you can assist the PC-BSD community is by reporting problems you encounter using PC-BSD.

If you have a spare system or virtual machine, you can also download and try out the latest alpha, beta or release candidate snapshots. These versions are still in testing and haven't been officially released yet. Having as many people as possible using PC-BSD on many different hardware configurations assists the project in finding and fixing bugs. This makes using PC-BSD better for everyone. PC-BSD releases always occur shortly after the FreeBSD release to allow for some extra testing. Subscribing to the PC-BSD blog is a good way to keep up-to-date on the availability of testing snapshots and any major bugs that are found within a snapshot.

If becoming a tester interests you, subscribe to the testing mailing list. As new testing versions become available they will be announced on this list. You will also be able to see what problems other testers are finding and can check to see if the problem exists on your hardware as well. You can also subscribe to Gmane's RSS feeds if you want a quick way to keep up with the subjects being discussed on the testing mailing list.

Anyone can become a beta tester. Follow these tips so that you can accurately describe your findings so they can be fixed as soon as possible:

- before sending an email, search the testing mailing list to see if anyone else has reported a similar problem.

- when reporting a new issue, use a descriptive subject in your email that includes the error and the version of PC-BSD. Ideally, the subject is short (8 words or less) and contains key words about the error. An example would be "Warden on 9.0-RC3 fails to export jail".

- ensure that the body of your email includes the PC-BSD version and architecture (e.g. 9.0BETA1.5, 64-bit version).

- give a short (2-3 sentences) description of how to recreate the error (e.g. when I right click a jail in warden and select Export jail to a .wdn file, it lets me select a file name, but then it freezes). If there is an error message, include its text.

- include any other info that may be useful (e.g. this seems to work on my 32 bit system or this used to work on 8.2).

- if the problem appears to be hardware related, include a copy of /var/run/dmesg.boot as this file shows the hardware that was probed the last time the PC-BSD system booted.

10.2Become a Translator

PC-BSD uses Pootle for managing localization of the menu screens used by the installer and the PC-BSD utilities. Pootle makes it possible to find out if your native language has been fully localized for PC-BSD. Pootle also makes it easy for users to check and submit translated text as it provides a web editor and commenting system. This means that translators can spend their time making and reviewing translations rather than learning how to use a translation tool.

To see the status of a localization, open up the PCBSD Translation System in your browser, as seen in Figure 10.2a:

Figure 10.2a: The PC-BSD Pootle Translation System

The localizations PC-BSD users have requested are listed alphabetically on the left. If your language is missing and you would like to help in its translation, send an email to the translations mailing list so it can be added.

The green bar in the Overall Completion column indicates the percentage of PC-BSD menus that have been localized. If a language is not at 100%, it means that the menus that currently aren't translated will appear in English instead of in that language.

If you click on a language name then click on the pcbsd hyperlink under the "Name" column, you'll see each menu item that is available for translation. The example shown in Figure 10.2b is for the Greek localization:

Figure 10.2b: Viewing a Language's Available Menus

In this example, the menu for CrashHandler is complete, but the one for LifePreserver is not.

If you click on the Review tab, you will see a list of statistics as seen in Figure 10.2c. This page will indicate the results of Pootle's quality checks, helping translators to notice any problematic items. A description of each quality check can be found here.

Figure 10.2c: Reviewing a Language's Quality Checks

If you wish to help localize your language, you should first join the translations mailing list and introduce yourself and which language(s) you can assist with. This will allow you to meet other volunteers as well as keep abreast of any notices or updates that may affect the translations. You will also need to create a Pootle login account.

Once you are logged in to Pootle, navigate to the menu item that you wish to translate. Figure 10.2d continues the earlier example by clicking on the link for the Greek version of LifePreserver.po.

Figure 10.2d: Using the Pootle Interface to Edit a Translation String

In this example, the first string (the word Disabled) has been translated but is failing 2 of the quality checks. The translator can check the correctness of the translation as well as fix the whitespace and double-spacing issue. Once finished, the translator can click the "Add Comment" link to type in an optional comment then press the "Submit" button to save any changes. Each text field (string) in the menu is numbered--click on the hyperlink associated with the number to open that text field in the Pootle editor, or use the Next and Previous links to navigate between text fields.

If you need help with a translation or using the Pootle system, you can ask for help on the translations mailing list or in the PC-BSD Translations Forum.

10.3Become a Developer

If you like programming, and especially coding on FreeBSD, we would love to see you join the PC-BSD Team as a PC-BSD committer. Developers who want to help improve the PC-BSD codebase are always welcome! If you would like to take part in core development, and possibly earn a commit bit, a good place to get started is by signing up for the developers mailing list. Once you have signed up, feel free to browse our active TODO list, or search for bugs that need fixing in the PC-BSD Trac database. If you see something of interest you want to work on, or have a proposal for a project you wish to add to PC-BSD, please let us know via the developers list and we will be happy to help get you started.

Most of the PC-BSD specific GUI tools are developed in C++ using the QT Libraries, and other non-GUI development is done using standard Bourne shell scripts. There may be cases where other languages or libraries are needed, but those will be evaluated on a case-by-case basis, so feel free to let us know your proposals on the developers mailing list.

Developers will also find the following resources helpful:

- Commits Mailing List

- Development Wiki

- Getting PC-BSD Source

- qmake Manual

10.4Report Bugs

Found a bug in PC-BSD? If so, please take the time to read through this section first to ensure that your bug gets reported to the correct group and is resolved in a timely fashion.

The first thing to determine is the type of bug you are encountering. Is it a bug that is preventing you from properly installing and running PC-BSD (a system bug), or is it an issue with an installed software package such as FireFox (an application bug)?

An application bug can fall into a few different categories:

Application Packaging Bug

The first is a packaging bug, which is when you cannot install the application or it simply crashes on startup. For these types of bugs, please report them on our Trac Database (after logging in) and for the Type, select "PBI Packaging Bug". Please provide as much detail as possible about the bug, such as:

- Name of Program

- What version of PC-BSD you are running

- What architecture you are using (32bit or 64bit)

- Detailed description of the bug, including a copy of the crash logfile, if generated

Application Runtime Bug

An application runtime bug occurs when an application installs and is able to start successfully, but during use, it crashes or displays some other type of undesired behavior. An example would be OpenOffice failing to import a type of document properly or a chat client unable to keep a connection to a network. These types of bugs are best reported to the developers of the application. The best way to locate them is by searching for your application in AppCafe™, then clicking the hyperlink for the vendor (underneath the application name and icon). Most software sites have a bug report link or another way to contact the original developer to report your issue.

A system bug is any bug which prevents the initial installation of PC-BSD or issues with hardware. Some examples would be a non-bootable system, failed installation, missing drivers for your hardware, or a non-functional desktop after installation. To report this type of issue, please follow the instructions below for your type of system bug:

System Driver Bugs

An example of a driver bug would be a missing network driver, no sound output, or no disk drives detected. Most of these types of issues are directly related to the FreeBSD base upon which PC-BSD is built, and are best fixed by discussing them with the FreeBSD team directly. Reporting a bug to FreeBSD can be done using the Send PR page. You should also search the FreeBSD mailing lists as other users may have already discovered the bug or have a work-around for your particular hardware. Below are some of the related mailing lists:

- ACPI: for power management and ACPI development.

- Emulation: place to discuss Linux, VirtualBox, Wine and Linux Flash plugin support.

- Multimedia: for sound drivers and multimedia applications.

- USB: for USB support and development.

- Xorg: for Xorg and video drivers and development

System Installation Bugs

Any bugs encountered during the installation routine of PC-BSD should be reported to the Trac Database, with as much detail as possible, including:

- PC-BSD version and architecture

- hardware information, disk sizes, amount of RAM and CPU

- specific installation notes such as any non-standard features chosen or a custom disk layout

- information in the "more details" box of the installation failed dialog box

Other System Bugs

Please report any bugs with HAL or external USB disk mounting using the instructions here. Report issues specific to running the KDE desktop to the KDE Bug Tracking system.

10.5Submit PBI Requests

Is an application that you need not currently available as a PBI? Making a PBI request is an excellent way to let PBI developers know which applications are most useful to PC-BSD users. Before requesting a PBI, please do the following:

- check in AppCafe™ to see if a PBI already exists. If one does but you want to request a more recent version, please wait a few days as PBIs are automatically rebuilt and tested when the underlying port changes. If the new version does not appear, it is possible that there is a problem with the new version that is preventing a successful build.

- search at Freshports to see if there is an existing FreeBSD port. If a port does not already exist, you want to generate a port request instead

- check to see if a request has already been made in the PBI Requests Forum.

To make your request, start a new thread in the PBI Requests Forum. If this is your first forum post, you will need to use the Register hyperlink to create a username and password so that you can login to make your request.

NOTE: you do not need to login to read the content in the PC-BSD forums; you do have to login in order to start a new thread or respond to an existing one.

Once you have submitted your request, click the Thread Tools link -> Subscribe to this Thread and select your Notification Type so that you can be notified of any responses to your request. If you would like to receive notifications about all of the PBI requests in this forum, click Forum Tools -> Subscribe to this Forum while in the forum.

When creating a new forum thread, include the name of the PBI you are requesting in the thread name. That way it is easy for PBI developers and other PC-BSD users to know which applications have been requested.

People who create PBIs are subscribed to the PBI Requests forum. Usually, someone will respond to a request within a few days either indicating that they are working on creating the PBI or with an explanation if creating a PBI will be problematic. The PBI process is as follows:

1. A user requests a PBI.

2. Someone responds to the request and creates a PBI module.

3. The PBI module is sent to the pbi-dev mailing list so it can be added to the PBI build server.

4. The PBI module is built on the PBI build server.

5. Once the PBI is built, PBI testers test for basic functionality such as verifying that the application starts and its menus appear to be present and working.

6. Once the PBI is tested, the PBI is made available in AppCafe™.

7. Once the PBI is uploaded, the PBI request is moved from the PBI Requests Forum to the Finished PBIs forum.

Please note that it takes at least 2-7 days for a new PBI to go from step 3 to step 7 as it needs to be fully tested. If there is a delay, that usually means that a problem was found in the PBI and that the testers are trying to resolve the problem.

The next section explains how you can assist in the PBI testing process.

10.6Test PBIs

The previous section indicated that new PBI modules are uploaded to the PBI build server. There are actually several build locations, according to PC-BSD version and architecture:

- PC-BSD 7.x - i386

- PC-BSD 7.x - amd64

- PC-BSD 8.x - i386

- PC-BSD 8.x - amd64

- PC-BSD 9.x - i386

- PC-BSD 9.x - amd64

Figure 10.6a shows a sample from the PC-BSD 8.x 32 bit location:

Figure 10.6a: Viewing the Status of PBIs on the Build Server

There are two ways you can assist in testing PBIs.

First, if you wish to help test a PBI before it has been approved, go to the build location for your version and architecture. Find the name of the PBI you wish to test in the Module column and click its hyperlink. You can then download the file with the .pbi extension. Once downloaded, run pbi_add /path/to/pbi to install the PBI. If you find any problems with the PBI, send an email to the PBI-dev mailing list describing how to recreate the problem. Include the text of any error messages you receive.

Second, you can try to resolve PBI modules that have a Build Status of FAILED. If you click on the name of a failed module, you can download the build.log.bz2 for that module. To access this file, you can either:

bunzip2 build.log.bz2 to unzip the file so you can send it to a text processor to read it.

or

bzcat build.log.bz2 to read the file without unzipping it. It will scroll down to the end, where the error occurred. Use bzcat build.log.bz2 | more if you prefer to scroll through the file.

If you think you know the cause of the problem after reading the error messages, you will need the module itself to try to resolve the problem. Modules are located in the PC-BSD subversion repository. To download the module, you can use the svn command. To give an example, the math/scilab PBI was flagged as FAILED in Figure 10.6a. To download that module, cd to a suitable directory and issue the following command. Note that the svn command uses the svn:// URI (instead of http://) and does not include the /browser/ section you see in the URL if you use your web browser to browse the modules.

svn co svn://svn.pcbsd.org/pbibuild/modules/math/scilab

This example command will create a directory called scilab/ and place the module's files in that directory. If you make changes to these files to correct the problem, create a tar.gz of the directory and send the tarball to the PBI-dev mailing list so the changes can be uploaded to the build server.

10.7Create PBIs

Creating a PBI from an existing FreeBSD port is a surprisingly easy and automated process that does not require development skills. Some ports are effortless to convert while more complex ports may require some thought and simple scripting.

Two utilities are available for converting FreeBSD ports into PBIs. EasyPBI provides a graphical interface and pbi_makeport provides a command line utility. This section demonstrates how to use both of these tools, explains the components of a PBI module, and provides some troubleshooting tips.

NOTE: before creating a PBI, check to see if one exists using the instructions in section 10.5 Submit PBI Requests. If you decide that you prefer to request a PBI that you need rather than to create one, that page also contains instructions for submitting a PBI request.

10.7.1Using EasyPBI

EasyPBI is a new GUI application created by Jesse Smith and Ken Moore. It streamlines the process of building a PBI from a FreeBSD port. EasyPBI can be installed using AppCafe™ without any additional requirements on a PC-BSD system. For a pure FreeBSD system, you will need to install both the sysutils/easypbi and ports-mgmt/pbi-manager ports.

To run the program, either double-click the EasyPBI desktop icon or type EasyPBI as your regular user account. This will open the screen shown in Figure 10.7a. Depending upon whether or not ports is installed, you may first receive a pop-up message.

Figure 10.7a: EasyPBI Graphical Interface

To build a PBI using EasyPBI:

1. Create a module for the desired FreeBSD port: when you first start EasyPBI, it will check to see if the FreeBSD ports tree is installed into /usr/ports. If it is not, a pop-up message will indicate that you have a choice on how to install the ports tree. If you want the system ports tree to be available for any user, go to Control Panel -> System Manager -> Tasks -> Fetch System Ports Tree. Use this method if multiple users will be using the EasyPBI utility. Alternatively, if you only want the ports tree to be available to the current user, click File -> Get Ports from within EasyPBI; this will fetch the ports tree and place it in the user's home directory.

NOTE: when determining which PBIs need to be built, refer to the PBI Requests forum to determine which PBI's have been requested by users. You should also check that a module does not already exist on the PBI Modules section of trac.

To create a new module, click the "New Module" button and use the browser to select the desired port from the FreeBSD ports tree. Once a port is selected, EasyPBI will attempt to automatically supply the port information for the PBI and display the results on the GUI. In the example shown in Figure 10.7b, the net/xrdesktop port has been selected and the fields have been auto-filled in.

Figure 10.7b: Reviewing the Port's Information

You should review these fields for accuracy. In this example, the port's website had changed and an email was sent to the port author so that the URL could be corrected in the port.

If you click "Get Port Info" FreshPorts.org will open in the default web browser so that you can view additional information about the port.

A generic icon will be supplied for the module; you can change the default icon by clicking the "Choose Icon" button. When using a custom icon, use 64x64 .png files with transparent backgrounds.

If the program provides a GUI, check the box "GUI App".

Once the port information is complete, click the "Create Module" button and EasyPBI will produce a generic PBI module. A message will indicate the location of the module, as seen in the example in Figure 10.7c:

Figure 10.7c: PBI Module Created

2. Build a PBI from the module: once your module is created, click on the "Build PBI" tab and click the Select Module button to browse to the module you just created. You should then review the default settings. Figure 10.7d shows the default settings for our example PBI.

Figure 10.7d: The Build PBI Tab

The options in this tab allow you to do the following:

Save Settings as Defaults: once you are satisfied with the settings, click this button to have EasyPBI remember your settings between uses.

Change Directory: allows you to save the output of the build to a different directory.

Change File: the PBIs available from the PC-BSD repositories are digitally signed by the PC-BSD project's signature file. If you are creating your own repository, you can use your own digital signature file by browsing to its location.

Use TMPFS: if your build system has a lot of RAM, selecting this option can speed up the build.

Select Module: select the previously created module which you would like to build.

Build PBI: starts the build of the PBI using the settings contained within the PBI module. It will prompt you for the superuser password and requires a working Internet connection to build the PBI. This process may take quite a while, depending upon the port selected and the speed of your computer. The build messages will be displayed in the window at the bottom of the tab. EasyPBI will inform you when the PBI build is finished, and whether it was successful or not.

Stop Build: stops the build process. Click the "Build PBI" button to resume the build.

Save Build Log: useful if the build fails.

You can produce additional modules from the "Create Module" tab while a PBI build is running.

If the PBI build fails for some reason, you may need to modify the module. Use the build log to determine the error and modify the module as needed. If you are unsure how to fix the module, send the build log for the failure as well as the module to the pbi-dev mailing list.

3. Test the PBI: once the PBI build is complete, a pop-up message will indicate that the PBI finished building successfully. You will find the PBI in the output directory that you specified in Figure 10.7c. To continue with our example, the following commands will install the PBI so that it can be tested. Note the error message that occurs since the PBI has not been signed yet.

cd /home/dru/EasyPBI/PBI

pbi_add xrdesktop-1.2_2-i386.pbi

pbi_add: No digital signature! If you are *SURE* you trust this PBI, re-install with --no-checksig option.

pbi_add --no-checksig xrdesktop-1.2_2-i386.pbi

Verifying Checksum...OK

Extracting to /usr/pbi/xrdesktop-i386

Installed: xrdesktop-1.2.2

rehash

/usr/pbi/xrdesktop-i386/bin/xrdesktop

Once installed, specify the full path to the application's binary to make sure that you are testing the PBI's binary. If the application starts and is a GUI, try using all of the menu items to make sure they work as expected. If you encounter any error messages in either starting or using the application, record them. If the fix for resolving the error messages is not clear to you after some Googling, send the error report the pbi-dev mailing list.

Alternately, if everything seems to be working, send the tarball of the PBI to the pbi-dev mailing list. You will find it in the EasyPBI/Modules/ subdirectory. In our example, the name of the tarball is /home/dru/EasyPBI/Modules/xrdesktop.tar.gz.

10.7.2Creating a New PBI with pbi_makeport

Starting in PC-BSD 9.x and higher, pbi_makeport is included with the operating system. This utility provides an easy way for a user to convert an existing FreeBSD port into a PBI module. The PBI build server builds modules into PBIs which are then made available to users through AppCafe™. man pbi_makeport provides details on this application's various usage options.

When running pbi_makeport it is possible to supply an optional metadata configuration directory which contains additional data used to supplement the port building and the final PBI file. This configuration directory may contain extra icon data for the desktop, install/uninstall scripts, custom make options and more.

Examples of 9.x modules can be found at Examples in Subversion.

FreeBSD ports may contain build dependencies, runtime dependencies, and required libraries. When building a PBI, pbi_makeport automatically compiles all of the required dependencies, and, when finished compiling, prunes the build dependencies before packaging the PBI file, leaving only the runtime packages and libraries that are required for the program to work. This means that any files which are included in the PBI are necessary for the program to run, and manually removing them will cause the program to fail.

10.7.3PBI Module Components

A PBI module contains the following components. When creating a PBI module, create a directory on your computer to hold the module's components. For example, if you are creating a PBI module for firefox, create a directory called firefox/ and place the following files within that directory. The directory that you create is referred to as %PBI_APPDIR%%.

1. LICENSE File

The text of a license agreement you want the user to click to accept before installation. This file is optional unless the underlying port is restricted and requires the user to accept a license in order to install and use the software.

2. pbi.conf

The pbi.conf file is mandatory. It is a simple shell script that contains the information needed to build the PBI. Typically this file requires you to modify a few simple variables, such as the name of the program, its location in the ports tree, and the name of its icon. Sometimes you will need to set a few additional variables in order to make sure that required dependencies are included in the PBI. If you get stuck when creating your own pbi.conf, you can view the pbi.conf file for every PBI module in this section of the PC-BSD trac repository. Here is an example of the pbi.conf file for firefox:

#!/bin/sh

# Place over-rides and settings here

#

# XDG Desktop Menu Spec:

# http://standards.freedesktop.org/menu-spec/menu-spec-1.0.html

##############################################################################

# Program Name

PBI_PROGNAME="Firefox"

# Program Website

PBI_PROGWEB="http://www.mozilla.com"

# Program Author

PBI_PROGAUTHOR="The Mozilla Foundation"

# Default Icon (Relative to %%PBI_APPDIR%% or resources/)

PBI_PROGICON="share/pixmaps/FireFox-128.png"

# The target port we are building

PBI_MAKEPORT="www/firefox"

# Additional options for make.conf

PBI_MAKEOPTS="PACKAGE_BUILDING=Y

WITH_CUPS=yes

WITH_GECKO=libxul"

# Ports to build before / after

PBI_MKPORTBEFORE=""

PBI_MKPORTAFTER="audio/esound x11-fonts/dejavu x11-themes/qtcurve-gtk2 devel/gconf2 www/firefox-i18n"

# Exclude List

PBI_EXCLUDELIST="./include ./share/doc"

# Increment to trigger rebuild of PBI on build servers

PBI_BUILDKEY="04"

# This app needs to install as root

PBI_REQUIRESROOT="YES"

# Set the priority of this build

PBI_AB_PRIORITY="50"

# Set the files we want to exclude from the shared hashdir

PBI_HASH_EXCLUDES="lib/firefox/firefox"

export PBI_PROGNAME PBI_PROGWEB PBI_PROGAUTHOR PBI_PROGICON PBI_MAKEPORT PBI_MAKEOPTS

PBI_MKPORTBEFORE PBI_MKPORTAFTER PBI_BUILDKEY PBI_REQUIRESROOT PBI_EXCLUDELIST

Table 10.7a describes the most commonly used variables. When creating your pbi.conf file, you will want to refer to the FreeBSD port's Makefile and pkg-descr to determine which values to use.

Table 10.7a: Commonly Used pbi.conf Variables

Variable

Description

PBI_PROGNAME=

mandatory; should be the same value as PORTNAME= in the port's Makefile, but capitalized

PBI_PROGWEB=

mandatory unless does not exist; should be the same value as WWW= in the port's pkg-descr

PBI_PROGAUTHOR=

mandatory; often found in the port's pkg-descr or at the website for the application

PBI_PROGICON=

mandatory path, relative to %PBI_APPDIR%%, to application icon file in png format

PBI_PROGREVISION=

bump up a PBI's revision number; useful when rebuilding a port with new PBI specific options

PBI_MAKEPORT=

mandatory; the path to the port within /usr/ports/

PBI_MAKEOPTS=

optional; set this to the options that you want saved into make.conf for the port building process (e.g. WITH_CUPS=YES )

PBI_MKPORTBEFORE=

optional; port(s) to build before starting the target port PBI_MAKEPORT

PBI_MKPORTAFTER=

optional; port(s) to build after finishing the target port PBI_MAKEPORT

PBI_BUILDKEY=

should not be included; this variable is used on the PBI build server to force the rebuild of a PBI that has failed to build

PBI_REQUIRESROOT=

set to to YES to require this app to be installed as root; default is NO which allows it to be installed as a regular user

PBI_EXCLUDELIST=

list of files or directories to exclude from the final archive, such as ./include or ./share

PBI_AB_PRIORITY=

may be set by build server administrator; a higher number indicates a greater priority and will be built before lower priority PBIs

PBI_AB_NOTMPFS=

set to YES to disable using tmpfs when doing auto-builds on a server

PBI_HASH_EXCLUDES=

set to a space delimited list of files to exclude from merging into the shared hash-dir

export

mandatory; followed by a list of all of the variables that will be included when the PBI is built

The optional external-links file contains a list of targets to link into the system's LOCALBASE at PBI installation time. This is useful for placing binaries and files in the user's PATH. When building PBIs from a FreeBSD port, this file is usually not needed as most binaries and files are auto-detected and placed in the LOCALBASE. Example 10.7a shows an example usage:

Example 10.7a: Example external-links File

# Files to be Sym-Linked into the default LOCALBASE

# One per-line, relative to %%PBI_APPDIR%% and LOCALBASE

# Defaults to keeping any existing files in LOCALBASE

# TARGET                LINK IN LOCALBASE       ACTION

#etc/rc.d/servfoo       etc/rc.d/servfoo        keep

#include/libfoo.h       include/libfoo.h        replace

#etc/rc.d/servfoo       etc/rc.d/servfoo        keep

bin/firefox3            bin/firefox3            binary,nocrash

The flags in the ACTION column are as follows:

- keep: if this file already exists in LOCALBASE, don't overwrite it

- replace: replace this file in LOCALBASE if it exists

- binary: this file is an executable

- nocrash: used for binary files; don't display crash handler if program exits with non-0 status

4. resources/

The resources/ directory can contain extra files you wish copied into the PBI application directory. This is often the best place for icons and other files not included with a port.

5. scripts/

This directory can contain the following scripts:

- post-install.sh: script run immediately after the extraction of PBI contents to disk

- post-portmake.sh: script run during building of the PBI file, after the port compile is finished

- pre-install.sh: script run before installation of the PBI; return non-0 to halt installation

- pre-remove.sh: script run before deletion of the PBI file

Table 10.7b summarizes the variables that may be used in these scripts:

Table 10.7b Supported Variables

Variable

Description

PBI_PROGNAME=

mandatory; should be the same value as PORTNAME= in the port's Makefile, but capitalized

PBI_PROGDIRNAME=

name of the subdirectory that is created for the PBI in /usr/pbi/ (e.g. firefox-amd64 for the 64-bit Firefox PBI)

PBI_PROGDIRPATH=

full path to the PBI install directory (e.g. /usr/pbi/firefox-amd64/ for the 64-bit Firefox PBI)

PBI_PROGVERSION=

version of the program; should be the same value as the DISTVERSION= in the port's Makefile

PBI_RCDIR=

location of rc.d/ directory used by PBIs, usually /usr/local/etc/rc.d

SYS_LOCALBASE=

LOCALBASE of the default system, typically /usr/local

PBI_FAKEBIN_DIR=

the binary wrapper directory, typically /usr/pbi/<pbidir>/.sbin/

The xdg-menu/ and xdg-desktop/ directories can be used to supply menu and desktop icons, respectively. The file that you place in these directories should be in the format pbiname.desktop. Example 10.7b shows the firefox.desktop files for the firefox PBI:

Example 10.7b: firefox.desktop File

more xdg-menu/firefox.desktop

#!/usr/bin/env xdg-open

[Desktop Entry]

Value=1.0

Type=Application

Name=FireFox

GenericName=FireFox

Exec=%%PBI_EXEDIR%%/firefox %U

Path=%%PBI_APPDIR%%

Icon=%%PBI_APPDIR%%/share/pixmaps/FireFox-128.png

StartupNotify=true

Categories=Network;

more xdg-desktop/firefox.desktop

#!/usr/bin/env xdg-open

[Desktop Entry]

Value=1.0

Type=Application

Name=FireFox

GenericName=FireFox

Exec=%%PBI_EXEDIR%%/firefox %U

Path=%%PBI_APPDIR%%

Icon=%%PBI_APPDIR%%/share/pixmaps/FireFox-128.png

StartupNotify=true

%%PBI_EXEDIR%% should reference the PBI's executable and any required switches.

For more details on the XDG menu specifications, please refer to the freedesktop specifications.

7. xdg-mime/

The xdg-mime/ directory is used to register file associations according to the freedesktop MIME specs. This requires the creation of an XML file. The example shown in Figure 10.7c adds the MIME information for gimp, so that it can be available as an application choice in a web browser:

Example 10.7c: Gimp MIME Info

more xdg-mime/gimp-xdg.xml

<?xml version="1.0"?>

<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>

<mime-type type="application/x-gimp">

<comment>Gimp - XCF File</comment>

<glob weight="100" pattern="*.xcf"/>

<glob weight="100" pattern="*.XCF"/>

</mime-type>

</mime-info>

10.7.4Useful Tips

If your PBI's executable does not run, it may be because the program executable is actually a wrapper script rather than a binary file. If so, check the first line of the script to make sure it is using the right path for the scripting language. For example, #!/bin/python is an incorrect path which should be changed to #!/usr/pbi/(pbi-name)/bin/python.

The suggested path works because each program is packaged with the proper version of the language it uses and you want to make sure it uses that one. This is usually accomplished by putting a quick sed line in the post-install.sh script to fix the first line as seen in this example.

When testing the executable, use the one located in /usr/pbi/(pbi-name)/bin/ so all the linking will be properly set up. Otherwise you can get some interesting errors about missing files.

10.7.5Getting Help

The PBI Developers mailing list can help if you:

- get stuck building a PBI

- need to ask a question about your PBI

- are ready to submit a new module

- find a bug in an existing PBI

- have a bugfix for an existing PBI

10.8Purchase PC-BSD Swag

While PC-BSD is free, some users may wish to purchase media or other items to show their support for the PC-BSD Project. PC-BSD items are available from the following websites:

- FreeBSD Mall: PC-BSD's sister company sells PC-BSD DVDs and subscriptions, stickers, The Definitive Guide to PC-BSD, and apparel.

- Amazon: sells The Definitive Guide to PC-BSD (hard copy and Kindle formats) as well as the Kindle versions of the PC-BSD Handbook. Search for "pc-bsd" to see which items are available for purchase in your country.

- The PC-BSD Corporate Storefront: sells high-quality apparel and accessories.

- iXsystems: sells professional PC-BSD support packages.

10.9Host a Mirror

We are always interested in more download mirrors. If you have a system with a high-speed connection, 150-200GB of space, and the ability to rsync with a host, you can greatly help the PC-BSD project and PC-BSD users by becoming a mirror. More mirrors means faster download speeds and more geographic locations for users to download from.

As an example, this rsync command will mirror the entire ISO and PBI collection:

rsync -vaz --delete isc.pcbsd.org::ftp .

That command should be run as a cron job with a recommended frequency of once daily.

Once you've begun the rsync process, please send an email letting Kris know the URL of the mirror so that the new mirror can get listed and become available to users.

10.10Seed a Torrent

PC-BSD is also distributed as a torrent and you can increase download speeds for other users by seeding, especially the first two weeks after a new release. If you are new to seeding, check out the FAQ.

10.11Become an Advocate

So you love PC-BSD? Why not tell your family, friends, fellow students and colleagues about it? You won't be the only one that likes a virus-free, feature-rich, and no-cost operating system. Here are some suggestions to get you started:

You can brainstorm and network with other PC-BSD advocates at the Spread PC-BSD Wiki.

You can burn a couple of DVDs and pass them out. If your school or user group has an upcoming event where you can promote PC-BSD, you can request additional DVDs here.

Consider giving a presentation about PC-BSD at a local community event or conference. Let us know about it and we'll help you spread the word.

Table of Contents

Preface

1Introduction

1.1PC-BSD's Goals and Features

1.2What's New in 9

1.3PC-BSD Releases

1.4PC-BSD for Linux Users

1.4.1Filesystems

1.4.2Device Names

1.4.3Feature Names

1.4.4Commands

1.4.5Additional Resources:

2Pre-Installation Tasks

2.1Migrating to PC-BSD

2.2 Minimum Hardware Requirements

2.2.1Minimum System Requirements

2.2.2Recommended System requirements

2.2.3Supported Processors

2.3Hardware Compatibility

2.4Laptops

2.4.1Thinkpad BIOS Versions with Known Bug

2.4.2Laptops with Built-In Intel Video Chip

2.4.3MacBooks

2.4.4Touch Screens

2.5Partitioning the Hard Drive

2.5.1Shrinking a Drive in Windows 7

2.5.2Using Parted Magic to Create a Primary Partition

2.6Obtaining PC-BSD

2.6.1Selecting Which File to Download

2.6.2Data Integrity Check

2.7Burning the Installation Media

2.7.1Burning the CD/DVD ISO File on Windows

2.7.2Burning the CD/DVD ISO File on a BSD or Linux System

2.7.3Burning the CD/DVD ISO File on a Mac OSX System

2.7.4Writing an IMG File to USB

2.8PC-BSD Live Mode

2.9Using VirtualBox

2.9.1Creating a Virtual Machine

2.9.2Configuring the Storage Device

2.9.3Configuring the Network Adapter

2.9.4Troubleshooting VirtualBox

3Installing PC-BSD

3.1Starting the PC-BSD Installation

3.2Welcome & Language Selection Screen

3.3Keyboard Setup Screen

3.4Installation Type Screen

3.5Disk Setup Screen

3.6User Creation Screen

3.7Meta Package Selection Screen

3.8Sources Selection Screen

3.9Pre-Install Summary Screen

3.10Installation Progress Screen

3.11Installation Finished Screen

3.12Post Installation

3.12.1 PC-BSD Graphical Boot Loader

3.12.2Configuring Display Settings

3.12.3 Logging In

3.12.4 Auto-login

3.12.5Welcome & Getting Started

3.13Installation Troubleshooting

3.13.1Network Installation Fails

3.13.2 Installation Fails

3.13.3System Doesn't Boot

3.13.4 Getting Help

4Advanced Installation Topics

4.1Using the PC-BSD Installer to Install FreeBSD

4.2Install PC-BSD Over a Network

4.3Using a Custom Partition Layout

4.3.1Customizing a UFS Partition

4.3.2ZFS

4.4Disk Encryption

4.4.1Encrypting Other Partitions

4.4.2Using Your Passphrase

4.5Dual Booting

4.5.1Choosing the Installation Partition

4.5.2GAG, The Graphical Boot Manager

4.5.3GRUB

4.5.4Dual Boot with Windows Using EasyBCD

4.6Upgrading PC-BSD

4.7Creating an Automated Installation with pc-sysinstall

4.7.1Determine Which Variables you Wish to Customize

4.7.2Create a Customized Configuration

4.7.3Create a Custom Installation Media

5Desktops

5.1GNOME2

5.2KDE4

5.3LXDE

5.4XFCE4

5.4.1XFCE Applications

5.4.2Editing the Menu

5.4.3Mounting Devices

5.4.4XFCE Plugins

5.5Awesome

5.6Fluxbox

5.7FVWM

5.8IceWM

5.9Openbox

5.10ScrotWM

5.11Window Maker

5.11.1Working with the Dock

5.11.2DockApps

6Installing Applications and Keeping PC-BSD Updated

6.1Using AppCafe™

6.1.1Installing and Uninstalling PBI Software

6.1.2Updating Installed PBIs

6.1.3Repositories

6.2PBI Manager

6.2.1New Features

6.2.2What is the PBI format?

6.2.3Underlying File / Directory Structure

6.2.4Command Reference

6.3Update Manager

7Control Panel

7.1Ports Jail

7.1.1Initializing Ports Jail

7.1.2Installing FreeBSD Packages

7.1.3Compiling FreeBSD Ports

7.2Service Manager

7.3System Manager

7.3.1Generating a Diagnostic Report

7.3.2Setting an Update Mirror

7.3.3Install/Uninstall Desktops and System Components

7.3.4Install FreeBSD Source and Ports

7.3.5Set Miscellaneous Options

7.4User Manager

7.5Display

7.5.1Desktop Effects and Compiz

7.5.2Troubleshooting

7.6Printing

7.6.1Researching your Printer

7.6.2Adding a Printer

7.6.3Manually Adding a Driver

7.6.4Printer Troubleshooting

7.7Network Configuration

7.7.1Devices: Ethernet Adapters

7.7.2Devices: Wireless Adapters

7.7.3Network Configuration (Advanced)

7.7.43G and PPP Settings

7.7.5Proxy Settings

7.7.6Troubleshooting Network Settings

7.7.7bwn(4) and bwi(4) Drivers

7.7.8If a Driver Does Not Exist

7.8Firewall Manager

7.9Life Preserver

7.9.1Creating a Backup

7.9.2Configuration Options

7.9.3Restoring a Backup

7.10Warden™

7.10.1Installing Warden™

7.10.2Using the Warden™ GUI

7.10.3 Exporting/Importing Jails

7.11Thin Client

7.11.1Building the Thin Client Server

7.11.2Using the Thin Client Server

8Common Tasks

8.1Java, Flash, and Fonts

8.1.1Java

8.1.2Flash

8.1.3Fonts

8.1.4Installing Custom Fonts

8.2Multimedia

8.2.1Troubleshooting Sound

8.3MythTV

8.3.1Running MythTV for the First Time

8.4XBMC

8.5Windows Emulation

8.5.1Installing and Using Wine

8.6Files and File Sharing

8.6.1File Managers and File Structure

8.6.2Samba

8.7Remote Desktop

8.7.1Connecting to Another Computer Using RDP

8.7.2Allowing Another Computer to Connect Using Desktop Sharing

8.8Security

9Finding Help

9.1PC-BSD Forums

9.2IRC Channel

9.3Mailing Lists

9.4FreeBSD Handbook and FAQ

9.5Social Media

9.6Search and Portals

9.7Other Resources

10Supporting PC-BSD

10.1Become a Beta Tester

10.2Become a Translator

10.3Become a Developer

10.4Report Bugs

10.5Submit PBI Requests

10.6Test PBIs

10.7Create PBIs

10.7.1Using EasyPBI

10.7.2Creating a New PBI with pbi_makeport

10.7.3PBI Module Components

10.7.4Useful Tips

10.7.5Getting Help

10.8Purchase PC-BSD Swag

10.9Host a Mirror

10.10Seed a Torrent

10.11Become an Advocate