Installing Xorg on Gentoo with the nouveau Driver

I configured my kernel as shown here. That was based on the information found here and here. Check out the resources section at the bottom.

Because my kernel is good-to-go, I should just need to make the following changes to my make.conf file before installing xorg-server.

nano /etc/portage/make.conf

These are the changes I made.


Make sure you have the following USE flag.

echo "x11-base/xorg-server" >> /etc/portage/package.use

Before installing xorg-server.

emerge --ask xorg-server

Now refresh your environment.

source /etc/profile

I choose to reboot here.

Starting X

Xorg “should” work out-of-the-box so there “should” be no need to manually create and edit configuration file in the /etc/X11/xorg.conf.d/ directory. Here goes…


The Necessary Troubleshooting

Obviously that didn’t work because that would be too easy!! The output showed xauth complaining about a few things, namely stuff like.

hostname Unknown host
xauth: file /root/.serverauth.4170 does not exist

Then Xorg tries to start but fails with this.

/etc/X11/xinit/xinitrc: line 59: twm: command not found
/etc/X11/xinit/xinitrc: line 60: xclock: command not found
/etc/X11/xinit/xinitrc: line 61: xterm: command not found
/etc/X11/xinit/xinitrc: line 63: exec: xterm: not found
/etc/X11/xinit/xinitrc: line 62: xterm: command not found
xinit: connection to X server lost

waiting for X server to shut down Server terminated successfully (0). Closing log file.

The Fix

Funnily enough, it was the hostname Unknown host message that bothered me the most as this indicates a general networking issue. Turned out I hadn’t associated my hostname with the localhost. This was easily solved by editing /etc/hosts and amending the below line. This removed that particular error but did not get Xorg working.            localhost storm

Now I have a fairly good idea what might be up here but if all this is new to you and your Xorg is failing with similar messages, there a few clues in errors.

One thing to bear in mind is that users of X must be part of the video group. I thought this might explain the xauth warnings. However this can be easily checked with.

storm ~ # groups andy
root bin daemon sys adm disk wheel floppy tape video

Lastly, as per the docs, I believe twm and xterm should be installed. This certainly fits with the last few errors.

emerge --ask twm xterm xclock

This will pull in a few extra packages but hopefully Xorg should work now. Although not strictly necessary, I install xclock here too.

xterm screen shot



Gentoo Wiki – Xorg/Configuration

Gentoo Wiki – X server

Gentoo Wiki – X without Display Manager

Linux Reviews – Screenshot grabbing


Gentoo Wiki Archives – Dell_2407WFP_LCD

Gentoo Wiki – xorg.conf

Gentoo – X.Org/xsession

Gentoo Wiki – Fontconfig

Gentoo Wiki Archives – HOWTO_Xorg_and_Fonts – rxvt-unicode

ArchLinux – Multihead

ArchLinux – Nouveau

ArchLinux – Xorg

ArchLinux – X resources


How-To Geek – How to Quickly Resize, Convert & Modify Images from the Linux Terminal – Manipulating Images – Doing more with…more: Dual-head display

Gentoo – X.Org/Dual Monitors

ArchLinux – Configuring keyboard layouts in X

Unable to Install mkpasswd on CentOS 6.4

I was surprised to find the mkpasswd utility missing from my new installation of CentOS 6.4.

Yum has a feature called whatprovides, which can be used to find out which installable package provides some feature, utility or file. The below demonstrates its use. You just need to prefix ‘*/’ to the utility name that your searching for.

[root@server ~]# yum whatprovides */mkpasswd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
base/filelists_db                                                                                                                     | 5.9 MB     00:00     
extras/filelists_db                                                                                                                   |  10 kB     00:00     
updates/filelists_db                                                                                                                  | 2.8 MB     00:00     
expect- : A program-script interaction and testing utility
Repo        : base
Matched from:
Filename    : /usr/bin/mkpasswd

[root@server ~]# 

The output shows us that the expect package contains the mkpasswd utility.

[root@server ~]# yum install expect

Now I can quickly and easily generate strong passwords from the Linux command line. For example, the following command produces a password using the default set of arguments.

[root@server ~]# mkpasswd

A default password is 9 characters long. Each password will have at least 2 digits (numbers); 2 upper and 2 lowercase alphabetic characters; plus 1 special character, which in our example is an asterisk (‘*‘).

Connect to a NFS Share with Gentoo

Install NFSv4

The below command will install with the default USE flags of ipv6, tpcd and nfsv4.

emerge --ask nfs-utils

Find NFS Shares

If you don’t know or can remember the name of your NFS shared drives, you can use the below command to list the exports.

storm ~ # showmount -e ""
Export list for
/personal shared
/Network Recycle Bin 1
storm ~ #

I want to connect to “/personal shared“, but note the space in the share name.

mount -t nfs " shared" ~/nfs/

To mount a share like this you will need to encase it in double quotes.

If you get a message like this…

mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified

…you need to start the statd daemon.

storm ~ # /etc/init.d/rpc.statd start
 * Caching service dependencies ...                                                                                                                               [ ok ]
 * Starting rpcbind ...                                                                                                                                           [ ok ]
 * Starting NFS statd ...                                                                                                                                         [ ok ]
storm ~ #

To make this change permanent, you need to add statd and other NFS related daemons to the default runlevel.

rc-update add nfsmount default

You should not be able to run the above mount command even after a reboot. To un-mount.

umount -v ~/nfs

Auto-Mount NFS Shares

Now to auto-mount, provided nfsmount is on the default runlevel, you just need to add an entry to your /etc/fstab file.\040shared     /root/nfs     nfs      rw,_netdev,auto,sync    0 0

Note the \040\ where the space should be in “personal shared“. Using double quotes or the like does not appear to work in fstab.


Gentoo Wiki – NFSv4

The Secure Copy (scp) Command

Secure Copy (scp) is a Linux remote file copy command. It can be used like the Copy (cp) command but supports the secure transfer of file between hosts on a network.

The basic synopsis for this program is as follows. See the manual page for more information.

scp [[ user@ ] host1: ] file1 ... [[ user@ ] host2: ] file2

To copy a file from a remote machine to the local host.

scp /home/yourusername/

To copy a file from the local host to a remote machine.

scp file.txt

Installing XMonad on Gentoo

I have already installed Gentoo with a Kernel supporting NVidia graphics cards using the open-source Nouveau driver. I also have a working installation of Xorg server.

Now all that’s left to do now is install XMonad!

emerge --ask xmonad xmonad-contrib

Notes that will probably be removed/deleted

The above pulled in a lot of additional software and took quite a long time to complete. However, all seemed to work. Here I should mention about how to start and link to command/cheatsheet etc. Include .xinitrc and how .xsession does not work (should be removed it present).

After that I decided to install firefox. That too pulled in a lot of software and took ages to complete. More so than the above! I did need to add the following to package.use.

=/dev-lang/python-2.7.5 sqlite

After the installation, I saw the below Portage warning messages.

* For more information on udev on Gentoo, upgrading, writing udev rules, and
*     fixing know issues visit:

* Messages for package sys-fs/udisks-2..1.0:

*    CONFIG_USB_SUSPEND:               is not set when it should be.
*    Please check to make sure these options are set correctly.
*    Failure to do so may cause unexpected problems.

* Messages for  package media-video/mjpegtools-2.0.0-r3:

* mjpegtools installs user contributed scripts which require additional
* dependencies not pulled in by the installation.
* These have to be installed manually.
* Currently know extra dependencies are: ffmpeg, mencoder from mplayer,
* parts of transcode, mpeg2dec from libmpeg2, sox, toolame, vcdimager, python.

* Messages for package app-misc/strigi-0.7.7-r2:

* Because you didn't enable either of the available backends:
* clucene or hyerestraier, strigi may not be functional.
* If you indend to use standalone strigi indexer (not needed for KDE),
* be sure to reinstall app-misc/strigi with either cluence (recommended)
* or hyperestraier (unreliable) USE flag enabled.

* Message for package sys-auth/polkit-kde-agent-0.99.0-r1:

* WARNING! Your system configuration contains neither "kde-base/kdebase-runtime-meta"
* nor "kde-base/kde-base-startkde".  You need one of the above.
* With this setting you are unsupported by the KDE team.
* All missing features you report for misc packages will be probably ignored for closed as INVALID.

I made the above kernel change on the next next kernel upgrade but as far as I could tell XMonad seemed to work fine without it anyway.


Arguments With My Friends – How to Install Xmonad on Gentoo – Tutorials – Learn You a Haskell for Great Good!

Gentoo Wiki – Xmonad – Xmonad/Installing xmonad – Xmonad/Basic Desktop Environment Integration

Wikipedia – xmonad

Think In Geek – Simple guide to configure xmonad, dzen2 and conky

Wikipedia – Conky (software)

Gentoo Wiki – rxvt-unicode – Xmonad/General xmonad.hs config tips – Xmonad/Config archive/John Goerzen’s Configuration

ArchLinux – Xmonad – Xmonad/Frequently asked questions

How-To Geek – How to use Xmonad, a Tiling Window Manager for Linux

Huntly Cameron Web Stuffs – How-to: Set up XMonad & XMobar on Ubuntu – Xmonad/Using xmonad in Gnome – XMonad.Config.Gnome – XMonad.Layout.PerWorkspace – xmonad-0.11 manual – A guided tour

ArchLinux – dmenu

ArchLinux – Gmrun – Xmonad/Using xmonad in KDE – XMonad.Config.Kde – XMonad.Doc.Configuring – sample xmonad.hs by Christian Gogolin

Shinobu’s Secrets – Tag Archives: xmonad

Gentoo: Installing a File Manager

After a little research I have decided to install krusader as my file manager. Installing it should be fairly simple.

emerge --ask krusader

After seeing the below output…


storm ~ # emerge --ask krusader

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild N ] kde-base/libkonq-4.10.5 USE="(-aqua) -debug {-test}"
[ebuild N ] kde-base/keditbookmarks-4.10.5 USE="(-aqua) -debug {-test}"
[ebuild N ] kde-misc/krusader-2.4.0_beta3 USE="bookmarks handbook (-aqua) -debug" LINGUAS="-bg -bs -ca -ca@valencia -cs -da -de -el -en_GB -eo -es -et -fi -fr -ga -gl -hr -hu -it -ja -ko -lt -mai -nb -nds -nl -pa -pl -pt -pt_BR -ro -ru -sk -sl -sr -sr@ijekavian -sr@ijekavianlatin -sr@latin -sv -tr -ug -uk -zh_CN -zh_TW"

Would you like to merge these packages? [Yes/No]


…I run the below to make use of the English/British USE flag. I install both en_GB and uk USE flags.

echo "kde-misc/krusader en_GB uk" >> /etc/portage/package.use

For some reason the change in USE flags were not picked up. However, I proceeded and installed it anyway. The below was the output.


-- Installing: /var/tmp/portage/kde-misc/krusader-2.4.0_beta3/image/usr/share/locale/ja/LC_MESSAGES/
>>> Completed installing krusader-2.4.0_beta3 into /var/tmp/portage/kde-misc/krusader-2.4.0_beta3/image/

strip: x86_64-pc-linux-gnu-strip --strip-unneeded -R .comment -R .GCC.command.line -R
ecompressdir: bzip2 -9 /usr/share/doc

* QA Notice: Package triggers severe warnings which indicate that it
* may exhibit random runtime failures.
* /var/tmp/portage/kde-misc/krusader-2.4.0_beta3/work/krusader-2.4.0-beta3/iso/kiso.cpp:261:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
* /var/tmp/portage/kde-misc/krusader-2.4.0_beta3/work/krusader-2.4.0-beta3/iso/kiso.cpp:261:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
* /var/tmp/portage/kde-misc/krusader-2.4.0_beta3/work/krusader-2.4.0-beta3/iso/kiso.cpp:318:79: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
* /var/tmp/portage/kde-misc/krusader-2.4.0_beta3/work/krusader-2.4.0-beta3/iso/kiso.cpp:319:79: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
* /var/tmp/portage/kde-misc/krusader-2.4.0_beta3/work/krusader-2.4.0-beta3/iso/kiso.cpp:325:90: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

* Please do not file a Gentoo bug and instead report the above QA
* issues directly to the upstream developers of this software.
* Homepage:

>>> Installing (3 of 3) kde-misc/krusader-2.4.0_beta3
* QA Notice: Symbolic link /usr/share/doc/HTML/pt_BR/krusader/common points to /usr/share/doc/HTML/pt_BR/common which does not exist.
* QA Notice: Symbolic link /usr/share/doc/HTML/uk/krusader/common points to /usr/share/doc/HTML/uk/common which does not exist.
* QA Notice: Symbolic link /usr/share/doc/HTML/pt/krusader/common points to /usr/share/doc/HTML/pt/common which does not exist.
* QA Notice: Symbolic link /usr/share/doc/HTML/sv/krusader/common points to /usr/share/doc/HTML/sv/common which does not exist.
* Updating icons cache ... [ ok ]
* Updating desktop mime database ...
* Updating shared mime info database ...

* WARNING! Your system configuration contains neither "kde-base/kdebase-runtime-meta"
* nor "kde-base/kdebase-startkde". You need one of above.
* With this setting you are unsupported by KDE team.
* All missing features you report for misc packages will be probably ignored or closed as INVALID.

>>> Recording kde-misc/krusader in "world" favorites file...

* Messages for package kde-misc/krusader-2.4.0_beta3:

* WARNING! Your system configuration contains neither "kde-base/kdebase-runtime-meta"
* nor "kde-base/kdebase-startkde". You need one of above.
* With this setting you are unsupported by KDE team.
* All missing features you report for misc packages will be probably ignored or closed as INVALID.
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

* GNU info directory index is up-to-date.
storm ~ #


This seems to have worked anyway.

Krusader file manager
Krusader file manager


Tech Republic – 10 Linux file managers worth checking out – Twin panel file management for your desktop – What is Konqueror? – Comparison of file managers

Linux Links – 14 of the Best Free Linux File Manager

Rackspace Cloud DNS

Rackspace provides a great easy to use tool for managing your DNS.

The first thing you need to do is create a zone file for the domain you want to manage. To do this, first log into the customer portal and navigate to the DNS tab at the top of the page.

Click on “Create Domain” and fill out the details from the drop-down menu.

Rackspace Cloud DNS
Rackspace Cloud DNS

Click on “Create Domain” to create the zone file.

Create Domain
Create Domain

Now we need to add some DNS records to the zone file. Here I add an A record so the domain resolves to the IP

Add DNS Records
Add DNS Records

The last thing we need to do is make sure the Rackspace name servers are authoritative for our domain. To do this, you will need to make contact with whoever you lease the domain name through. I bought my domain name through; normally you will just need to log onto the control panel provided by your DNS registrar and set the DNS name servers for the domain in question to the below.

Job done!

You can check to see how your DNS changes propagate around the world using the below website.–

Load Balance you Rackspace Cloud Server

Rackspace cloud load-balancers allow you to easily distribute the traffic across multiple nodes.

Every time you create a new cloud server, it is assigned a new public IP address. If you were to image that server, delete it and then re-create it, it will be given a new IP address. For this reason, I would recommend a load-balancer from the off. Especially if you know the site is going to be about for a while. That way, the IP address will not change, even if the IP address of the nodes behind it do….And yes, you only need one node behind the load-balancer for it to work.

Create a Load Balancer

Navigate to the Load Balancer section of your customer portal. Once there, click on “Create Load Balancer“.

Rackspace Cloud Load Balancers
Rackspace Cloud Load Balancers

Fill in the details. Most of which is fairly self explanatory. My load balancer is for a website so I want it to be publicly accessible on port 80.

I chose the “least connections” algorithm. If you are unsure which one to choose, hover your mouse over the question mark icon for a description of each.

Load Balancer Configuration
Load Balancer Configuration

Now click on “Add Cloud Servers” and select the nodes you want behind the load balancer. Here I only chose one server.

Add Node to Load Balancer
Add Node to Load Balancer

Now confirm the load balancer details and click on “Create Load Balancer“.

Create load balancer
Create load balancer

Test the Load Balancer

To test it works, simply enter the public IP address of the load balancer in a web browser. You should see your website.

Test Load Balancer
Test Load Balancer

Job done!

Install Apache on Ubuntu Server 13.10

First you need to prepare the machine that you are going to use. I’m using a Rackspace cloud server. In which case, all I need to do is spin up a server and update the Operating System software.

Install Apache2

Installing Apache is easy, simply run apt-get install apache2 as the root user.

root@apache:~# apt-get install apache2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  apache2-bin apache2-data libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap ssl-cert
Suggested packages:
  www-browser apache2-doc apache2-suexec-pristine apache2-suexec-custom apache2-utils openssl-blacklist
The following NEW packages will be installed:
  apache2 apache2-bin apache2-data libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,302 kB of archives.
After this operation, 5,314 kB of additional disk space will be used.
Do you want to continue [Y/n]? 

Once the installation has finished, open up a web browser and enter the IP address into the address bar. Hopefully you should see a page like the below.

Installing Apache
Testing apache

And that’s it! Apache is now installed and working!

Set the Hostname

Your likely to see the below error message.

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 2a00:1a48:7806:117:936d:610a:ff08:747d. Set the 'ServerName' directive globally to suppress this message
                                                                                                  [ OK ]

This is caused by the hostname not being set correctly. Open up /etc/hosts and enter something similar to the below, adjusting for your own environment.

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters www localhost

2a00:1a48:7806:0117:936d:610a:ff08:747d www www www

If you too are using a Rackspace cloud server, the most important line is shown below.

2a00:1a48:7806:0117:936d:610a:ff08:747d www

This will stop the warning message.