VCHI initialization failed Raspberry Pi Fixed

vcgencmd get_mem arm VCHI initialization failed
Example showing VCHI initialization failed error

If when running vcgencmd on a raspberry pi you get VCHI initialization failed then you need to add the video group to your user. The vcgencmd tool requires you have this group role so without it, it will give VCHI initialization failed.

To add the user group to your user you can run:

sudo usermod -aG video <username>

Where <username> is the user you want to run the vcgencmd command with. This command adds the video group to the the user you specify.

Once you have ran the command any new logins will run the command successfully. Logging out and back into the pi will let you use the command.

Why this problem occurs

This issue happens when you try and use the vcgencmd command with a user that isn’t a member of the video group. This typically happens when you create a new user for the raspberry pi and don’t give it the same groups that the pi user has.

The solution above fixes this by adding the correct video group to the created user.

Mysql workbench working with key based exchange mechanisms

It appears newer linux sshd configs (fedora 22) by default include a smaller set of key exchange based mechanisms that they have turned on.

This means that it gives errors saying it is unable to connect to the server. To fix this you need to enable some of the older key exchange mechanisms,

Adding this line to /etc/ssh/sshd_config and restarting the sshd server will fix it


Credits to:

Install Virtualbox guest additions on Fedora 21 XFCE

Installing via the normal route didn’t work and meant I couldn’t easily resize the screen. Doing the below allowed me to use the resize easily.

  1. Install rpmfusion on fedora
  2. run `sudo yum install akmod-VirtualBox VirtualBox-guest`
  3. run `cd /usr/src/akmods`
  4. run `sudo rpm -ivh VirtualBox-*.rpm`

Once this was installed, rebooting will give you access to shared folders and fullscreen mode

Found the fix on the fedora forums for fedora 19

Add a user to a group in Linux

How to add a user to a group in Linux

usermod -a -G  

Its a simple as that. So for me adding the user “chewett” to the user “vboxusers” i run the command

usermod -a -G vboxusers chewett

The -a flag means that the new group is appended, without it you will overwrite your current groups with the specified one, In nearly all cases this is not what you want to do!

Location of GeoIP.dat for PHP

To find the location of GeoIP for PHP you can ssh into the server and use the “find” command.

find / -iname GeoIP.dat

Will return a list of file paths where the file with this name is found. In my case I found:


In my case the bottom link was the one that PHP was searching for, To confirm this i moved the file and PHP started to complain that it couldn’t find the file.

Previously because I was updating the wrong file it didn’t update my install so PHP was returning old and wrong data.

Show trailing whitespace in Vim

A small snippet of code showing trailing whitespace being shown in vim
A small snippet of code showing trailing whitespace being shown in vim

Vim is a wonderful command line text editor with syntax highlighting and everything you could ask for provided you turn on the functionality. Recently i was shown that it was also show trailing whitespace with a quick addition to the .vimrc file.

All you need to do is add the following:

set list
set listchars=tab:→\ ,trail:☃

Thanks to Sam for showing me this, Here is his full vimrc or a directory of all of his settings files. Have a browse!


Using Nvidia Optimus on Fedora

If your computer is recent and has an i3/i5/i7 intel core and a Nvidia graphics card it likely uses Optimus technology. This smart piece of software turns off the power-hungry Nvidia graphics card and runs most programs on the integrated intel graphics chip. In laptops this can save a lot of power. However this solution is only available in windows 7 upwards.

The problem occurs when you are using an operating system that doesn’t support this, as in most cases both cards will run all the time, causing major battery drain. On laptops this can severely shorten the battery life.

However there is a solution to this called bumblebee. This piece of software aims to offer similar technology in Linux-based machines. I found many tutorials on how to install it and work and ended up reinstalling fedora (17 at the time) several times.

However, I found a post from the NC State University Technical Staff Exchange on how to install bumblebee for Fedora and Redhat based distributions. I used this before to install on Fedora 17 and now just today on Fedora 18. Previously I was having a lot of issues getting it to work on Fedora 18 and according to them “nouveau drivers do not work on fedora 18 at this time” which after following their guide and installing the Nvidia ones it started to work.

If you are running a laptop with a new intel core and Nvidia graphics card and are getting poor battery life, I suggest you looking into seeing if you have Optimus technology in your laptop, and if so try this.

However, there is a warning, you will be messing around with your display drivers which could cause your system to not be able to display any GUI. Back up everything before trying this.

As usual, if you have any questions, it worked for you or you have something to add to my post, leave a comment!