Tuesday, October 26, 2010

Building XFCE4 desktop with SUSE Studio

We recently added automagic recognition and start-up of several more window managers such as windowmaker and fvwm2 into Studio, but XFCE4 is still missing from the list. One reason for this is that it simply doesn't work out of the box without a few tweaks. This is easy to do in Studio and in this post I'll explain step-by-step how to build an openSUSE 11.3 appliance with XFCE4. If you are already familiar with building appliances in Studio, just skip to the summary section at the end for the list of steps.

So first, let's start with a minimal X appliance:

and choose 64bit.

In the software tab, search for 'in:patterns xfce' and select xfce pattern. This will pull in most of the dependencies, but we'll need some more packages for xfce4 to work. So in addition to that, add also the following packages:

  • xfce4-settings
  • xfce4-desktop
  • xfwm4
  • thunar

The package selection then looks like this (click on 'packages selected' in the sidebar and hit enter):

Now let's build! We'll use the USB stick format so we can take advantage of the modified files feature.

After few minutes, the build is done, so let's launch it in Testdrive...

...and log in.

Uh oh, this doesn't look like XFCE! It's ICEWM, the window manager Studio uses as a fallback. The default window manager started on system boot is located in /etc/sysconfig/windowmanager. So let's open xterm, make yourself root with su - (default password is linux), and open the window manager file in your favorite editor:

Edit the DEFAULT_WM option to say startxfce4.

Write your changes and run sync to actually write them to the filesystem. And now comes one of the cool parts in Studio - whenever you change a file in Testdrive, Studio automatically detects these changes and displays a list of modified files which you can then easily re-integrate back into your appliance. Click the 'Modified files' tab (near the Testdrive on top of the page). Add /etc/sysconfig into included paths. You should now see the windowmanager. Mark it for addition and click 'Upload selected files into appliance' button. And that's it!

You can check it's been included in the appliance in the Files tab:

Now rebuild your appliance, re-start testdrive and log in. Well now, if you speak squareese, thats great, but for ordinary people, this is kinda not so good:

This is a known pango bug (which we hope they will fix soon) and can be remedied easily. We'll just need to regenerate pango's module list and we're going to fix this using Studio again. Let's open the Configuration tab and click on scripts:

Studio enables users to run bash scripts after build finishes, or optionally on every boot of the appliance. Since this one-time fix, we'll go for the former option and add pango-querymodules-64 > /etc/pango/pango64.modules to the build script. If you started with a 32-bit appliance, add pango-querymodules > /etc/pango/pango.modules instead.

We'll rebuild again and this time, voila, you should now have a working XFCE4! It wasn't that easy, but with Studio's help, you don't need to do all this tweaking on your local machine.

Summary:

  1. Start with minimal X openSUSE 11.3 appliance.
  2. Search for 'in:patterns xfce' and add xfce pattern.
  3. Quick-add xfce4-settings, xfce4-desktop, xfwm4, thunar.
  4. Enable build script and add pango-querymodules-64 > /etc/pango64.modules to the end of the script, or pango-querymodules > /etc/pango/pango.modules for 32-bit appliances.
  5. Build and Testdrive.
  6. Edit /etc/sysconfig/windowmanager to set DEFAULT_WM to startxfce4. Optionally, you can add following line to your build script to obtain similar effect, without need to rebuild, so you can skip step 7: sed -i s/DEFAULT_WM=\"icewm\"/DEFAULT_WM=\"startxfce4\"/ /etc/sysconfig/windowmanager
  7. Upload modified file to appliance and rebuild.

This appliance is now shared on Gallery. In the next version, I'd like to setup Studio to include some more repositories and replace XDM in this appliance with Slim. Stay tuned! :)

9 comments:

  1. put this to the build script then you can skip the upload step

    sed -i s/DEFAULT_WM\="ıcewm\"/DEFAULT_WM\="startxfce4\"/g /etc/sysconfig/windowmanager

    ReplyDelete
  2. Why no cruise control

    also more built-in templates (to correspond to the desktops installable in YaST Live Installer) plz

    ReplyDelete
  3. Re: "put this to the build script then you can skip the upload step"

    Nice idea, blog post updated. Thanks!

    ReplyDelete
  4. If I was training that the XFCE appliances appear, voila. First IceWM, then XFCE 4. That is before XFCE, ICEWM, the window manager that Studio uses as a fallback, if you go back to Suse Studio.

    ReplyDelete
  5. Interestingly: The steps to make XFCE the default no longer work with openSUSE 11.4 as the base in Studio. Works great in 11.3, but not 11.4 with XFCE 4.8.

    Even the existing appliances for this no longer have XFCE as default when cloned and upgraded to 11.4.

    ReplyDelete
  6. Please make xfce-4 desktop pattern for open suse 12.1

    ReplyDelete
  7. Have you finished a tutorial to replace XDM for Slim or another one?

    ReplyDelete
  8. now it should be changed to
    sed -i s/DEFAULT_WM\="ıcewm-session\"/DEFAULT_WM\="startxfce4\"/g /etc/sysconfig/windowmanager
    I think

    ReplyDelete

 
© 2013 SUSE