Dedicated to my late brave, beautiful and silly mummy, Debra Ross. I love you mumster.

Skip navigation

Tunneling X11 through SSH on Mac OS X

As I increasingly use and rely upon Unix-like operating systems such as FreeBSD (and GNU/Linux) on desktops, I tend to forget at times that I’m using a sophisticated server installed locally to generate my graphical environments, namely X11. And just as with any server I can call it up from another machine and use its services.

X11.app X11 was built specifically to serve graphical applications over networks, and can still be used in this way by employing SSH on the client, and installing the desired applications on the server. My primary desktop is a DIY running FreeBSD 7.0 (more on my debacle with Debian GNU/Linux in a later post!), and my primary mobile machine is an original generation MacBook Pro.

USELESS ASIDE: Given the fact it’s about time for my half-yearly move back to Adelaide, Australia I’ve been contemplating how best to access my desktop machines here in Singapore using my MacBook Pro which I’ll be taking with me. These are the things that keep my up at night.

To access desktop applications on a remote Unix-like machine on your Mac, fire up your Terminal and use the regular SSH command, but with the -X flag:

% ssh -X [USERNAME]@[HOST MACHINE]
% Password: [PASSWORD]

Provided you have installed X11.app from either your Tiger or Leopard install DVD; or better yet downloaded the latest community build of Xquartz from MacOSForge; you should now be able to enter in the name of a graphical application and have it appear!

Tunneled FreeBSD X11 apps on Mac OS X
Tunneled FreeBSD X11 apps running on Mac OS X through SSH

For example, I entered % xfce4-panel and used that to launch some of my favourite apps, as you can see above. Over my local home gigabit ethernet connection and even at Starbucks on the free Singapore public WiFi networks the applications felt like they were running on my local machine.

You may recognise the Xfce panel from my previous post on Xfce and Openbox. There’s a reason for that; I’m using the panel remotely from the same machine. Ain’t [computer] science wonderful?

Plus then you can do things like run local Mac applications and the remote X11 applications on the same screen:

Tunneled FreeBSD X11 apps on Mac OS X
Xfce’s Thunar file manager compared to Leopard’s Finder

Fun with Xfce part 4: Using Openbox

What started as a mini series on the Xfce Desktop Environment on my university intranet has evolved into an open ended exploration on my public blog, and I’m having lots of fun doing it! Scroll down to the end of this post to view links to the previous posts in the series.

Part of the Xfce desktop environment is Xfwm, the Xfce window manager. Xfwm provides sophisticated and pretty composting effects such as drop shadows and alpha transparency on windows and menus, while still using less memory and power than competing desktop window managers. Despite this, for much slower machines even Xfwm can be overkill.

ASIDE: "Window managers" draw the widgets, title bars, resize handles and other elements onto application windows. "Desktop environments" such as KDE, GNOME and Xfce bundle their own window managers along with software developed specifically for their environments, such as Thunar for Xfce.

Enter Openbox, again! Openbox is an extensible, standards compliant, very minimalistic window manager that can be used by itself or in place of a desktop environment’s default window manager to further reduce memory and processor resources. The separate obconf utility provides a nice graphical control panel you can use to switch themes and adjust settings.

The Obconf window and Xfce Settings menu entry
Openbox running in Xfce with the bundled "Mikachu" theme

Most reputable package managers carry both Openbox and obconf, check your distribution’s repositories. To install them on my favourite BSD flavours for example:

FreeBSD ports system or package
# cd /usr/ports/x11-wm/openbox && make install clean
# cd /usr/ports/x11-wm/obconf && make install clean
or:
# pkg_add -rv openbox
# pkg_add -rv obconf

NetBSD pkgsrc
# cd /usr/pkgsrc/wm/openbox && make install clean clean-depends
# cd /usr/pkgsrc/wm/obconf && make install clean clean-depends

Now we want to kill the active Xfwm process in Xfce and open our glorious Openbox replacement. Fire up your Terminal and enter:

% killall xfwm4 ; openbox & exit

It really is smaller in every sense of the word isn’t it? To make sure Openbox is used by default whenever you start Xfce, quit Xfce and check "Save sessions for future login".

The Obconf window and Xfce Settings menu entry
Don’t worry, CC looks pretty confused herself!

You’ll also notice that the "Openbox Configuration Manager" has added itself to the Xfce Settings menu! Click on it and have fun with all the different themes, button positions, font sizes and arrangement settings.

Related posts

Fun with Xfce, part three

This post is part of a series on Xfce, originally posted on my university blog. I’m republishing them here in the hopes that others might find them useful or interesting. Cheers!

In part one of my Fun with Xfce series I talked about why I like using Xfce to begin with, and in part two I explained how to install the complete desktop environment from scratch using FreeBSD ports and pkgsrc, as well as some free GNU/Linux distros that use it by default. In this post I’ll be showing you how I spruce up Xfce to look much more spiffy, learned from many hours of experimentation!

When you run Xfce for the first time, it does look a bit bare. I revel in this; it’s like getting a blank but very flexible canvas to change as I see fit! Assuming you installed the complete desktop using a "meta" package or port, the first thing you can do is browse the built in themes and options. Right click your desktop or click the Xfce icon in the lower dock to bring up the Desktop Menu, then navigate to Settings and click Settings Manager. The control panels you’d be interested in are Desktop, User Interface and Window Manager. They’re extremely well laid out and very self explanatory.

If every computer system had configuration panels that were as intuitive as Xfce’s, I imagine the world would be in a much less stressed place!

Settings windows in Xfce 4.4.2
Settings windows with the default Xfce 4.4.2 themes & decorations

While Xfce does come with a beautiful collection of polished window manager decorations (aka title bar styles), personally I don’t like the built in themes as much and am not a big fan of the lone icon set. Fortunately because Xfce uses GTK+ you can use many of the same themes and icon sets developed for the much larger GNOME desktop with no problems. Kick arse!

First to the themes: personally I like using the Clearlooks theme engine that is used by Ubuntu. It looks very polished and doesn’t have as much of a chiseled look as some of the default themes. In the FreeBSD ports system there are two different versions available which caught me out the first time! Once you’ve installed them, go back to your User Interface settings screen and choose Clearlooks from the list box.

For the fancy version, as famously used in Ubuntu:
# cd /usr/ports/x11-themes/gtk-murrina-fancy-clearlooks
# make install clean
or: # pkg_add -rv gtk-murrina-fancy-clearlooks

For the older, Bluecurve inspired version:
# cd /usr/ports/x11-themes/clearlooks
# make install clean
or: # pkg_add -rv clearlooks

As for icons, I’m a huge fan of Tango Desktop Project who’s stated aim is to "help create a consistent graphical user interface experience for free and Open Source software". The icons they’ve developed look very swish, scale beautifully and use lots of green and blue which I prefer to the default Xfce brown iconset. On FreeBSD you’ll want to grab two Tango ports, then click the Icons tab in the User Interface settings window.

# cd /usr/ports/x11-themes/icons-tango
# make install clean
or: # pkg_add -rv icons-tango

# cd /usr/ports/x11-themes/icons-tango-extras
# make install clean
or: # pkg_add -rv icons-tango-extras

Just by installing Clearlooks and the Tango iconset, you’ll be rewarded with a much prettier desktop!

Before…
Xfce 4.4.2 with Xfce theme and Rodent iconset

After…
Settings windows in Xfce 4.4.2

Okay I cheated in that second shot, I set a desktop background and changed the window decoration to Katiola which blends the menu and title bar to make it look more OS X-ish.

Stay tuned for the next installment.

Fun with Xfce, part two

This post is part of a series on Xfce, originally posted on my university blog. I’m republishing them here in the hopes that others might find them useful or interesting. Cheers!

In my Fun with Xfce part one post I explained that I find Xfce such a pleasure to use because it’s fast, lightweight and has natural visually consistency with my GTK+ apps without the bloat of GNOME, while still providing a cohesive desktop experience with functional applications. In this post I’ll be explaining how to install it.

ASIDE: If you want to give Xfce a try without going through the process of using a package manager and configuring Xorg, the Zenwalk and Xubuntu GNU/Linux distributions have Xfce as their default desktops, plus they have very slick installers and are very newbie friendly.

What’s so liberating about using Xfce as opposed to GNOME or KDE is how lightweight it is and how few dependencies it has in comparison. This is especially noticeable on computers with less storage space, and slower machines which can literally take an entire day to build a desktop environment from source, if that’s your preferred installation method. Of course this means that Xfce is missing some features, but I don’t find myself missing any of them.

Xfce About dialog box, Terminal window showing FreeBSD uname

My experience with package managers are really limited to the FreeBSD ports system and NetBSD’s pkgsrc (on NetBSD and Slackware Linux), so these will be the systems I’ll talk about here. Most *nix package management systems have Xfce though, and most have an easy to install “meta” package that contains the whole desktop.

To install a complete Xfce desktop on FreeBSD (I’m assuming you already have X installed and configured), update your ports tree (visit the Using the Ports System chapter in the FreeBSD handbook if you need help) then compile and install. Alternatively you can install the pre-compiled package which is generally up to date with Xfce’s releases (currently at 4.4.2).

# cd /usr/ports/x11-wm/xfce4
# make install clean
or …
# pkg_add -rv xfce4

On NetBSD and/or if you’re using pkgsrc, the procedure is just as easy:

# cd /usr/ports/meta-pkgs/xfce4
# make install clean clean-depends

Then it’s simply a matter of adding exec startxfce4 to your .xinitrc file in your home directory; create it from scratch if it doesn’t exist. Make sure to comment out any other lines related to other desktops and/or window managers you might have installed (but obviously keep lines you may have added to have X11 applications start automatically when you launch X).

Typing startx at this point will start X and your new Xfce desktop!

ASIDE: If you haven’t aliased your machine’s hostname to 127.0.0.1 in your /etc/hosts file, Xfce will give you a warning message. You can safely ignore it, but it can get irritating after a while! Edit your host file to fix this.

In the next post I’ll be explaining how I pretty up Xfce by adding new themes and icon sets, and how to make it look like other desktops. Stay tuned.

Fun with Xfce, part one

This post is going to be part of a series on Xfce, originally posted on my university blog. I’m republishing them here in the hopes that others might find them useful or interesting. Cheers!

You may have noticed a few weeks ago I announced that I was moving my primary machine over to GNOME from KDE, mostly because the applications I use most heavily on FreeBSD and GNU/Linux are all GTK+ based and it seemed silly to run them in a Qt system. I’m a sucker for eye candy and visual consistency.

Well here I am now typing this on my newly reinstalled FreeBSD, Xfce desktop and it’s running great.

My FreeBSD Xfce 4.4.2 desktop!

You can be forgiven if you’re new to the world of Linux, BSD and X11 in general if you’ve never heard of Xfce; it certainty has been given far less publicity than the heavyweights GNOME and KDE despite it actually being born around the same time. Unlike GNOME and KDE which strive to be the ultimate desktops with all the bells and whistles, Xfce is designed to be lightweight and fast while still being a usable and complete desktop environment out of the box (as it were). This means unlike vanilla window managers such as Fluxbox it also includes a file manager, desktop background and icon support, graphical configuration, panels and so forth. A full list of included goodies is maintained on the Xfce projects site.

The real kicker for me is that as with GNOME, Xfce uses GTK+, meaning all my most used applications such as Gnumeric, Abiword, Mozilla Firefox, The Gimp, Inkscape, Thunderbird and the X11 version of VIM all look really slick and match the rest of the system. I’m a sucker for eye candy and visual consistency. Wait, I already said that.

In the coming days I’ll be posting many more entries about my experiences with Xfce including how I’ve customised and used it and some other tidbits I’ve picked up along the way. Stay tuned :-).

Sleek Openbox in KDE on FreeBSD

We all readily admit that KDE is the greatest desktop environment ever developed for BSD, Linux, Solaris and other Unix-like operating systems, but that’s not to say it can be improved by, or complimented with, other software.

ASIDE: Some people may not agree with my statement that KDE is the greatest desktop environment ever developed for Unix-like operating systems. I readily admit that Xfce is also very nice, especially when you’re using lots of GTK+ applications.

If you’re a GNOME person, well I guess we can’t all be perfect ;-)

Case in point, the Openbox window manager. Window managers draw the widgets, title bars, resize handles and other elements onto application windows. Desktop environments such as KDE, GNOME or Xfce bundle their own window managers along with software developed specifically for their environments, such as Konqueror for KDE.

Despite this bundling, it it is possible to replace the default window manager with one that you choose. You may do this to reduce memory usage, change functionality, or even just for a different visual style.

Openbox running in KDE (with Amarok listening to Whole Wheat Radio!)
Openbox running in KDE (with Amarok listening to Whole Wheat Radio!)

To use Openbox instead of Kwin in KDE on a FreeBSD (or similarly configured) machine:

  1. Update your ports tree, then
    cd /usr/ports/x11-wm/openbox/ && make install clean.
    Alternatively, just install the package with pkg_add -rv openbox
  2. Open the .xinitrc config file in your home directory
  3. Comment out # exec startkde (add a pound sign / hash)
  4. Add exec openbox-kde-session

For NetBSD, you’ll want to update pkgsrc then /usr/pkgsrc/wm/openbox/ && make install clean clean-depends instead in step 1.

To make it easier to change visual themes, the layout of the widgets and so forth, you might also want to install the ObConf tool which is also available in FreeBSD Ports and in NetBSD’s pkgsrc.

Windows Vista “Yawn”, Xfce 4.4.0 is out!

Windows Vista is As you no doubt have already read on thousands of other blog sites, Windows Vista (Microsoft’s latest attempt to hack together a true operating system) was released worldwide today. Apparently given the timezone difference people in New Zealand and Australia were the first to get their hands on the shrink wrapped boxes, all ready to enjoy the gaping security holes, unreliable operation and DRM that actually makes using your media harder than XP and is in violation of your free use rights and common decency. No “wow” from me here, just “yawn”.

Seriously if you still need to run Windows for any reason, do yourself and your sanity a favour, go on eBay and buy a secondhand copy of Windows 2000 Professional.

XfceAround the same time as this trainwreck though there’s something else that has been released which will no doubt be getting less press coverage: the latest version of the lightweight, user friendly Xfce Desktop Environment for *NIX machines! If you run FreeBSD it is also now also available in Ports.

Amonst some of the changes is the addition of the new file manager Thunar which bears a striking resemblence to the Mac OS X Finder with it’s addition of a favourites bar on the side of the window, which I am a real fan of.

I really like KDE, but at the same time I’ve always been a fan of the clean design of Xfce and this is the first version I’ve seen that actually is making me seriously considering moving over. I’ll probably run both on my FreeBSD partition for now and see. I’m just absolutely blown away by the speed; on my MacBook Pro it’s a matter of seconds when I type startx to when it’s fully loaded, it really is something.

It’s good to know that while companies in our world like Microsoft are going out of their way to make things more complicated for people, there are still people out there actually working on making lives easier.

Stay posted for my infamous screenshots ;).