This post describes how to install the Gephi graph visualization utility on the Mininet 2.2 virtual machine.
I want to investigate the node and link discovery function of OpenFlow and, to do that, I plan to experiment with some components of the POX SDN controller that interface with the Gephi graph visualization utility. Previously, I set up the Mininet network simulator, which includes the POX SDN controller. The final step is to install Gephi on the Mininet virtual machine.
Unfortunately, I found that the install instructions on the Gephi web site do not work. So, I used another procedure to solve the Java issue I encountered and complete the installation.
The Mininet virtual machine
Log into the Mininet VM via SSH with X forwarding. If needed, review my previous post about setting up the Mininet VM. Ensure both the NAT interface and the host-only network interface are connected.
Gephi runs on Java but Java is not installed in the Mininet VM, which is based on a minimal installation of Ubuntu Server 14.04. So we must install Java.
The Gephi documentation states we need to use the Oracle version of Java, which is not available in the standard Ubuntu software repositories. However, I found that Oracle Java did not work and the default version of Java from the Ubuntu 14.04 software repository works fine. So, I followed a different installation procedure that is documented by the Gephi project team.
To install Java on the Mininet 2.2 VM:
mininet-vm:~$ sudo apt-get update mininet-vm:~$ sudo apt-get install default-jre mininet-vm:~$ sudo apt-get install default-jdk
NOTE (added June 3, 2016): The Gephi project moved to Github so all the links I provide below must be changed. Install the latest version of Gephi from Github. https://github.com/gephi
To install Gephi, download and unpack the Gephi tarball in a location of your choice. I chose my home directory.
mininet-vm:~$ cd mininet-vm:~$ wget https://launchpad.net/gephi/0.8/0.8.2beta/+download/gephi-0.8.2-beta.tar.gz mininet-vm:~$ tar -xvf gephi-0.8.2-beta.tar.gz
Run the Gephi startup script each time you want to launch Gephi:
mininet-vm:~$ cd gephi/bin mininet-vm:~/gephi/bin/$ ./gephi
The Gephi window will appear on your host computer’s desktop.
Gephi is installed and appears to work properly. The above procedure works on Ubuntu Server 14.04. Read the rest of this post to see alternative installation procedures.
Here are a few pieces of extra information that I found while I was trying to solve the problems I encountered installing Gephi.
When I run Gephi, I see error messages in the console:
Loading native libraries libGL error: failed to open drm device: No such file or directory libGL error: failed to load driver: i965
These errors are not a problem so they can be ignored. See this link for details. They indicate that Gephi is unable to use the hardware acceleration provided in the OpenGL libraries. This could become an issue if you require high performance because there is a lot of graphic content to display. But, for our purposes — where we are looking at small- to medium-sized networks — Gephi should perform acceptably without hardware acceleration.
If you need hardware acceleration, install Gephi on the host operating system, instead of in the Mininet virtual machine. Then, you’ll need to ensure that you have networking set up correctly so you can use Gephi along with the SDN controller running on the Mininet VM.
Alternative Java installations
Digital Ocean offers an excellent Java installation tutorial that explains how to install different versions of Java, manage which version your system uses, and how to set Java environment variables.
The Gephi documentation states that Gephi requires Oracle Java, not the default version of Java in the Ubuntu repository (OpenJDK)
I found that Oracle Java did not work. Gephi started and then immediately crashed. But, for the record — and because it took some hunting to find the correct steps for Ubunti Server 14.04 — here is the procedure to install Oracle Java.
This is presented only for the sake of information. Do not follow these steps unless Gephi is not working for you when you use the standard Java version.
$ sudo apt-get install software-properties-common $ sudo add-apt-repository ppa:webupd8team/java $ sudo apt-get update $ sudo apt-get install oracle-java8-installer
Java path issue
Another issue others have encountered is that Gephi does not use Java default location, as defined by the update-java-alternatives command, and it ignores the $JAVA_HOME variable.
This is documented in Gephi Issue #903, along with the workaround. To work around this issue, check the contents of the $JAVA_HOME environment variable with the
echo $JAVA_HOME command, copy the path, and paste it in the file gephi.conf, which is in the folder $HOME/gephi/etc/gephi.conf, if you followed the install steps shown above.