Executing script on the host when running Vagrant commands

When running Vagrant commands there might be the need to execute something on the host as a pre setup requirement.

Since Vagrant is built with ruby it is possible to execute a shell script utilizing the system utility


In some cases you might want to run a script only in a certain command of Vagrant, for example, when reloading the Vagrant box you might need to check if your host has all gateway routes configured or any other pre setup task.

  if [ #{ARGV[0]} = 'reload' ]; then
    echo 'Setting up routes on the host when reloading Vagrant box'

List installed packages on CentOS

The command to list installed packages on CentOS is:

yum list installed  

The result will be something like this:

Installed Packages  

To search for a specific package the easiest way is:

yum list installed | grep packageName  

Taking screenshots on CentOS, gnome-screenshot util

By default when CentOS is installed not all the gnome utils are loaded in the system.
The screenshot utils is one of them that is not loaded.
So trying to take a screenshot would fail:


There was an error running gnome-screenshot: Failed to execute child process “gnome-screenshot”

Only the utilities below were available:

  • gnome-about
  • gnome-about-me
  • gnome-appearance-properties
  • gnome-at-properties
  • gnome-at-visual
  • gnome-audio-profiles-properties
  • gnome-character-map
  • gnome-control-center
  • gnome-default-applications-properties
  • gnome-desktop-item-edit
  • gnome-display-properties
  • gnome-font-viewer
  • gnome-help
  • gnome-keybinding-properties
  • gnome-keyboard-properties
  • gnome-keyring
  • gnome-keyring-daemon
  • gnome-mouse-properties
  • gnome-network-properties
  • gnome-open
  • gnome-panel
  • gnome-power-manager
  • gnome-power-preferences
  • gnome-screensaver
  • gnome-screensaver-command
  • gnome-screensaver-preferences
  • gnome-session
  • gnome-session-properties
  • gnome-session-save
  • gnome-terminal
  • gnome-text-editor
  • gnome-thumbnail-font
  • gnome-typing-monitor
  • gnomevfs-cat
  • gnomevfs-copy
  • gnomevfs-df
  • gnomevfs-info
  • gnomevfs-ls
  • gnomevfs-mkdir
  • gnomevfs-monitor
  • gnomevfs-mv
  • gnomevfs-rm
  • gnome-volume-control
  • gnome-volume-control-applet
  • gnome-wacom-properties
  • gnome-window-properties
  • gnome-wm

As you can see, gnome-screenshot wasn’t there.

To install the gnome-screenshot util:

[sourcecode language=”bash”]
sudo yum install gnome-utils

That should fix the problem and you should be able to take screenshots as you would normally expect:

The official webpage for the gnome-utils project

VirtualBox and USB devices, vboxusers.

By default when installing VirtualBox on Ubuntu, you won’t be able to access USB devices in the VM.

To get around that problem is very simple, below are listed the steps needed to get access to USB devices in the VM.

First, make sure you have the latest version of the software:
Download VirtualBox

You also need to install the extension pack:
Get Extension Pack

and the Guest Additions:

Guest Additions Manual

After installing all the extra dependencies, it is time to enable USB access to the VM.


Right click on the VM and select settings:

You will get this message:

Failed to access the USB subsystem*

VirtualBox is not currently allowed to access USB devices. You can change this by adding your user to the ‘vboxusers’ group. Please see the user manual for a more detailed explanation.

It tells that you need to add your user to the vboxusers group.


There are two ways to add users to groups in Ubuntu.
Via the GUI

If you want something faster, it is also possible to add a user to a group via the command line:

After adding the user to the vboxusers group you need to restart Ubuntu.


Now after adding the user to the vboxusers group, it is time to select which USB device you want to mount in the VM


Access USB devices in the VM

More Info:

Debug Build of Firefox on Ubuntu

Following the tutorial on MDN  and with the help of the #developer channel on IRC I was able to build firefox in debug mode.
These are the steps I followed to get the build working:

Install dependencies:

apt-get build-dep firefox
apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libxt-dev libiw-dev mesa-common-dev autoconf2.13 yasm

Create .mozconfig file in the root of your project

. $topsrcdir/browser/config/mozconfig
mkaddoptions MOZ[email protected]@/ff-dbg
addoptions –disable-optimize
addoptions –enable-debug
add_options –enable-tests


make -f build

It took me around 1h 10min to finish the build

To run firefox:

cd ff-dbg/dist/bin

For some reason, when I start the browser, after a few seconds it goes to sleep and crashes

Also if I try to run the firefox-bin I get this error: