FreeBSD Part 3

Now, I need to install the desktop applications that will make the laptop useful. I should probably go over a few basic requirements:

- Web browsing (goes without saying)
- Code editing (with a modern, GUI editor)
- Clean, graphical FTP client
- Multimedia playback (DVDs, video files, audio files, etc)
- Shockwave Flash playback
- PDF reader
- Mounting SMB shares
- Probing for and connecting to wireless access points
- Graphics/image editing (just basic stuff)
- Office suite

Those capabilities, plus everything in standard FreeBSD, give me a very useful portable computer. I want to write code while kicking back on the couch, and play videos while on the road. This accomplishes both, plus a few more things that helps remove the tether to my desk. Being an old system, I'm not concerned with running large GUI apps (like the Adobe suite or complex video games).

The first thing to do is get a couple functional web browsers. The lightweight Midori (WebKit) browser is the suggested browser for XFce, so let's install that:

cd /usr/ports/www/midori
make install distclean


I absolutely love WebKit. But, I can't really live without Gecko, so I also install Firefox:

cd /usr/ports/www/firefox35
make install distclean


Compiling browsers is not for the impatient. Both of these take the better part of a day to build on my system. Once installed, one of the cool features of XFce starts to show itself: the application menu automagically updates with shortcuts to your new programs.

Next, let me say that I develop Flash presentations as multimedia and interactive components that are integrated into larger web applications. It's a great platform when used responsibly. The unfortunate abuse of Flash as the sole content output in a growing number of sites makes having a working Flash plugin nearly required these days. Adobe has made some excellent progress into opening their technology for a larger number of developers (the open source Flex SDK is one example). Unfortunately, Adobe still doesn't consider operating systems that aren't Windows, Mac, or Linux to be important enough to compile a couple more player binaries (or, just release a special open source player so the rest of the world can build their own players). For FreeBSD, we run it through the (now standard) Linux binary compatibility layer. It's not as bad as all-out emulation anymore, but I'm sure a few system calls are being translated. Here's the procedure I followed (I already have linux_enable="YES" in /etc/rc.conf):

sysctl -w compat.linux.osrelease=2.6.16
echo "compat.linux.osrelease=2.6.16" >> /etc/sysctl.conf
echo "OVERRIDE_LINUX_BASE_PORT=f8" >> /etc/make.conf
echo "OVERRIDE_LINUX_NONBASE_PORTS=f8" >> /etc/make.conf
echo "linproc /usr/compat/linux/proc linprocfs rw 0 0" >> /etc/fstab
mkdir -p /usr/compat/linux/proc
mount /usr/compat/linux/proc
cd /usr/ports/emulators/linux_base-f8
make install distclean
cd /usr/ports/www/linux-flashplugin9
make install distclean
cd /usr/ports/www/nspluginwrapper
make install distclean
nspluginwrapper -v -a -i
cd /usr/local/lib/firefox3/plugins
ln -s /usr/local/lib/browser_plugins/npwrapper.libflashplayer.so


Restart the browser, and visit a site that uses Flash somewhere. The player should work (even if slow). This takes a while (building the Linux dependencies, and whatnot), but it does work. I had some old instructions based on older versions of FreeBSD and the Flash plugin, and it really took me a while to get everything updated to the version 9 player and the linux_base-f8 stuff. I'm fairly confident in this set of directions if I didn't hose myself with the linux_base-fc4 fiasco.

Another essential application for using the web is a PDF reader, and there are a number of choices. It seems one of the simplest readers is called epdfview:

cd /usr/ports/graphics/epdfview
make install distclean


Some basic development applications:

cd /usr/ports/editors/jedit
make install distclean


jEdit depends on something that requires a browser download. Someone feels they're too awesome for BSD-style licenses, and ends up making our lives more complicated.

cd /usr/ports/ftp/filezilla
make install distclean
cd /usr/ports/graphics/inkscape
make install distclean
cd /usr/ports/graphics/dia
make install distclean
cd /usr/ports/graphics/gimp
make install distclean


Finally, we come to the office suite. On Windows, I've completely converted to OpenOffice.org. I already know OpenOffice.org will take longer to compile than the entire system up to this point. So, the logical conclusion is to install it from a package. However, it seems there are very few packages maintained for OOo (not surprising, as it would take a lot of disk space and compiling resources). As of writing this, my plans are to get another FreeBSD 7.2 system on a high-performance server, build OpenOffice.org there, and use the pkg_create utility to build a distributable package. I will follow up on this article depending on the success of that process (I still need to get one of my faster servers updated to 7.2).

As stated earlier, multimedia playback is an important aspect. Back when I first learned about setting up X desktops (10 years ago), multimedia was a bit of a pipe dream. Sure, there were a few video formats that were easy to play. But, many of the video formats were so new, even the Windows codecs seemed to be in a state of "experimental development." Forget Unix and Linux versions. Even in the last two years, though, the ffmpeg project has come a long way, and playing most formats on an open desktop is actually very simple. On my Windows systems, I've found VLC to be a great player, and there are GTK- and QT-based versions of VLC.

The gotcha here is that VLC uses the "XVideo" overlay by default. This default setting crashes my X server. As an inexperienced FreeBSD desktop user, this took a while to nail down. But, like many things, Google figured it out after a few searches for the error message in the X server's log "unable to pin xv buffer." Apparently, the FreeBSD version of X.org likes to use a different overlay, called "x11." VLC lets you pick the overlay system, and just picking "x11" lets you play videos without crashing the X server. This is slightly frustrating to have your desktop crash for trying to open a video. Especially considering how much time I put into it up to this point, I thought I would have to scrap it and go back to Windows, and deal with the crappy performance.

At this points, I have a great set of desktop applications running on my system. There's a few more topics to discuss (wireless networking, SMB file shares, desktop power management, and a friendlier startup/login process). I think that will make a good final article to this series. More to come!