Tag Archives: RHEL

Setup a 3 Node Lustre Filesystem


Lustre is a filesystem often used by clusters because many computers can mount the filesystem simultaneously.

This is a small log/instruction for how to setup Lustre in 3 virtualized machines (one metadata server, one object storage server and one client).

Basic components:

VMWare Workstation
3 x CentOS 6.3 VMs.
Latest Lustre from Whamcloud

To use Lustre your kernel needs to support it. There’s a special one for server and one for the client. Some packages are needed on both.

Besides lustre you’ll need an updated version of e2fsprogs as well (because the version that comes from RHEL6.3 does not support large partitions).

Starting with the MDS. When the basic OS setup is done will make a copy of that to use for OSS and Client.

Setup basic services.

Install an MDS

This will run the MDT – the metadata target.

2GB RAM, 10GB disk, bridged networking, 500GB for /boot, rest for / (watch out, it may create a really large swap). Minimal install. Setup OS networking (static ip for servers, start on boot, open port 988 in firewall, possibly some for outgoing if you decide to restrain that too), run yum update and setup ntp. Download latest lustre and e2fsprogs to /root/lustre-client, lustre-server and e2fsprogs appropriately (x86_64). Lustre also does not support selinux, so disable that (works fine with it in enforcing until time to create mds/mdt, also fine with permissive until it’s time to mount).
Put all hostnames into /etc/hosts.
Poweroff and make two full clones.
Set hostname.

Install an OSS

This will contain the OST (object storage target). This is where the data will be stored.

Networking may not work (maybe device name changed to eth1 or eth2).
You may want to change this afterwards to get the interface back to be called (eth0). A blog post about doing that.

Install a client

This will access and use the filesystem.

Clone of the OSS before installing any lustre services or kernels.

Install Lustre

Before you do this it may be wise to take a snapshot of each server. In case you screw the VM up you can then go back :)

Starting with the MDS.

Installing e2fsprogs, kernel and lustre-modules.

Skipping debuginfo and devel packages, installing all the rest.

yum localinstall \ 
kernel-2.6.32-220.4.2.el6_lustre.x86_64.rpm kernel-firmware-2.6.32-220.4.2.el6_lustre.x86_64.rpm \
kernel-headers-2.6.32-220.4.2.el6_lustre.x86_64.rpm \
lustre-2.2.0-2.6.32_220.4.2.el6_lustre.x86_64.x86_64.rpm \ 
lustre-ldiskfs-3.3.0-2.6.32_220.4.2.el6_lustre.x86_64.x86_64.rpm \

The above was not the order they were installed. Yum changed the order so that for example kernel-headers was last.

yum localinstall e2fsprogs-1.42.3.wc3-7.el6.x86_64.rpm \
e2fsprogs-debuginfo-1.42.3.wc3-7.el6.x86_64.rpm \
e2fsprogs-devel-1.42.3.wc3-7.el6.x86_64.rpm \
e2fsprogs-libs-1.42.3.wc3-7.el6.x86_64.rpm \
e2fsprogs-static-1.42.3.wc3-7.el6.x86_64.rpm \
libcom_err-1.42.3.wc3-7.el6.x86_64.rpm \
libcom_err-devel-1.42.3.wc3-7.el6.x86_64.rpm \
libss-1.42.3.wc3-7.el6.x86_64.rpm \

After boot, confirm that you have lustre kernel installed by typing:

uname -av


mkfs.lustre --help

to see if you have that and

rpm -qa 'e2fs*'

to see if that was installed properly too.

By the way, you probably want to run this to exclude automatic yum kernel updates:

echo "exclude=kernel*" >> /etc/yum.conf

After install and reboot into new kernel it’s time to modprobe lustre, start creating MDT, OST and then mount things!
But hold on to your horses, first we ned to install the client :)


And then the Client

Install the e2fsprogs*

We cannot just install the lustre-client packages, because we run a different kernel than the ones that whamcloud have compiled the lustre-client against.

We can either back-pedal and install an older kernel. Or we can build (from source / SRPMS) a lustre-client that works on a kernel of our choosing. The later option seems like a better way, because we can then upgrade the kernel if we want to.


Build custom linux-client rpms

Because of a bug it appears that some ext4 source packages are needed – while they are not. You need to add some parameters to ./configure. This will be the topic of a future post.

The above rpmbuild should create rpms for the running kernel. If you want to create rpms for a non-running kernel you are supposed to be able to run.

Configure Lustre

Whamcloud have good instructions. Don’t be afraid to check out their wiki or use google.

/var/log/messages is the place to look for more detailed errors.

On the MDS

Because we do not have infiniband you want to change the parameters slightly for lnet to include tcp(eth0). These changes are not reflected until reboot (quite possibly something else) – but just editing a file under /etc/modprobe.d/ called for example lustre.conf is not enough.

Added a 5GB disk to the mds.

fdisk -cu /dev/sdb; n, p, 1, (first-last)

modprobe lustre lnet

mkfs.lustre –mdt –mgs


On the OSS

Also add the parameters into modprobe.

mkfs.lustre –ost


On the client

Add things into modprobe.


Write something.

Then hit: lfs df -h

To see usage!


Get it all working on boot

You want to start the MDS, then the OSS and last the client.
But while it’s running you can restart any node and eventually it will start working again.

Fstab on the client:
ip@tcp:/fsname /mnt lustre defaults,_netdev 0 0

Fstab on the OSS and MDS:
/dev/sdb1 /mnt/MDS lustre defaults,_netdev 0 0

While it’s running you can restart any node and eventually it will start working again.

Update / Install Spotify on RHEL6 x64

Previous post:


Installed spotify-client- – this is converted from the .deb package that is downloaded from: http://repository.spotify.com/pool/non-free/s/spotify/

you convert with ‘alien’ and this command:

alien --to-rpm spotify-client_0.8.2.637.g252b980.486-1_amd64.deb

To install you need to uninstall first:

rpm -ev spotify-client
rpm -ivh Downloads/Spotify/spotify-client-
error: Failed dependencies:
libcef.so()(64bit) is needed by spotify-client-
libcrypto.so.0.9.8()(64bit) is needed by spotify-client-
libcrypto.so.0.9.8(OPENSSL_0.9.8)(64bit) is needed by spotify-client-
libssl.so.0.9.8()(64bit) is needed by spotify-client-
libssl.so.0.9.8(OPENSSL_0.9.8)(64bit) is needed by spotify-client-

OK, that didn’t work so well.


# rpm -ivh --nodeps Downloads/Spotify/spotify-client-
Preparing...                ########################################### [100%]
   1:spotify-client         ########################################### [100%]

You’ll get errors while trying to start spotify:

spotify: error while loading shared libraries: libnss3.so.1d: cannot open shared object file: No such file

What you need to do is create symlinks:

ln -s /usr/lib64/libnss3.so /usr/lib64/libnss3.so.1d
ln -s /usr/lib64/libnssutil3.so /usr/lib64/libnssutil3.so.1d
ln -s /usr/lib64/libsmime3.so /usr/lib64/libsmime3.so.1d
yum -y install nspr nspr-devel
ln -s /usr/lib64/libplc4.so /usr/lib64/libplc4.so.0d
ln -s /usr/lib64/libnspr4.so /usr/lib64/libnspr4.so.0d

However, it still crashes when I try to right-click on an app – but now it has apps :)

password when starting a linux server in single-user mode


On RHEL 6.2-based systems (like Scientific Linux 6.2):
edit /etc/sysconfig/init

# Set to ‘/sbin/sulogin’ to prompt for password on single-user mode
# Set to ‘/sbin/sushell’ otherwise

Like this:


Then if you add an ‘s’ to the grub entry when the server boots it will ask you for a password , or hit ctrl-d. Ctrl-d makes the server enter normal boot (telinit *).

Should all linux machines be installed this way? To me this sounds like a definite deal, especially if you have the console physically or remotely accessible.

CentOS 5.8 Released

CentOS 5.8 was released today 8th of March.


You can download it from many mirrors, for example from FUNET: http://ftp.funet.fi/pub/Linux/INSTALL/Centos/

It installs just fine on an HP DL360 G7 with P410 and P411 controller.

CentOS has as far as I understand been slower at releasing updates than Scientific Linux (for example 6.2 was out 5 days earlier on SLC than on CentOS), this was not the case today though, SLC 5.8 is not available yet. Why?

Compare release dates here:



How to find things in Linux man pages

There’s a couple of places (naturally).

It’s easy to be fooled and think: “anybody can type man man”. But in all fairness, you need to figure out which man page to look into, or what command to run and sometimes it’s just a blank.

In RHEL there is /usr/share/doc where there are some special places, for example /usr/share/doc/initscripts*/sysconfig.txt for all config files that relate to the boot-up process.
There is also /usr/share/man. In /usr/share/man/man5 which has all the level 5 man pages in gzip format. For example “man 5 yum.conf” you can find in /usr/share/man/man5/yum.conf.5.gz.

To open a man page you just type ‘man yum’. To get the man page for yum, or ‘man man’ for the manual for man.

To search through man-pages you can use either of these (they are the same):

man -k yum
apropos yum

While inside a man-page you can search by typing:
and then what you want to search for
and then ENTER.
Like this: /priority
This will hilight all the matched entries, you move to the next match with ‘n’.
This might differ between operating systems, it depends on which viewer is used to present the man page.

Sometimes these don’t find what you are looking for.
In that case you could manually move into /usr/share/man/man5 and hit:

zgrep priority *

to grep through the gzip files looking for any entries that says ‘priority’.

or, if you want to you could use this to search through all directories:

find . -name "*"|xargs zgrep -i priority

or even better (if you’re not looking for a language specific man page):

find /usr/share/man* -name "*"|xargs zgrep -i gpgcheck

These are all relatively slow though, if you read this and have any suggestions please let me know :)

Scientific Linux 6 – Basic Setup

Not allowing root to log in

By default sshd is running on SL6 and you can ssh in with ‘root’.

Probably a good idea to change this in /etc/ssh/sshd_config

permitrootlogin no

But first, create a user that can log in.

useradd mart
passwd mart

Then you can change sshd_config and ‘service sshd reload’.

Then you can ssh in and either hit’ su -‘ to get root access.
Or, if you hit ‘visudo’ and add your user. You can later just type ‘sudo bash’ to get a root bash shell.


iptables -L to view the firewall setup, note that there is a ‘virbr0’ interface that has forwarding rules. This is probably for NAT or bridging for potential virtual machines, and was probably created when we chose ‘Virtual Host’ as the role for the system.
iptables-save : another view that may be easier to understand. This you can put in ‘file’ and then hit iptables-restore < file.

Slow before you get the login prompt while ssh-ing?

To see what is happening, ssh in with ‘ssh -v ip’.
In my case I saw

 debug1: An invalid name was supplied
Cannot determine real for numeric host address

A little googling showed me that this is because your machine doesn’t have a name lookup for that IP. So go ahead and add one in /etc/hosts and then it will be fast.

Notice that your ssh stops working after a while? Doesn’t accept input?

If so, add this to your ~/.ssh/config file:

Host *
   ServerAliveInterval 60

Make sure there is at least a space on the second line. I have three :p
You can change the * to a specific domain if you do not want to do this on all your boxes.
If the file doesn’t exist, create it.

Run sshd on a second port.

  1. Edit /etc/ssh/sshd_config
  2. Add a line saying: Port 6666
  3. look in /etc/hosts.allow (any entries? good)
  4. iptables-save > ~/fwrules
  5. vi fwrules
  6. copy the –dport 22 line and paste a new one above the -j REJECT lines (vi commands: yy and P)
  7. change the 22 to 6666 (vi commands: x for delete, R for replace mode. :wq! to save and quit)
  8. iptables-restore < ~/fwrules
  9. /etc/init.d/sshd restart

If you want you can hit: iptables -L or iptables-save.
These will also show the current iptables rules.
See ip6tables for IPv6 rules.

Now the port is running on another non-standard port (you could set it to whatever you want, as long as it’s lower then 65536 and preferably higher than 1024). This might be good for security reasons. You could still have port 22 open for access from your internal network (see adding a -s ip.add.r.ess on the row in the iptables rules) and the other one accessible from the internet or maybe even a specific network / address on the internet for even more security.

How-To : Update Spotify on RHEL6 x64 native client

See the post for how to install spotify on a Linux Client (RHEL 6 x64 in my case).

This post is for how to upgrade.

2012-02-01: Updated, added –nodeps to the rpm upgrade.
2013-01-08: This has been confirmed to work with spotify-0.8.8, updated typo in symlink part.

Why? http://repository.spotify.com/pool/non-free/s/spotify/spotify-client-qt_0.6.1.309.gb871a7d-1_amd64.deb is out!

Is available. Maybe right-click works?? =)

  1. Get the .deb into a place where you can run the program ‘alien’. I have ubuntu in a virtual machine so fired that up, downloaded the .deb
  2. sudo alien –to-rpm spotify-client-qt_0.6.1.309.gb871a7d-1_amd64.deb
  3. e-mailed spotify-client-qt- to myself
  4. save the .rpm, close spotify,  and hit:
  5. sudo rpm -Uvh spotify-client-qt-
  6. this failed, it needed

error: Failed dependencies:
libcrypto.so.0.9.8()(64bit) is needed by spotify-client-qt-
libcrypto.so.0.9.8(OPENSSL_0.9.8)(64bit) is needed by spotify-client-qt-
libssl.so.0.9.8()(64bit) is needed by spotify-client-qt-
libssl.so.0.9.8(OPENSSL_0.9.8)(64bit) is needed by spotify-client-qt-

A forum post with some more details about this.

whereis spotify ldd /usr/bin/spotify gives me: libssl.so.10 0> /usr/lib64/libssl.so.10 libcrypto.so.10 0> /usr/lib64/libcrypto.so.10


cd /usr/lib64 
sudo ln -s libcrypto.so.10 libcrypto.so.0.9.8
sudo ln -s libssl.so.10 libssl.so.0.9.8

If still no go, some advise to rename/delete ~/.config/spotify and ~/.cache/spotify

If neither of the above still works, run


rpm -Uvh --nodeps spotify-client-qt-

It’s now possible to right-click on playlists! Also to click on ‘File’ works! Woop!

Right-click on artist worked a few times. Then after a while it stopped working. AGREGHA!!#45

(still crashes with Spotify

I would guess that the problem lies with qt or webkit.

Sharing works though. It sucks a bit to not be able to add files to playlists. But clicking the star works so you can find the songs you don’t want to forget in there.
Scrobble/last.fm also works. Cannot select top list for another country.

Install Scientific Linux 6 in VMWare Workstation

Time for some more Linux testing.

The reason for this is because I think I will go ahead and try to study for the RHCSA – Red Hat Certified System Administrator. Work might send me to a course in December, probably wise to play around with it before this.

So here we go.

Scientific Linux (SL) is a free clone of Red Hat Enterprise Linux (RHEL). Historically it’s been updated faster than CentOS. It’s same as Enterprise Linux (EL) – it’s re-compiled from source.

New VM, \SL-61-x86_64-2011-07-27-Install-DVD.iso, RHEL6 64-bit. 1 Core, 2G RAM, NAT, LSI Logic, New virtual disk, SCSI, 20G. Then boot the VM.

SL.org has this in pictures.

First thing you see is the Grub menu:

  1. Install or Upgrade
  2. Install with basic video driver
  3. Rescue
  4. Boot from local drive
  5. Memtest (I like that memtest is pretty standard now)

Chose 1. Next screen is a graphical interface where you click and write, so you need keyboard/mouse. Next screen asks if you want local disks or external storage (fc, iSCSI, or zFCP – for system Z). Hostname: SL1.localdomain.

Create disks. Custom/full size. xfs/encryption/lvm cannot be used for boot volumes.

Role: Virtual Host (I want to try KVM). Enabling SL 6.1 and SL 6.1 Security Updates repositories.

Pinging to something on the Intertubes work from the start.

More posts coming with more fun stuff :)

How-To : Install Spotify on RHEL6 x64 native client


You need premium for RHEL6 native client to work.

If you get it to work with WINE it would work for free (as a plus you get it with the very annoying ads).

My machine is a RHEL 6 64-bit.

The only requirement I had was that I did not have libQtWebKit.so.4 installed.

This was fixed with:

sudo yum install qtwebkit-2.0-3.el6.x86_64.rpm

I found this package online.
It’s needed because the spotify-install wants libQtWebKit.so.4 – this may be available in some other package available from within the red hat repositories but I couldn’t find it. If you know how/where that would be great to know :)

I have qt 4.6.2-19 but adding the WebKit in this way hasn’t caused any issues (yet).

You’ll probably need other qt-stuff installed too (I did an ldd /usr/bin/spotify after install and what it wants you can find in this file: spotify ). There’s a lot of them in there but libQtGui.so.4 , libQtCore.so.4 , libQtWebKit.so.4 , libQtDBus.so.4 , libQtNetwork.so.4 , libQtXml.so.4 are the libQt* ones.

To find which qt packages you have installed in a Red Hat based system hit:
sudo yum list ‘*qt*’

Download the spotify-client, I used spotify-client-qt_0.5.2.84.g6d797eb-1_amd64.deb. You can get the latest one via http://repository.spotify.com/pool/non-free/s/spotify/

As spotify doesn’t release an rpm anymore – you need to convert the debian .deb to rpm like this:

sudo alien –to-rpm spotify-client-qt_0.5.2.84.g6d797eb-1_amd64.deb

Then install spotify like this:
sudo yum install spotify-client-qt-0.5.rpm

Run spotify (just hit spotify in the terminal) and log in!

Worked without changing any sound settings or anything like that!
The volume control inside spotify controls the master volume, so be ware  and don’t let it blow your ears out!

Happy musicing!


I also tried to install spotify on a shell with WINE and load spotify with X11-forwarding enabled on the shell. Spotify loads and lets me log in but right after login it crashes for some reason.

Reading encrypted/password protected pdf on Linux

Brocade Logo

The problematic PDF

The CFP300 material on http://community.brocade.com/docs/DOC-2041 is encrypted so that it cannot be printed/re-edited without a password.

If you try to open this with evince (default .pdf viewer in Gnome) it will ask for a password.
pdftotext (comes with the software suite poppler) says:

Error: Weird encryption info
Error: Incorrect password

It’s only the material starting with M0* that has this issue, this has also been seen with other documents. Maybe this is because they were created with a too new version of Adobe Acrobat that evince/pdftotext doesn’t support.
The rest of the material are going to be public and they are user/admin guides anyway. But the M0* files are from the actual course material for the 16G so this is why.

The solution on RHEL6 x64: install FoxitReader. Download the .rpm – then hit ‘rpm -Uvh FoxitReader-1.1-0.fc9.i386.rpm’ and it will be installed. To start it just hit ‘FoxitReader’.

Anyway I think it’s nice of Brocade to pre-release the course material for those doing the beta-test. If you want the real material the cheapest is 650$ and then you get the material, narration of the pdfs (usually good quality, not just reading off the presentations) and a few quite good lab exercises.

The Studying

Just threading along here with the material, slowly but steady.
I’m starting with the NPIV / Access Gateway stuff. It’s a bit more complicated than just a switch that isn’t its own domain, it’s also mapping the virtual WWN to the N_ports (a switch in AG mode has N_ports that connect to F_ports in another switch). Usually N_ports are on hosts’ and targets’ ports and the switches’ has the F_ports.

HP Virtual Room Installation on RHEL 6 x64


I couldn’t get it to work.

Eventually I installed Ubuntu 10.04 LTS in a VM in Virtualbox and in there it worked.

However, resolution is only 800×600. So I found this page: 



That told me to install some stuff and then install the Guest Addition stuff. After that and a reboot HP Vroom no longer worked. But resolution was fine! Grah. Then I just used the “Live CD” of Ubuntu instead, or the normal .iso but no need to install, just boot from it.


DWM – start up script that works with GDM login manager

*** 2011-04-18 Updated with my current dwm config files, see the jg_dwm_conf.tar.gz below.

My config: jg_dwm_conf.tar

Goal: Be able to exit DWM and get back to the GDM – gnome login manager.
To be able to hit MODKEY+SHIFT+Q, exit dwm and get me back to the login manager.
Where I can chose another user or window manager. Or if I make a change in dwm and need to re-load it, this would work as well.
Before I had to reboot :)

Finally got this working like I want it to – with some help from #suckless on irc.oftc.net.
This works for me with RHEL6, GDM –version 2.30.4 and DWM 5.8.2.
My problem was that before (you can see how that looked in this post) I ran the dwm also in a loop. But this is not necessary. If you want to keep the statusbar updated with some goodies by running a while loop, you only need to run the xsetroot in a while loop.


Looks like this:

[Desktop Entry] Encoding=UTF-8
Comment=This session starts dwm


Looks like this (updated on 2011-04-18):

#not applicable? I do not have this directory in my home dir.
# --- commands here and before the "while true; do" are run once
#xrdb -merge ~/.Xresources
#open screensaver (so that gnome-screensaver-command -l works)
/usr/bin/gnome-screensaver &
#open pwer manager
#exec gnome-power-manager

#black bg
#want this
#path to background
xsetroot -solid black

#while loop to update statusbar with some goodies
while true; do
battotal=`awk '/last full capacity/{print $4}' < /proc/acpi/battery/BAT0/info`;
batfree=`awk '/remaining capacity/{print $3}' < /proc/acpi/battery/BAT0/state`;
battper=$(( 100*$batfree/$battotal ));
battery=`awk '/charging state/{print $3}' < /proc/acpi/battery/BAT0/state`;
#memfreak to get it in MB
memfreak2=`grep MemFree /proc/meminfo | awk '{ print $2 }'`;
memfreak=$(( $memfreak2/1024 ));
CLK=$( date +'%a %b %d %R:%S %Z' )
VOL=$( amixer get Master | tail -1 | awk '{ print $5 }' | tr -d '[]' )
AVG=$( cat /proc/loadavg | cut -d ' ' -f -3 )
#network stats in Bytes
#NW=$( dstat -n --nocolor 1 1 | tail -1 | awk '{ print $1, $2}' )
#this one is not so good, increases a delay of 1-2s of the updating.
#put it in the xsetrootname plz (tip of the day, do not put | as first char after "
xsetroot -name "$AVG | $memfreak MB | $battper% $battery | Vol: $VOL | $CLK | "
sleep 1
done &

#loop is done? :p


sleep 1
/usr/bin/ck-launch-session &
/usr/local/bin/stalonetray &
/usr/bin/nm-applet &
/usr/bin/gnome-volume-control-applet &
feh -z -Z --bg-scale /home/jguldmyr/Pictures/dwm_pattern.png
#feh -z -Z -B black -b trans --bg-scale /home/jguldmyr/Pictures/Flow.png
#start dwm after loop
exec /usr/local/bin/dwm > /dev/null

DWM – not your average mainstream window manager

Have been playing around with a new window manager (new as in for me, I’ve only used fluxbox, kde and gnome before) called DWM – see more information on www.suckless.org.

I’m running it on a T400 with RHEL6 (which uses gnome login manager – gde).


  1. if you want to make a change like modify keyboard shortcuts, rules, tagging, top bar stuff, you need to edit config.h and then compile (make and then make install). Then you need to re-load dwm.
  2. after that is done, create a properly formatted file under /usr/share/xsession/
  3. then in the login manager you can chose dwm :)


  1. install dmenu as well, it is neat. ALT+P, then type what you want to run, then hit enter. Also if you type in ‘lock’ it will find xlock etc.
  2. ALT+SHIFT+ENTER gives you the terminal, ALT+SHIFT+Q quits dwm and gets you back to the login manager.
  3. ALT is the default, can be modified to apple- or windows-key

My problems :

  1. re-load dwm can be done in several ways but I have not found one that works well for me. If you do like me and run dwm in a while loop the only way I’ve found out so far is to reboot the whole machine. Because I don’t know how to log off the session and get back to the gdm login manager. I hope I do find a way around because rebooting kind of sucks ;)
  2. gnome-session-save –logout does not work -gave some kind of error
  3. MODKEY+SHIFT+Q only seems to re-fresh the screen, doesn’t actually re-load the whole she-bang.

DWM top bar can be edited to show other things than DWM version. See my post here about that.

DWM editing the bar to show time

xrdb -merge ~/.Xresources
while true; do
# BAT=$(acpi | awk '{ print $4 }' | sed s/","//g)
CLK=$( date +'%H:%M')
# xsetroot -name "$BAT | $CLK"
xsetroot -name "$CLK"
sleep 1
done | while true; do ~/bin/dwm; done

Will this work to on RHEL6 x64 on a T400 Lenovo/IBM? Let’s see tomorrow :)

*** 14/3 0900- after a little modification the startup script now looks like this (just pointed to it in /usr/share/xsession/dwm.start) – script is also chmod a+x:

# commands here and before the "while true; do" are run once
#not applicable? I do not have this directory in my home dir.
#xrdb -merge ~/.Xresources
#open screensaver
#open power manager

while true; do
#battery remaining capacity in mh. About 10 every second.
BAT=$( cat /proc/acpi/battery/BAT0/state | grep rem | awk '{ print $3 }' )
#time in this format Monday March 14 08:57:52
CLK=$( date +'%a %b %d %R:%S' )
#volume in %
VOL=$( amixer get Master | tail -1 | awk '{ print $5}' | tr -d '[]' )
xsetroot -name "Vol: $VOL | Bat: $BAT | $CLK"
sleep 1
done | while true; do /usr/local/bin/dwm; done

What I want to figure out is how to logout! .:DD:dD
MODKEY+SHIFT+Q only refreshes the screen.
MODKEY+l (which I’ve set to run “gnome-screensaver-command -l” : lock – lets me run another user, but I cannot logout myself)
so with this setup I have to reboot the computer for each time I want to re-load the configuration (after a change in config.h make;make install)

** update 14/3 1600

static const char *volup[] = { "amixer", "set", "Master", "15%+", NULL };
static const char *voldown[] = { "amixer", "set", "Master", "15%-", NULL };

{ MODKEY, XK_Up, spawn, {.v = volup } },
{ MODKEY, XK_Down, spawn, {.v = voldown } },

will lower/increase the volume with 15% with MODKEY+up or MODKEY+down :)
if you are unsure what the key should be called you can run ‘xev’ which will tell you what they are

KeyRelease event, serial 27, synthetic NO, window 0x1a00001,
root 0x111, subw 0x0, time 277994, (965,69), root:(966,87),
state 0x0, keycode 111 (keysym 0xff52, Up), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False

KeyPress event, serial 27, synthetic NO, window 0x1a00001,
root 0x111, subw 0x0, time 278097, (965,69), root:(966,87),
state 0x0, keycode 116 (keysym 0xff54, Down), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:

Virtualbox – Free OS Virtualization

Had the opportunity to try out virtualbox the other day on RHEL.

I really liked the part that the rpm that I downloaded was signed and I had to import the signature to be able to install the package! Feels safe. Install did not cause any other problems for me.

As far as the interface goes I like it a lot.
Quite intuitive and worked fine for what I did with it (load a pre-made .vdi, boot, configure).

Not that different at all from VMWare Workstation. But I didn’t do much at all with virtualbox except the initial setup of the VM.

It is also free!

Some cool stuff:

  • manage the VMs via php
  • updated about once a month
  • Runs on windows/linux/osx/solaris
  • you can convert vmware vms into virtualbox format or you can actually import a vmware vm

Not so cool stuff:

  • oracle -> means suddenly you may have to pay licenses for it ;s

RHEL and web-server

Another thing you will notice if you are used to debian is that RHEL has iptables enabled by default.

To alter it you use the ‘iptables’ command. It is quite complex and there are good guides out there.

If you just want to let http and ssh through you can run this:

iptables -I RH-Firewall-1-INPUT 3 -p tcp -m tcp –dport 80 –tcp-flags SYN,RST,ACK SYN -j ACCEPT
iptables -I RH-Firewall-1-INPUT 3 -p tcp -m tcp –dport 22 –tcp-flags SYN,RST,ACK SYN -j ACCEPT

You do not have to change anything in httpd (made by apache by the way) to enable it.
Just point your browser. The document root is by default: /var/www/html

Time Sync for Linux VMs in VMWare Workstation

You may have seen in my previous post about EyeOS that I tried many things to get time in sync on the virtual OS. It was drifting lots of time and after a few hours it was an hour behind. Google tells me this is quite common but I could not find anything that decidedly fixed it.

run ntpdate every hour. This is not advised, primarily because it will add a lot of extra load after a while to the public(free) time servers. Especially if I want to have several machines up to date. One thought then was to set up a local ntpd and let other guest OS sync time with that. But then I could not get that in sync so we were back to square one.

others mention using VMWare tools time sync.

My setup:

Intel Quad Core i7-920
8GB RAM Corsair XMS3 DDR3 1333MHz 8GB CL9
Gigabyte GA-EX58-UD3R
Windows 7 x64
Vmware Workstation 7.1.1

What works for me

For ubuntu 10.10 x64:

Make sure vmware tools is installed (type vmware and hit ‘tab’).
With a .txt editor open up “vmname.vmx” on your host OS.
Set tools.syncTime = “FALSE” to “TRUE”. Restart vm.

Now on this particular machine I’ve had ntpd installed, but it is now uninstalled.

For Red Hat Enterprise Linux  5 x64 – RHEL 5:

  • Install vmware-tools (without make/gcc installed).
  • Set tools.syncTime = “TRUE”
  • Set up ntpd with the below from ntp.conf
  • Restart ntpd by getting root shell with ‘su -‘ and then ‘/etc/init.d/ntpd restart’

I filled out the ntp-information during installation and then after wards I added the “tinker panic 0” which should let the ntpd make ‘big jumps’ and by commenting the fudge-line I chose not to use the local clock because this is drifting so much.
More than 24 hours after I installed the OS the driftfile is still 0.000.


tinker panic 0
restrict default kod nomodify notrap nopeer noquery

restrict -6 ::1

# Hosts on local network are less restricted.
#restrict mask nomodify notrap

server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org

# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available.
#fudge stratum 10

driftfile /var/lib/ntp/drift
keys /etc/ntp/keys
restrict 0.rhel.pool.ntp.org mask nomodify notrap noquery
restrict 1.rhel.pool.ntp.org mask nomodify notrap noquery
restrict 2.rhel.pool.ntp.org mask nomodify notrap noquery

RHEL 5 + Unity

See my previous post for how to install it.

A couple of days later and the time is still in synch.
When I logged on there was a pop-up saying there were some updates.
Put in root password and you get to see which are updates, the ones with a symbol next to them requires a reboot (kernel update in my case).

The VNC that was installed was a VNC client, not the server.
There aren’t that many packages by default – this is probably because all depositories are not enabled and that this is not Fedora.

After installing vmware-tools, a reboot or two and the resolution can be changed to larger than 800×600. And Unity works as well!

Red Hat Enterprise Linux(RHEL) in VMWare Workstation

Test with Red Hat Enterprise Linux (RHEL).

Download: Sign up for an evaulation on https://access.redhat.com/downloads/


VMWare Workstation does find this in “easy install”. Not doing that this time.

20GBdisk (default) and 1552MB RAM (default 1024MB)

  1. install in either graphical or text mode, going with graphical. There are also special modes. Maybe something similar to Ubuntu’s minimal virtual kernel is available?
  2. test cd
  3. Mouse works!
  4. Get subscription number with the help of this: https://access.redhat.com/kb/docs/DOC-15404. Copy paste did not work.
  5. Filesystem stuff. Modify or not. Encrypt or not. I went with default and encryption. For encryption you need to set a boot password (min 8 chars).
  6. IP/Timezone settings.
  7. root password (not min 8 chars)
  8. software sets – software development, virtualization, web server. I went with the two last. You can also customize it deeper. Like: gnome/kde? Printing support? Samba? I chose web server but mysql was not selected, not the php-mysql plugin for apache either. Virtualization is Xen – openfabrics enterprise distribution for RDMA/infiniband stuff.
  9. cool stuff found: iptraf, hwbrowser, vnc
  10. /root/install.log for install .. log.
  11. After this it says that it will require all cds.. but I want to download them instead. How? proceeding anyway, let’s see what happens. Maybe it gives the opportunity to download instead. Googling in the meantime. Doesn’t look good. One way to do it would be to put the CDS/dvd on a network/http server in your LAN. But it does not mention a public repository etc.
  12. Formatting, then installing. It asks for CD2. No other buttons. Getting DVD instead. rhel-server-5.6-x86_64-dvd.iso
  13. DVD went fine, nothing after this, just reboot.


  1. Insert LUKS password – the encryption password you entered before.
  2. IPv6 failed during first boot.
  3. Also some kind of disk monitoring.
  4. Then a little configuration! This is nice. In ubuntu/debian it just goes into the system with a bunch of default setings.
  5. Like firewall, enabled/disabled. Trusted srevices.
  6. SELinux – ‘improved’ security controls, enforced/permissive/disabled. Keeping default: enforced.
  7. no kdump
  8. NTP! Enabling this, using default ntp servers (0.rhel.pool.ntp.org) and disabling ‘use local time source’. This part contacts the NTP server during install, which worked, so that looks good.
  9. Connect to RHN. Said yes. Takes a long time to register? no contact. Trying this later.
  10. Set up a new user. You can use kerberos or NIS too from here.
  11. Insert additional CDS
  12. Login prompt!

After login

  1. VM -> Install VMWare Tools – I want to use “Unity” in Red Hat. I’ve used it for Windows XP (had a guest os for work) and it was great.
  2. Right-click the tarball and ‘extract to’. You need to have root access when you run it. So open a terminal and type ‘su -‘ – this will give you the root prompt.
  3. Then go to where you extracted it. ./vmware-install.pl.
  4. Gives message that I apparently am running a Xen kernel and that this is not supported. Trying anyway. Answering yes as default on the questions.
  5. Install was successful, opening configuration tool. Some green ‘OK’ s.
  6. Before we can compile we need to have make and gcc installed. It also asks for kernel headers that it couldn’t find. Going with the default “” on that.
  7. memory manager, vmhgfs (filesystem driver for shared folders), vmxnet (fast ethernet), vmblock (drag ‘n’ drop), communication service, vsock, vmxnet3 (virtual network card), pvscsi,  – not installed because no compilation software like make/gcc installed.
  8. x configuration, host resolution found but vm resolutions max at 800×600!?
  9. restarting and it said good stuff, but unity does not work and resolution cannot be changed above 800×600.
  10. accessing via ssh works fine too