Skip to content

Packaging up a Virtual Machine

As Joe’s blog doesn’t do comments, I’ll have to reply this way πŸ™‚

Yes, we probably should have a FAQ somewhere that lists all the files you need to care about, but the reality is that tarring up the directory is good enough. It’s 2.8gb but almost all of that is stuff you want. The bits you can afford to skip are a few kilobytes at best. If you really want, I can put a list together – I don’t remember everything off the top of my head right now, but just grabbing the directory is your best bet.

If you want to copy a VM but discard all the snapshots, then you should first do a full clone of the VM and send the result to the other party. The full clone operation consolidates all the snapshot delta disks, and because it’s a full clone, there’s no dependency on the original VM.

As for the crash, if you read down through my blog, you’ll find the entry about the librsvg bug; guess what: you just hit it. But I was told this evening that the update *just* came out, so go run your SuSE update and get the fix.

The future of Galeon

I’ve also just sent this to the Galeon and Epiphany mailing lists. Let the chaos begin…

Tommi, Crispin and I were all able to attend the GNOME summit last weekend, even though Crispin had to pay his own way πŸ™‚ So, it was a good opportunity for us to sit down and discuss the future of Galeon. All of us are very much working fulltime which limits the extent to which we can hack on Galeon and the amount of activity you’ve observed speaks for itself.

As such, we’ve reached the conclusion that we have to change our approach if we’re going to avoid Galeon getting stale or bit-rotting; which is important for all of us, as we all use Galeon because we still think it’s the best thing out there πŸ™‚

So, what does changing our approach mean? It means considering Epiphany in a new light; Galeon still does a lot of things, small and large, that Epiphany either doesn’t do or doesn’t do as well, but at the same time, there are some areas where they’ve moved in front, and most importantly Epiphany has a bunch of active maintainers who are handling the things that we struggle to do for Galeon. But you say: Epiphany doesn’t fit my needs or I’d be using it already! True, so our proposal is to bring
Galeon to Epiphany.

Epiphany has a powerful extensions mechanism that exposes many of the core structures of the program and there is a general willingness to expose more as necessary. This means that many galeon features can be recast as extensions, and Crispin has already done this for a couple of things: the sidebar is now in epiphany-extensions and he’s got a few more hidden away such as in-browser view-source. Also don’t forget that some other features have been independently ported as extensions already, such as the javascript console.

There are a few galeon features which are hard to implement as extensions and/or are of a class that makes them desirable within the base Epiphany package, and these should be directly ported. I’ve already made a couple of checkins to port back/forward history copying and middle-clicking on history entries.

Between these two approaches and the more pragmatic direction that epiphany is moving in these days (heirarchical bookmark support has just been checked in!), I believe that we can reach a point where Epiphany + a set of extensions will provide the same functionality that Galeon does today.

This seems an optimal solution for everyone; it allows us, the galeon developers, to avoid duplicating work with epiphany team, it will allow users to leverage the best from both browsers and most importantly, it puts galeon on a much firmer footing for the future that is not so much at the mercy of our ability to find time to hack on it.

I hope that this sounds like a good long term strategy to everyone, but if you do find yourself recoiling from it, do realise that the current approach is unsustainable and will almost certainly result in galeon becoming unmaintained or falling too far behind in some areas, meaning that you’ll be struggling to keep using it anyway.

This process will probably take some time given our other commitments, so we intend to make a formal 2.0 galeon release (long overdue really) and keep that compiling against newer releases of mozilla, but our efforts will be directed towards this extension project.

Of course, anybody who wants to help out, either with the extensions or with maintaining the current galeon codebase, is more than welcome!

I’ve added a wiki page at Epiphany/GaleonIssues which lists current stuff I can think of. I encourage anyone to add anything that I’ve missed, but if you want to list a Galeon 1.2 feature please categorise it separately πŸ™‚

Workstation 5 on SuSE 10. *sigh*

As Joe observes, the kernel module code that ships with ws 5.0 is not happy to work with the latest kernels including the one that ships with SuSE 10. The userland code is happy but you’d need to grab Petr’s drivers to get it to work. Joe did the right thing by trying to get a hold of the 5.5 beta because it works great with SuSE 10, as demonstrated by our internal testing and the experience of other beta testers. However, the website let us down and that really is inexcusable. At the Boston Summit, some people tried to grab the beta based on our nagging and ran into the exact same error; I ended up having to VPN in to our internal network and download the beta build directly and then scp it over to them. When I get into the office tomorrow, you can be sure I’ll be making a lot of noise about this. Sorry for the trouble; if people are still having trouble downloading the beta, please post a comment to this post.

VMs for everyone!

Today, as part of our VMworld 2005 festivities, we announced our VMware Player. This is a freely downloadable tool that, as you might guess, plays virtual machines. People who’ve been participating in the Workstation 5.5 beta programme will have already seen it in its bundled form, but now you can get it as a stand-alone product. We’ve also released a special Browser Appliance virtual machine that’s based on Ubuntu Hoary featuring Firefox, so if you’ve been waiting for an excuse to checkout our virtualisation technology, grab the player and the VM and try it out. There are also a number of other VMs hosted at VMTN, and that collection should grow with time. If anyone has, or wants to, put together a VM and have it show up on VMTN, give me a yell. Obviously, you do need Workstation or one of our server products to create VMs.

On a personal note, the Linux player has been my primary project for the last few months, so this one is near and dear to my heart. πŸ™‚ It’s been a lot of fun to work on and I hope you all take a chance to check it out; there are a lot of obvious comparisons with Acrobat Reader, but I hope that the player won’t provoke the sort of reviews that the latest version of Acrobat Reader did πŸ™‚

For people paying attention to libview, the player is also a little bit of a showcase as it uses the Drawer, Tooltip and Spinner widgets.

Although the language hasn’t been finalised yet, do expect to see sane redistribution terms show up by the final release; this is actually a beta, even though the website seems to neglect to say so, which was a bit surprising.

Enjoy!

Edit: I’m getting a flood of comment spam on this post, so I’m disallowing comments to it. (2/2/06)

Heads up about librsvg 2.12.x

Well, if I haven’t had enough fun trying to keep us backward compatible to the stone-age, I now get to worry about forward compatibility too! We got a bug report from a Workstation 5.5 beta user that the snapshot manager crashed when he tried to open it, and he was using Ubuntu Breezy.

I happened to encounter the same problem at home where I’m running Slackware 10.2 and Freerock GNOME 2.12, so was able to debug it and find out that librsvg 2.12.x was the culprit. I was travelling last week so I couldn’t check the source properly until today, but it’s a tiny little problem with rather unfortunate consequences if you use a Gaussian Blur element.

I’ve filed a bug and attached a patch, so you can see the specifics there. I won’t make any smart alec remarks about test suites, but I have attached an example svg to the bug which can hopefully be of benefit in the future.

Hopefully, there won’t be any distro releases between now and the next librsvg release with the fix; we don’t want to save this one for posterity. I currently don’t intend to implement any sort of workaround in our artwork (removing the gaussian blur) because I don’t want to set a precedent for accounting for every minor release of every library, and because I expect to see patches for distros in the unlucky event that a release goes out with this bug.

England win the Ashes!

I was about 10 years old the last time we won the Ashes and hadn’t started paying attention to cricket at that point so, for many years, if you’d asked me when was the last time we’d won, I’d probably have replied that it was in the 19th century πŸ™‚ But we turned it around this time, and in convincing style. Of course, being on the wrong side of the pond, coverage is a little limited to say the least, so I was stuck listening to a rather overwhelmed Five-Live BBC feed this morning (Buffering…) as Pietersen keep hitting them for six; I just wish I could have seen it. If I had a flag, it would be up in the office right now, but there aren’t many Aussies around here to appreciate it anyway. πŸ™‚

England!

That’s quite a view you’ve got there

As a happy coincidence, on the same day that GNOME 2.12 is being released, we’ve managed to get everything sorted out over here to push out the initial release of VIEW, VMware’s Incredibly Exciting Widgets; so named by Christian without a hint of irony. Honest. πŸ™‚

VIEW is a collection of widgets that we developed while working on Workstation 5 that we felt were general purpose enough to have value to the community. Our intention is for the VIEW sourceforge project to be the one place where these widgets are developed and maintained; so we’re not going to have a parallel internal tree which we push updates out from. We’re also planning to move a number of other widgets into the library in due course. Most of them are written in C++ on top of gtkmm but a couple of them are in C. I know that this is probably going to limit initial interest because the overwhelming majority of GTK+ applications are not written in C++, but if nothing else, someone may like some of them enough to rewrite them in C for wider consumption, or maybe Inkscape will want to use one. πŸ™‚

Doxygen docs are available in the tarball and can be regenerated out of the sourcetree, but we currently don’t have a nice summary of the widgets in the library anywhere else (the web page is on the way), so it’ll be useful to put a quick one together here:

C++ Widgets and Objects

  • view::ActionGroup: A very simple wrapper around gtk::ActionGroup that allows the group to carry it’s merge position around with it.
  • view::BaseBGBox: A somewhat inaccurately named widget for historical reasons. This is a container that paints itself using its current state’s base colour. We use this to provide the background for the summary pages in Workstation. The BG is in the name because it used to always use the BG state’s colour. This implements the painting technique I described before to work around the way some themes treat event boxes.
  • view::Header: A creative use of menuitems as a header for the sections of Workstation’s summary pages and About dialog. We originally hard-coded a silver/grey gradient for this but that’s obviously not very theme friendly, so this was the alternative I came up with, and it works surprisingly well. A small workaround is required to get the text right with a couple of themes, otherwise a separate widget wouldn’t really have been justified.
  • view::MenuToggleAction: An action that provides a toggle action with a secondary menu. So, on a toolbar you get a toggle button with a context menu and in a menu, you get an item with a submenu with the actual toggle item as the first entry. It’s a little suboptimal as one would prefer to use a MenuToolButton in the toolbar but we can’t depend on GTK+ 2.6 yet.
  • view::MotionTracker: Now this one’s pretty neat. It’s a specialised signal object that fires whenever a target widget moves. I was really surprised to find that GTK/GDK didn’t provide this information already – and in fact, GDK actually filters out the necessary X events early on, so we have to listen at a very low level to make this work.
  • view::Reparenter: A helper object to aid in achieving flicker-free reparenting of children. Unfortuntately, the code you see here only works correctly with GTK+ 2.4. The reparenting mechanism changed in 2.6 and an additional workaround is needed, but this requires intimate knowledge of the widget being reparented because the map operation has to be blocked at a particular point. We plan to have the additional steps documented.
  • view::Spinner:A subclass of Gtk::Image that holds a set of frames and knows how to advance through them. The mechanism of obtaining the frames and timing the animation is left to the user of the widget.
  • view::SpinnerAction:An Action that provides a spinner using the Spinner widget. It can drive multiple spinner proxies and handles the tedious task of chopping up a multi-frame-single-image style spinner like the default gnome-spinner. Again, the precise animation timing is left up to the consumer or subclass.
  • view::ToolTip: An actual tooltip widget! I’m sure most people are aware of what you can and can’t do with GtkTooltips, and one of the things you can’t do is programmtically make a tooltip appear when you want it, so I wrote this widget to fill that gap. As a bonus, it uses the MotionTracker so that it maintains its relative position to its ‘parent’ widget while its on the screen. The timeout is currently hardcoded but I intend to fix that.
  • view::UIGroup: One thing that I always felt was missing from GtkUIManager and friends was an easy way to programmatically modify the UI definition, so I wrote this object to be broadly analogous to the ActionGroup, in that it encapsulates a UI definition fragment that can be merged and unmerged in the same way that ActionGroups can be inserted and removed. This allows us to use a pattern where an object, such as a virtual machine, provides its own UI definition and actions. This is particularly useful for dynamic menus, such as the list of virtual devices in a VM.
  • view::Viewport: A subclass of Gtk::Viewport that works around an oddity (bug?) in how GtkViewport handles a size_request.
  • view::VisibilityBox: Ever been annoyed at how you find that even though you have a visible container, like a GtkFrame, with no visible children, the container still has a non-zero size_request? Well, RΓ©gis was, so he wrote this to fix the problem. It’s a container that hides itself if it has no visible non-layout-providing children. So you stick your GtkFrame inside it and if the frame’s children happen to be hidden, the VisibilityBox will make sure that the Frame is hidden too.
  • view::WeakPtr: A weak pointer template class. I’d really like to see this go into gtkmm. Hopefully Murray is interested πŸ™‚
  • view::WidthHeight: A very low level widget that is essentially a generalisation of the AspectFrame. It is configured so that one dimension is normally allocated causing a signal to be emitted. The callback then calculates what the other dimension should be and then sets it. If you think this is rather obscure, you’re right πŸ™‚
  • view::WrapLabel: A label widget that intelligently wraps onto new lines if it runs out of horizontal space, courtesy of Christian.

C Widgets

  • ViewOvBox: A container with two children that can overlap. The foundation of the ViewDrawer widget.
  • ViewDrawer: A subclass of ViewOvBox that can smoothly slide the one child over the other. We use this to implement the auto-hide toolbar in Workstation; it looks really nice and might be useful for the gnome-panel in auto-hide mode.

And where would we be without a screenshot? Here’s one of the new VM summary page (now theme compliant!) using the BaseBGBox and Header widgets. (And the theme is XFCE-Stellar):

Workstation screenshot

GtkEventBox abuse…

Good news! I’ve now got a satisfactory alternative for controlling the background colour that makes gtk-qt-engine happy, along with a couple of other pathological themes.

The method we were previously using to set the background colour was to stick the widget(s) inside a GtkEventBox and then call modify_bg() on it to set the background colour. This seems to be an inocuous enough thing to do and controlling the background colour is one of the officially stated uses of the event box, but maybe I wasn’t supposed to do it that way; comments are welcome.

Unfortunately, this method was the one that gtk-qt-engine was refusing the cooperate with. In addition, themes like Crux and Smokey-Blue both have rules that override the appearance of event boxes to look like their parent widgets – in essence to make them transparent. Now that is surely a pathological behaviour. The vast majority of themes have no problems.

So, on to the final solution. I dug around inside the gtk-qt-engine source to try and find out what it was doing wrong, and while I couldn’t nail that one down, I did see how it was rendering certain elements without using QT directly. This implied that colour selection could not be completely broken. So working from yesterday’s proposal to paint the box as if it was a treeview cell, I ended up just using gdk_draw_rectangle to colour in the background; For whatever reason, gtk-qt-engine sets the gc’s correctly even if it doesn’t set the colour values right. At the same time, I changed our widget to stop inheriting from GtkEventBox and used GtkHBox instead as the simplest non-abstract container. Changing the inheritence hierarchy allowed Crux and Smokey-Blue to work because our widget would no longer get matched as an EventBox.

The story has a happy ending, but it’s unfortunate that valid techniques are rendered unusable because of theme-specific pathologies.

Which of these things look like all the others…

Well, gnome-settings-daemon has been tamed thanks to sound advice from Jonathan and Ed. It’s unfortunate that GtkSettings isn’t documented in any meaningful way, because it turns out it wasn’t a hard problem.

But, I wasn’t able to enjoy my success for long, because I now had to confront the other major obstacle in the way of thematic bliss: gtk-qt-engine. This notionally friendly little library is a GTK+ theme that uses QT for drawing, with the result that GTK+ apps look pretty much like QT ones. SuSE and, I think, Mandrake use it as part of their KDE desktops. However, there are a couple of problems that mar this seemingly sensible picture.

  • Firstly, SuSE uses a very unfriendly mechanism to include the theme: Rather than modifying ~/.gtkrc-2.0 and specifying the theme by name, they actually append the theme’s gtkrc to GTK2_RC_FILES in the user’s environment. This means that the theme’s rules are applied but not as a theme. As a result, it is not possible to ignore or override the theme! If we recall why gnome-settings-daemon was a problem (running on pre GTK+ 2.4 systems) we can quickly conclude that we’ve got a problem here too. Workstation 5.0 doesn’t address this because we wanted to helpful and not ignore the user’s GTK2_RC_FILES if at all possible, but I think that’s misplaced helpfulness, and it’s really going to be kinder to reset GTK2_RC_FILES to a sane value when we’re using our shipped GTK+ libs.
  • The second problem is a fundamental flaw in gtk-qt-engine itself: If you’re running a recent enough SuSE (or Mandrake?) distro, then your GTK+ is new enough, and we can actually use the gtk-qt-engine and everything looks great – except that the virtual device icons which are supposed to flash when the device is active don’t flash… Now, why don’t they flash? The code in question switches between the NORMAL and SELECTED bg colours to create this flash (It’s probably more correct to use the base SELECTED colour, but that’s a separate issue). This seems at first glance to be a reasonable mechanism because it’s a pretty pathological theme that doesn’t distinguish NORMAL and SELECTED. Well, guess what’s a pathological theme?

    It seems that either as a side-effect or an un-noticed bug, gtk-qt-engine sets all the gtk symbolic colours to the same value and relies on the fact that QT is drawing (almost) everything to produce something that looks correct. So, simply switching colours is never going to product the desired result. What’s a guy to do?

    One option is to calculate the activity colour on the fly, probably by inverting the NORMAL colour. That, at least, will provide some sort of feedback. However, what I’m currently inclined to go with is to override the expose handler and tell the EventBox to paint itself like the selected cell of a treeview. This should amount to the same thing as the old code in most cases and actually produces results with gtk-qt-engine. Now, that seems like a pretty crazy workaround to me, and it really shouldn’t be necessary, but when a pathological theme ends up as the default for major distributions, you don’t have a lot of choice.

And not all 32s are equal…

Yep, still got time to kill, so I’ll tell a story. This is the story of what it takes to ship a gtk+ 2.4 based application that will run on RedHat Linux 7.2 out of the box.

If you think that’s a frightfully masochistic thing to want to do, you’d be right, but the old gtk+ 1.2 UI was looking pretty ratty and unimpressive when we released 4.5, so there was no question that 5.0 would be 2.x based.

Now, deciding that you’re going to require a newer version of gtk 2.x than is present on the system without requiring the system to be upgraded is a chore in and of itself, as you have to override a bunch of obscure envrionment variables, otherwise your private gtk libs will be busy trying to use the system’s old theme engines and pixbuf loaders to no good effect. But when you decide that you want to run on a pre-gtk2 distro like rh72, you’ve suddenly got a lot of dependencies you can’t rely on anymore.

It seems an awfully long time ago but back in those days, there was no fontconfig, Xrender or Xft; it was good old X server-side fonts and you felt grateful if you could use a truetype font at all πŸ™‚

I’m sure you can see the implications of this difference: we realised we’d have to ship all of those libraries along with the program, if gtk2 was going to work at all. And so began a labourious process of building all of our dependencies in a specially crafted virtual machine (of course) where things like glibc were the right version to ensure that the end result would work on rh72 and newer distros. And amazingly, it actually works. Nevertheless, I miss being able to just state what the requirements are and let the user worry about satisfying them. πŸ™‚

Ironically, the biggest inconvenience didn’t come from the pre-gtk2 distros but from the gtk2 < 2.4 distros. The problem is theme engine versioning: Our shipped copy of gtk 2.4 cannot use the 2.0 and 2.2 theme engines, so when the user specifies a theme that relies on one of these engines... We attempted to mitigate the problem by providing our own gtkrc that always requests the default theme. But, this one wasn't going to have a happy ending because of that wonderful tool: gnome-settings-daemon. gnome-settings-daemon has the characteristic of forcing a theme on all gtk apps and as far as we can tell, there's no way for an app to override it and use another theme. The sad result, is that if your gnome destkop is using a theme with a theme engine, Workstation won't be able to load that theme engine and things can get pretty ugly. Things are, of course, better with newer distros where we can use the system gtk libraries and themes, but it's going to be a long time before the minimum requirements for Workstation are a gtk 2.4 based distro! So, the moral of the story is that you can actually ship a private gtk environment that depends on nothing more than glibc and X but you may legitimately wonder what the hell you're getting yourself into if you try.