DEV Community

anilv4
anilv4

Posted on • Edited on

Yes, Red Hat Enterprise Linux has a minimal window manager called 'motif' !!!

I believe its the job of every Linux admin to keep the servers as lean as possible.

Installing a Desktop environment is a "BIG NO!" on your production Linux servers, due to many reasons. The biggest advantage is that you do not need to update 1000s of packages and get into unnecessary issues. Also less packages means minimal attack surface and less vulnerabilites.

How much you try there will be ONE enterprise application "admin" that needs a GUI and you must have to configure it. Without GUI the work will not go on. To make it challenging, X11 forwarding over ssh and VNC are not options here, plus the Linux distro is RHEL. As best practice, you do not install upstream packages in RHEL.

The following guide will help you to achieve a lean production server but with a just enough window manager to start the ONE enterprise application in GUI mode and do not need any additional packages that is not in the official repos of RHEL.

Your super hero is motif window manager (mwm), that comes default with RHEL.

Lets start.

Install motif along with the packages to start the Xorg server and Xterm. You are not installing the group X Window System, as it installs many additional packages. Remeber the key word is a lean system.



# yum install motif xterm xorg-x11-server-Xorg 
# yum install xorg-x11-xauth xorg-x11-fonts-* 
# yum install xorg-x11-utils xorg-x11-xinit xorg-x11-drivers


Enter fullscreen mode Exit fullscreen mode

I split the yum commands just for the look for the article. You can execute them as one command with -y option.

Copy the default configuration file used by mwm to home directory of the user. Here my user is test.



# cp /etc/X11/mwm/system.mwmrc /home/test/.mwmrc


Enter fullscreen mode Exit fullscreen mode

The following configuration will auto raise the windows. I found it useful when working with a super minimal desktop.



# cat << EOF > /home/test/.Xdefaults 
Mwm*keyboardFocusPolicy: pointer
Mwm*focusAutoRaise: true
EOF


Enter fullscreen mode Exit fullscreen mode

The following is our initiation script.

xsetroot will help you customize the Xorg, and exec mwm will start the desktop.

One problem I faced was the default black background which was not optimal and did not clearly showed the boundaries of the desktop. I changed it to light blue using xsetroot.



cat << EOF > /home/test/.xinitrc 
xsetroot -solid lightblue
exec mwm
EOF


Enter fullscreen mode Exit fullscreen mode

Change the ownership of the files to user test.



# chown test.test /home/test/{.Xdefaults,.xinitrc,.mwmrc}


Enter fullscreen mode Exit fullscreen mode

Now login as user test and execute the command xinit



$ xinit


Enter fullscreen mode Exit fullscreen mode

If you follow all steps correctly you will see a following screen.
Note that you need to right click to see the start menu of motif.

Motif Welcome Screen

Click on New Window, to open xterm. Now start your program. Here I started firefox.

motif window manager

I hope this article will help you to create a minimal environment. With this setup I was able to bring down the installed packages from almost 1300 to 425 rpms.

Have you faced a similar challenge with GUI in your environment?

Ref:
https://motif.ics.com/motif
https://linux.die.net/man/1/mwm
https://linux.die.net/man/1/xsetroot

Top comments (0)