Computer Communication & Consulting

Xubuntu with Fluxbox on a Sony C1MGP

last change 2008-07-27

Linux on a Sony PCG-C1MGP using a 32 GB SSD

... a very mobile and robust Solution

Improving the boot time
The Fluxbox Desktop

German version of a similar page - click on flag or here.

sony-c1mgp.jpg The Sony C1MGP runs better with Xubuntu than with the original Windows-XP. I guess this is more due to Sonys poor implemantation than the Windows itself.
Just booting from the Xubuntu 8.04 live CD gives a good impresson of what is working and how it is. Only the performance from live CD is very poor.

Even if the Sony C1MGP ist older, it is a very nice companion on the road. Its 3.600 mAh Batterie lasts for about 5 hours contiguous work and the LCD resolution of 1280x600 ist much better then most of the very modern Netbook competitors.
The C1MGP is not very usefull for multimedia applications but to watch a movie from usb disk or from DVD (needs external drive) it is still good enough.

As you can see on the German version of this page, the first Linux setup on the C1MGP was done with a Xubuntu 6.06. Even that worked "out of the box" so the newer setup with Xubuntu 8.04 is somehow smoother.

Since the time from power on to work with Xubuntu takes more then 4 minutes ... and I found this unacceptable ... I tried a lot of different setups and other distributions. But finally I ended up with Xubuntu again but with a Fluxbox desktop. This is because of: Xubuntu gives me the best hardware detection and most of the stuff like, X with resolution of 1280x600, FireWire CD-ROM, Bluetooth, function keys runs without modificaton. Only the Motion Eye Cam is not supported and I could not handle up to now to make hibernate/suspend working.

The C1MGP comes without WiFi. Therefore a PCMCIA card is used for it. I tried differend models and all of them are working "out of the box", i.e. Xubuntu detects the hardware correctly and loads the right moduls.

The only necessary modification was in network-admin to disable roaming mode and select DHCP autoconfig.

If using Fluxbox, why don't choose Fluxbuntu?
Fluxbuntu boots faster than Xubuntu and envokes much less processes. That's true!
But Xubuntu detects the hardware much better and gets a better support from Ubuntu community, i.e. more applications are avaliable in stable release.

Also to use Xubuntu with Fluxbox on top allows to select between Fluxbox and XFCE at login screen. Fluxbox is my default. But if I don't care login time I may choose XFCE for some "housekeeping" operations. Also I modified my Fluxbox menu to use xfce-terminal and thunar in Fluxbox.

Improving the boot time

One of the important features of a mobile system is the time from pressing the power switch until you can really start to work. As written above with a standard Xubuntu installation the C1MGP needs more the four minutes to do so. About 2:20 Minutes to the Login screen and an other 2 Minutes for initialising the XFCE. But there are a lot of items where this times can be improved.

Frankly speaking, most of the improvement can be done by using Fluxbox instead of XFCE. Because Fluxbox initializes within 20 seconds compared to approximately 2 minutes of XFCE. Also calling applications is much faster with Fluxbox. On the other hand XFCE is easier to work with.
Not really, but the XFCE configuration is easier. For the configuration of Fluxbox I strongly recommend not to use grafical tools for it. Use a standard editor like Mousepad to edit the files and keep backups of the old config files to have a way back. Just in case ...


First boot improvement is the modification of the grub default items.
For this edit /boot/grub/menu.lst file and locate the line starting with # defoptions. I changed it to:

# defoptions=vga=0x314 quiet nosplash
and also change the line which calls the kernel during boot:
title           Ubuntu 8.04.1, kernel 2.6.24-19-generic
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.24-19-generic root=UUID=3...f ro vga=0x314 quiet nosplash
initrd          /boot/initrd.img-2.6.24-19-generic
To make this working you need to reboot.

Hard Disk relevant stuff

Since I use the C1MGP mainly for writing and reporting, for example using it with ZMzettelkasten, I do not need much disk space in the C1MGP. So I spend the system a 32 GB SDD (Solid State Disk) to make it more reliable and robust on the road.

The Solid State Disk ist devided into 3 native partitons:

Partition Size File System Mount Point
/dev/hda16 GBext2/
/dev/hda2800 MBswap
/dev/hda325 GBext2/home

Using a SDD I think it is worse writing too much to it. Even writing to a SDD is pretty slow. So I did not use ext3-Filesystem. There is a mount option noatime which avoids writing the last access timestamp each time a file is read. I thought is would be a good practice to use the noatime-option (in /etc/fstab) during mounting the two partions.

Also /etc/hdparm.conf needed some modifications. It contains at the very end the lines

command_line {
    hdparm -q -W1 -q -d1 /dev/hda
to enable write cache and DMA. 32 Bit Mode and Read Ahead is not supported on my Transcend Solid State Disk TS32GSSD25.

Limit the usage of swap space

Edit /etc/sysctl.conf and add the line

at the end to avoid swapping during normal operations.

Don't start unnecessary processes

sysv-rc-ctrl.png Xubuntu starts by default a lot of daemons and processes. For a portable system a lot of them are just waste of power and memory. I use the sysv-rc-conf (needs to be installed separately) to clean the "runlevel 2" startup of the system.

The screenshot just shows the first of four pages. The Ubuntu system boot by default into runlevel 2. So taking off the "X"s in the column 2 disable the services for this runlevel. I disabled a lot of services. It depends on your needs which service should be enabled or not. You may test your setup by entering init 3 and init 2 from comand line. This switches to runlevel 3 and after then back to runlevel 2. So the deselected services should be stoped now.

You should also stop the extra Text Consoles (which ar reachable by [alt][cntl][F3] to [F6]. I left the two on F1 and F2 for service purposes.
The consoles will be turned off in /etc/event.d/ttyX where X stands for the console number. Just enter lines like

stop on runlevel 2
a line per each runlevel.

All the above makes my C1MGP booting in 1:30 minutes to the login screen. Plus about 20 seconds for Fluxbox to initialize the desktop after.

Top of page

The Fluxbox Desktop

fluxbox.png The Fluxbox desktop is fast. And it is easy to config if you know howto.
It is also pretty good documented, see Fluxbox Documentation.
An nice Option is you can switch by [Alt][F1] ... [Alt][F4] to the appropriate desktop. This is much faster as using a mouse click for this.

Unlike Gnome, KDE or XFCE it is best to config Fluxbox with an editor directly in its config files. Fluxbox has also some config utilities but I had a few problems with them.
Changes in the config files are not automatically taken in use. You may have to restart Fluxbox to enable the changes.

The config files are in ~/.fluxbox. I use the alternate fbpanel which I find nicer. It has its config file in ~/.fbpanel.

The first file to look at is .fluxbox/startup. More or less at the end of this file you can add or enable the application you want to start automatically with fluxbox.

# idesk &
/usr/bin/conky &
/usr/bin/fbpanel &
/usr/bin/wmbattery &
Don't forget to put a »&« at the end of each line not to hang in one of this programs.
Also you should have a line
xmodmap "/home/user/.Xmodmap"
somewhere in this startup file.

The .Xmodmap file is used to define your own keycodes.

keycode 111 = F13
keycode 115 = Menu
This define the "Print" key as function key 13 and the Windos menu key as "menu" key.

Adding the lines

None F13 :ExecCommand /usr/bin/screenshot
None Menu :RootMenu
into .fluxbox/keys will set the appropriate actions to the keys.

Using the xev command you may find out the scan codes of other keys.

The menu is envoked by right mouse click to the desktop and can be modified in .fluxbox/menu file. Since this file may become big and confusing, I split it up. I use a .fluxbox/menu-games and .fluxbox/menu-system to separate this submenues.
At the place where this menus should be show up in menu, I included them with

[include] (home/user/.fluxbox/menu-games)
[include] (home/user/.fluxbox/menu-system)
I beleave the syntax of the .fluxbox/menu file is easy to understand

[exec] (ZMzettelkasten) {/usr/local/bin/ZMzettelkasten} </usr/local/share/pixmaps/ZMzettelkasten/zm_zettel.png>

means execution of the program in {} braces when menu entry in () parenthesis is clicked. The file between <> is used as a small image in the menu.

Top of page

Home Page
Copyright © 2001-2010 Bernd Holzhauer. All Rights reserved.
Possibly used Trademarks are Properties of their owners.