KIS Systems, Inc - Contract Programming for Unix/Windows/Web in C++/C#/PHP/Qt/.NET and other technologies.

KIS Technoblog

Technical ruminations from our chief codemeister – Rick Berger

Archive for February, 2008

More on VMWare Fusion…

Posted by rickb on 20th February 2008

As I write this, I have three virtual machines running simultaneously alongside OS X:

  • A 256mb FreeBSD system, commandline only (no X). This is my local webserver.
  • A 396mb Ubuntu system running KDE
  • A 764mb Windows system running XP

This is all under VMWare Fusion on a 2.0ghz/2gb/250gb white MacBook. The VMs are located on an outboard USB drive.

And it’s not killing the machine!!

Kind of amazing, really, when you consider they collectively take up 1416 mb of memory on a 2gb machine. that leaves a bit more than 500mb of memory for OS X (Leopard) to run in.

As the VM’s fired up, there was a bit of a slowdown, but once they settled down from the boot activity, I could switch from one to the other without a perceptible drop in performance (assuming no heavy background processes running on any of them – I imagine inducing a large software build in any of them would probably load things down.)

I’m way impressed. I tried running the Ubuntu image and the WinXP image simultaneously under Parallels, and it brought the machine to its knees. I didn’t have to reboot the host machine, but I had to wait an excruciatingly long time for the selected guest machine to shutdown cleanly and the system to regain it’s composure.

Under Fusion, things are running surprisingly well. I’m sure I won’t keep it this way (I don’t think), but it’s nice to be able to do it.

I guess you have to credit VMWare’s long history doing virtualization technology that make this happen. I can only wonder how many images I could run simultaneously on a Mac 8 core tower (drool) without performance degradation.

As it is, I’m pretty happy being able to run the three I can.

Competitive Upgrade for Fusion

As of this writing, VMWare is offering a competitive upgrade rebate to Fusion – after you apply the rebate, Fusion comes out to around $50.

Think I’m going to have to do it, based on what I’ve seen.

Some Asides/Gripes

Just a couple of notes:

  • I’d like to be able to set the IP range for the NAT system manually, leaving a few for statically assigned addresses. I need this primarily for the FreeBSD web server, but I like all the VMs to have known addresses.
  • (There is a way to do this – you have to go in and edit some buried configuration files – would rather see an interface to do it, like on VMWare Workstation in Windows.)
  • Not really a criticism as something to ponder: I want to use a bluetooth headset for Yahoo Messenger VOIP capability (YM VOIP isn’t supported on the Mac, yet). In Parallels, an intermediate driver is installed between the hardware and the VM’s – thus, when you change the sound source on the host system to bluetooth, you can get it in the guest without messing up anything else.
  • In Fusion, the guest apparently has access to the hardware and, thus, communicates with the BT driver, directly.
  • Powerful, in one sense, but if you also happen to be using a BT mouse or keyboard or other device, the VM grabs that, too, and it doesn’t go back to the host system. Ever.

So, an annoyance, there, but not a deal breaker.

rickb

Posted in Linux, Mac, MacIntosh, Parallels, Platforms, VM, VMWare | 1 Comment »

More VMWare vs. Parallels Investigations

Posted by rickb on 18th February 2008

So, after having a few meltdowns w/ Parallels, I decided to give VMWare Fusion a go.

The Parallels problems seem to have gone away (fingers crossed) with the latest Mac OS X upgrade.

But, I’m still working with VMWare. A couple of pluses:

  • I could be wrong, but qualitatively, I think XP under VMWare is faster. I do a lot of compilations over shared volumes – they seem to go faster under VMWare.
  • The images are smaller w/ VMWare. In the case of my XP VM, it went down from 38gb to 33gb. That’s significant.

On the down side:

  • Trying to get Yahoo Messenger to work in the XP VM was a nightmare – big hangs and I had to power down the system and reboot several times.
  • Bluetooth audio doesn’t appear to be working in VMWare.

Both of those features in the last work quite well in Parallels.

But, the only thing I want this capability for is VOIPing over YM. The good news on that front is that Yahoo has just release a Mac version of Messenger (and that’s a big honkin’ YAHOO!). Thus far, it seems to work pretty well.

Which eliminates the need for the VOIP solution under the XP VM (one of the critical reasons for keeping Windows around…)

Users of Skype can be happy, too – they’ve had Mac version out for some time, now.

rickb

Posted in Parallels, Platforms, VM, VMWare, VOIP, Virtual Machine Software, Windows | No Comments »

More MacBook Issues

Posted by rickb on 13th February 2008

The White MacBook (new) under Leopard has been doing a new trick: The keyboard, mousepad and mouse button go dead, every now and again.

The bluetooth mouse continues to work, fortunately. I can at least mouse through the open apps (and the VMs) and cleanly close them, before shutting down the machine.

On a reboot, everything seems to be fine.

Oh, well. I’m doing another OS X update, as I write (waiting for another little 180MB download…)

Maybe that will fix it.

rickb

Posted in Mac, MacIntosh | No Comments »

End of Parallels?

Posted by rickb on 12th February 2008

On my machine, anyway?

I’ve just upgraded to Leopard on my MacBook – everything seemed to work ok, including the new XCode environment. But, XP under Parallels has been causing kernel panics, regularly.

What to do? I tried to semi-retrograde the MacBook to Tiger by installing that on a USB disk, that I can boot from. I’ve wanted to have a dual-boot scenario, anyway.

Nice try, no cigar. It seems that once OS X sees a new version on a disk, it won’t let you install a previous version, at all, anywhere. Trying to boot from the DVD produces an endlessly wheeling circular progress indicator.

The only way I can make that happen, it appears, is to pull the disk from the machine , insert another, and install fresh. Since this is my only machine, I’m not terribly enthused about that option (but I may screw up the courage — and the time — to do it, anyway.)

On to VMWare…

The next option is to try another VM solution, entirely: VMWare has had it’s Fusion product for the Mac out for a few months now — I could download a trial version and see how it goes.

The upshot is: it goes real well. It has successfully converted my XP and Ubuntu images to VMWare images (the Ubuntu went a little rough — uninstalling Parallels Tools from within the VMWare image waxed the X11 environment. I had to uninstall the tools under Parallels on the original machine and reconvert. Second try worked fine.) Just a FreeBSD image to go.

And the kernel panics went away.

Furthermore, the Ubuntu VM’s “multiple hit” problems with the mouse and keyboard have disappeared, as well.

And, another plus: I like to autohide taskbars, when I can. In Ubuntu under Parallels, I couldn’t do this — if I turned the feature on, the bar went away and hitting the mouse on the target edge would not bring it back. I had to find the keycode to pull it back up, and then turn off the auto-hide feature. Under Fusion, it works great.

So, I have to say, I’m impressed with VMWare’s efforts on the Mac (I had used them before on Windows, and they were rock solid there.) The networking came up transparently (I’m still trying to figure out what voodoo they did to map my VM’s current IP address range into their NAT – maybe they got it from the Parallels network pseudo-devices…)

Aftermath

There’s more to test – how do USB devices fare?  Do I get USB 2.0 or 1.1, if I get it at all?

I hate to give up on Parallels – they brought me to the Mac dance, after all. And it’s paid for.

But, in the end, I can’t have kernel panics, and I want my VM’s to work without funny glitches.
rickb

Posted in Mac, MacIntosh, Parallels, VM, VMWare, Virtual Machine Software | No Comments »

Finding Unresolved Link References on the Mac/Gnu

Posted by rickb on 5th February 2008

I recently built a third party source on the Mac, only to find it had a number of unresolveds (link errors.)

If you build in XCode, the tool is kind enough to tell you what’s referencing the unresolved(s). From the commandline, it’s not so obvious.

Since this is third party code, I don’t want to have to go through the hassle of building an XCode project — but I need to find out which modules were referencing the link unresolveds.

Finally, after a bit of head-scratching, I got the solution — so I can share it, here, if you’re unlucky enough to be searching for this needed capability:

The Solution – Getting the Module/Filename That References the Unresolved

You need to enable a link flag ‘-y’, followed by the unresolved symbol (you’ll get that from the failed link output.) Go into the Makefile and find LDFLAGS (’ld’ is the gnu linker — this is the typical Makefile variable for the options) and add the ‘-y’ flag, followed by the symbol, like this:

LDFLAGS = -y__2435ZClass5FunctioniiiEi [rest of options]

Some of the symbols can get quite long — make sure you paste and copy the whole thing, including the leading underscores. Next time you do a build, the link step will output a line as to what module in your project references that symbol (yay.)

Your work’s not necessarily over — the lib I was building uses a very complex class hierarchy, and it wasn’t apparent which lines of code were causing the unresolved, even though I knew what file it was happening in. If that’s the case, then what I do is selectively #ifdef out parts of the file until I can make the unresolved symbol appear and disappear in subsequent links. Then I can narrow it down to the offending line and fix it. (You get a whole bunch of other unresolveds as you comment out sections of the code — ignore those, of course.)

Tedious, but it works.

I imagine the same would apply in a linux/bsd environment — anything that’s using the Gnu toolsuite.

rickb

Posted in C++, Mac, MacIntosh, Open Source, Programming, Software Development | No Comments »

Qt Demo – QXListView “Active List”

Posted by rickb on 1st February 2008

The code and demos for this discussion can be found here: http://www.kis-systems.com/examples/QXListView
There are executable demos for Mac,, Windows, and Linux.

An ‘Active List’

I’ve been working part-time for the past couple of months on a project that has been buzzing in the back of my head for a long time: upgrading a piece of ‘active list’ functionality to Trolltech’s Qt 4.

Basically, the idea is this: We want certain cells in a listview to be ‘active’ – i.e., when you click on them, something happens in the app, immediately. Furthermore, we’d like these cells to look and behave like native widgets (checkboxes, radio buttons, etc.), but, of course, we don’t want to load up the listview with a few thousand widgets to achieve this.

Original Implementation: Qt 3

The original implementation was in Qt 3, and was a real bear to do. I had to intercept a lot of events and signals and do a lot of overrides to QListView — ostensibly not an unreasonable requirement (this is OO programming, after all) — but many of the overrides and signals didn’t behave as expected, or had funny side effects. Ultimately, I had to resort to a few tricks to get “way under the covers” and ferret out internal functionality.

It worked, but many aspects were not an optimal or happy solution. I had to document profusely what I was doing, and flag caveats where I was relying on undocumented internals that could change at any time.

Qt 4 to the Rescue!!

So, along came Qt 4. The trolls had refactored everything in the ListViews’ implementation to align with their new Model/View architecture.

Eventually the project wound down and I was no longer part of it. I did a feasibility paper on moving QXListView to Qt 4, but I wound up moving on to other things and the idea was shelved.

Eventually I found myself in between gigs, Qt 4 was by this time way beyond any stability issues, and this problem had been gnawing at the back of my head for the past couple of years. Time to push it to the top of the stack.

The Port

I’m happy to report that the port to Qt 4 wasn’t particularly onerous (despite some of the horror stories I’ve heard from others.) I did have to pretty much rewrite the entire thing, but I didn’t have to resort to any funky tricks to make it work. I did have to follow some of Qt’s internals to see what it was doing and what it expected, but that’s just part of Qt development — more importantly, I didn’t have to ferret out or use anything undocumented. I did have to derive a whole bunch more classes and figure out their inter-relation to each other. And, of course, I had to fit the paradigm into the Model/View indexing scheme. None of that turned out to be terribly onerous, either.

There was a bonus: editing text fields in the Qt 3 implementation would have required significantly more effort. Likewise, re-ordering the columns would have required more effort, since we would have had to do a “logical” vs. “display” mapping (and keep it all synchronized and current.) As a result, those features never really did make it to the “todo” stack. In the Qt 4 implementation, however, those features basically came along for free.

A Good Result

The outcome is a functionality that I think will still be very useful in future projects. And, if nothing else, it’s a good example of how to override and turn Qt’s Model/View architecture to do your bidding.

And now, of course, I need to put this away and get on to the “next important thing”…

Posted in C++, Qt, Software Development | No Comments »