Posts tagged with "freebsd"


Networking issue to blame for poor VMware Fusion BSD performance?

Screenshot of VMware Fusion 2.0 Release Candidate 1

A few days ago I mentioned that the first Release Candidate for VMware Fusion 2.0 for the Mac was made available, and I listed some of the issues I had with running the previous beta releases, with the hope the RC would fix them.

The RC didn't fix the most nagging issue I've been having, but I may be onto something.

As you know I primarily run FreeBSD in VMware Fusion: I know I'm a niche user but VMware does state FreeBSD is a supported OS, and it's the reason I went ahead and purchased a licence for their product instead of Parallels Desktop. In the version 1.x series, both FreeBSD and NetBSD performed flawlessly and I was extremely pleased with the purchase!

In the Betas for version 2.0 however, both FreeBSD and NetBSD have been suffering from appaulingly slow X11 performance. Both Xorg and Xfree86 take many minutes to load on these systems as opposed to the almost instantaneous load times in the version 1.x series of Fusion.

ASIDE: Before you get too scared, X11 performance in OpenSolaris and GNU/Linux distributions seem to be just fine!

The first Release Candidate seemed to make no difference to performance, until I was sitting at a coffee shop with my WiFi connection turned off. For some reason, without a network connection, typing startx in both FreeBSD and NetBSD caused their respective X11 environments to start instantaneously once again. Back home and plugged into the wired network, both virtual machines returned to sluggish performance.

The next step was to determine if I could reproduce the conditions back at the coffee shop and get back regular performance. Clicking the Network Adaptor icon in the status bar in the VMs and disabling the network completely eliminated the painfully long startx waiting time.

I'm hoping the final release of Fusion 2.0 will solve this problem, otherwise I'm back to using 1.0. Not to mind, Unity and the other more advanced features are Windows only anyway. It's a shame though that they're marketing it as a solution for running Windows on your Mac, not a solution for running different OSs on your Mac.


VMware Fusion 2.0 beta2 with FreeBSD review

UPDATE: An abridged version of this review has been picked up by the fine folks over at BSD News. If you've arrived here from there, all my FreeBSD and NetBSD posts can be found in the aptly-named BSD category. Cheers :-)

I've loved using virtualisation software ever since I had an early version of Connectix Virtual PC for my iMac DV back in the early 2000s, and later their Windows version before they were bought out by Microsoft. Virtual PC was mostly intended for people to use recent versions of Windows on Mac OS 8, but I preferred using it for resurrecting classic operating systems such as DOS/Windows 3.x which we had on our first home machine, and playing around with Linux distributions without going through tedious partitioning.

My predictably unnecessarily verbose introduction aside, the latest virtualisation software I'm using on a regular basis is VMware Fusion for Mac OS X, and I've been very pleased with it. The second beta release for version 2.0 is out now, and I spent my Sunday afternoon trying out build 107508 with a handful of my most used operating systems, plus FreeDOS for fun!

VMware Fusion 2.0 beta 2 Virtual Machine Library
VMware Fusion 2.0 beta 2 Virtual Machine Library

The most noticeable difference initially between this latest beta and version 1 of Fusion is the redesigned Virtual Machine Library. Taking a cue from Virtual PC, the plain text listing of virtual machines has been revised to include screenshots for the suspended machines. While I think this is a extremely useful and welcome addition for quickly recognising machines visually, I think the Mac-like glossy finishes are a bit overdone. Also despite making the interface more Mac-like overall, I can't help but think the New, Open and Settings would better be served by a regular toolbar at the top of the window.

The New Virtual Machine Assistant has been improved to allow for more boot and drive options. You're no longer limited to choosing from a physical or virtual optical disc; you can choose to use an existing virtual drive or even none at all: a VERY welcome addition! Before you run the machine the first time you're asked whether you want to modify settings too, which means you no longer have to start the machine at the end of the assistant and hastily shut it down to fine tune its configuration.

VMware Fusion 2.0 beta 2 New Virtual Machine Assistant
VMware Fusion 2.0 beta 2 New Virtual Machine Assistant

Speaking of configuration, the Virtual Machine Settings window has been drastically redesigned to make it look much more like the Mac System Preferences application, and to make it easier to access all the new options and virtual devices you can configure. Amongst the new goodies are the ability to configure floppy drives, parallel ports, serial ports, and multiple virtual hard drives. When I saw these additions, I literally jumped out of my chair and screamed "HELL YEAH!"

Fusion 2.0 beta 2 also allows you to visually scale and stretch live running virtual machine displays. Even just a little bit of scaling adversely affects the readability of text, but perhaps for other applications such as full screen gaming which needs to be scaled to fit to an unsupported resolution this might be useful.

VMware Fusion 2.0 beta 2 New Virtual Machine Assistant
Demonstration of the live visual scaling in beta 2. Both the NetBSD and Slackware virtual machines are set to 1024x768 but the latter has been scaled down.

Now for the bad news. I'm not sure if this is a temporary setback as a result of it being a beta version (I did disable debugging checks), but graphical performance in BSD operating systems on my original generation MacBook Pro is nothing short of abysmal. VMware provides welcome additions for FreeBSD, but even installing these in FreeBSD 6.3 Release and using them with the compat6x layer in FreeBSD 7.0 Release made no difference to the overall sluggishness. NetBSD 4.0 was just as bad, without any additions.

This slow performance was most pronounced when I started Xorg on FreeBSD or XFree86 on NetBSD. Typically starting an X11 environment in VMware Fusion 1.x takes less than a second followed by several seconds for loading the desktop environment or vanilla window manager. With Fusion 2.0 beta 2, both FreeBSD and NetBSD take over 5 minutes just to start X11, and another few minutes just to load something as lightweight as Fluxbox... if you want to load Xfce or KDE it takes over a whopping 10 minutes.

To check whether this was a problem with BSD, I tried Slackware Linux 12.1 with the same versions of KDE, Xfce and Xorg; and while it still felt a little sluggish it still managed to load all three in a reasonable amount of time.

Given I need to use FreeBSD for my studies I just can't use this beta release on a production machine, but if you primarily use Windows or Linux you could probably try it out.


Western Digital MyBook DHCP adventure

Before I go any further, I'd like to warn you that this post about using FreeBSD to assign an address to a Western Digital MyBook drive is unnecessarily verbose. See, I could have just as easily said "this post is long".

Writing about theoretical uses for software is one thing, but figuring out how to apply software to a problem practically, and actually getting it work, is one of the greatest feelings in the world alongside writing a fantastic piece of software yourself to solve a problem. It makes me feel useful and gives me a rush quite unlike anything else.

And he's available ladies! Unbelievable though it may seem! Come on! He also makes a mean Earl Grey latte. Any bidders? Anyone?

Case in point, my sister and I had a problem in our new house in Adelaide. Before I left Singapore, I bought a gigabit ethernet Western Digital MyBook 1GB World Edition NAS drive and loaded it up with all our media: movies, shows, music, podcasts, BSD disk images, ebooks. By using a simple network drive, we spared ourselves having to bring a separate computer down with us.

Our makeshift home network consists of each of our laptops and the aformentioned network drive which are all connected through short Cat-6 ethernet cables to a 5 port gigabit ethernet switch. To compensate for the lack of a router, I assigned my sister's MacBook and my MacBook Pro static IP addresses and I knew the network drive could also be assigned one. Very cool.

Our very fancy new home network
Our very fancy new home network.

Now here's the kicker: for some reason in their infinite wisdom Western Digital decided not to ship the MyBook with a default IP address. This means it requires a DHCP server (Wikipedia link) to initally provide it with an address. I realised that without a router with a built in DHCP server, this network drive wouldn't get an address, and therefore there'd be no way for me to log into it to assign it a static IP! Catch 22, chicken and the egg, a Bruce Schneier fact, call it what you will.

So within a few minutes I had configured a home network with two laptops and an inaccessible, address-less network drive. It seemed not having a router with a built in DHCP server would make this setup impossible. A quick Perl script determined that indeed only the two laptops were in our subdomain range:

#!/usr/bin/env perl -w

for ($i = 1; $i < 255; $i++) {
  system "ping -a -c 2 192.168.1.$i";
}

print "Western Digital engineers love DHCP it seems\n"

At this point I had to make a tough decision. To access our media network drive I could either be patient and wait a week until we got our new broadband modem with a built in router, or I could be impatient. Grilled cheese sandwich. Grilled cheese sandwich?

I decided to do the latter and give it what it wanted: a DHCP server! In place of a router, I would configure a one-time use FreeBSD virtual machine with a software DHCP server which would assign the address to the network drive, so I could log into it remotely and assign it a static IP.

My FreeBSD virtual machine showing the DHCP server coming online
My FreeBSD virtual machine showing the DHCP server coming online

After setting up a generic VMware Fusion virtual machine on my MacBook Pro, I mounted a FreeBSD 7.0-RELEASE ISO I had on already had on my hard drive and installed it with all the default options. I skipped configuring everything in the system installer except than the network card. I declined to use DHCP when it asked, and assigned it a static IP.

After rebooting the VM, I logged in as root and installed the isc-dhcp3-server package from ports.

I didn't bother adding anything fancy to the /usr/local/etc/dhcpd.conf other than defining the pool of addresses and required options:

option domain-name "chuckpeddle";
option subnet-mask 255.255.255.0;

default-lease-time 3600;
max-lease-time 86400;
ddns-update-style none;

subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.120 192.168.1.129;
}

Next, to check what addresses our makeshift DHCP server has assigned, I created the default dhcpd.leases file:

# touch /var/db/dhcpd.leases

Finally, I enabled the dhcpd daemon in /etc/rc.conf and told it what card I wanted FreeBSD to listen for DHCP requests on. On VMware Fusion 1.1.3, the network card in FreeBSD is le0, but you can always check to make sure by using ifconfig -a

dhcpd_enable="YES"
dhcpd_ifaces="le0"

The moment of truth had arrived! I turned off my Western Digital MyBook NAS drive, rebooted the FreeBSD virtual machine, then turned the network drive back on again. After a minute of waiting, sure enough the /var/db/dhcpd.leases file reported that it had assigned an address...

lease 192.168.1.129 {
  starts 6 2008/08/02 14:37:12;
  ends 6 2008/08/02 15:37:12;
  binding state active;
  next binding state free;
  [...]
  client-hostname "RubenerdNAS";
}

... and automagically the Finder on my MacBook Pro reported it had found a new samba share (with it's irreverent sense of humour)! My network drive had been resurrected from the dead!

My Western Digital MyBook in the Finder
My Western Digital MyBook in the Finder

Finally, after all of that I was able to go to my web browser and log into the damned network drive's configuration page and change the IP address to a static one.

I still can't help but wonder why Western Digital decided not to include a default address.

Western Digital NAS config screen, and the FreeBSD DHCP virtual machine
Western Digital NAS config screen, and the FreeBSD DHCP virtual machine

And now if you'd excuse me, I'm off to watch an episode of Cranky Geeks. From my network drive. PHEW!


Backing up CDs to ISOs on FreeBSD

I remember back in 1995 when I was 9 years old our family excitedly got its first CD-ROM drive. This was just before we moved to Singapore and were still living in Australia, and that small little Creative Hex Speed optical spinning wonder cost us a small optical spinning fortune. It was proudly installed above the 5.25 inch floppy drive in our generic 486SX PC clone tower. It came with 10 CDs, we had 2 already. I still have that CD-ROM drive.

MENTAL NOTE: Spend less time on the introductions and more on the actual content on the post. Nobody cares about your first CD-ROM drive!

Here we are in 2008 and despite the fact I haven't toasted or bought a CD for years I'm literally swimming in thousands of them. As a Windows user back in the dark days I remember I used Nero Express to create backup ISOs out of CDs, then either burn those ISOs to a single DVD or store them on a backup hard disk. Fortunately FreeBSD has similar capabilities with the venerable command line dd utility.

Spiffy somewhat related icons from the Tango Desktop Project
Spiffy icons from the Tango Desktop Project

Insert the CD you want to copy (no, really?), then enter the line below. Substitute acd0 with an alternative device if you have multiple optical drives:

# dd if=/dev/acd0 of=[YOUR_NAME_OF_IMAGE].iso bs=2048

This will take some time. Naturally the CPU power your machine has and the read speed of your optical drive will affect performance. A 52x optical drive on my 3.0GHz E8400 Core 2 Duo desktop takes a few minutes, my MacBook Pro a few minutes longer still, I'm sure our family 486 with a hex speed drive would take considerably longer!

For what it's worth, the same procedure can be used on NetBSD and Mac OS X from my own testing. Just switch the virtual device /dev/acd0 with the relevant line for your OS. Isn't BSD heritage fantastic? :-)


FreeBSD AMD64 is good for you

Now that I've redefined the purpose of my primary desktop machine to make it a lean, mean code compiling machine, file server and Bittorrent downloader, it's graphical performance is much less important. Therefore I've wiped Debian off it and reinstalled FreeBSD, but this time instead of settling on the standard x86 version so as to use the proprietary Nvidia graphics drivers, I've installed the full blown AMD64 64-bit version!


top

It's so nice to be back in my familiar FreeBSD environment where everything on the drive is logically and securely organised, where I can use the FreeBSD ports system, where tcsh is the default shell not bash, and where everything works the way I'm used to. Plus running the 64-bit version it can access all of my RAM and generally feels more responsive as a result.


dmesg

For what it's worth, after dappling in Debian GNU/Linux, I still prefer Slackware with Pkgsrc. FreeBSD and NetBSD are still the best though :-).

Any questions?


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 :-).