Monday, November 7, 2011

Cisco Packet Tracer (ugly, horrid) Fonts

So, for those of you Cisco people out there, I'm sure there will be a point where you will want to install and use Packet Tracer for your network simulations. Read below if you are having issues using it.

If you don't know what I'm talking about, not to worry. This is a program designed by Cisco which let's you create network environments and simulate network traffic. It's a nifty tool.

I acquired PacketTracer53_Ubuntu.tar.gz from Cisco's Net Academy website (cisco.netacad.net) after doing a search for Packet Tracer (while logged in).

Afterwards, I unzipped it (tar -xvzf PacketTracer53_Ubuntu.tar.gz) into my Downloads directory and did a sudo ./install from the directory containing the extracted files.

Everything is fine from here... until you open the application. Then, you are presented with a GUI that has the crappiest, most horrific looking fonts you'll ever see in your life! Not to worry. This can be fixed.

The problem? Packet Tracer uses its own Qt4 libraries instead of using the ones that you already have on your system. From what I understand, any of the subpixel rendering that has been compiled into the libraries on your system are not present in the libraries for Packet Tracer. The Qt4 packet tracer libraries are located in the /opt/pt/lib directory, assuming you installed Packet Tracer in /opt/pt.

The solution? See below. THIS ASSUMES YOU ARE USING MINT LINUX 11 AND QT LIBRARIES 4.7.2. I am confident it will work on Ubuntu (and hopefully, other QT versions), but not so sure on other distributions (i.e. the directories may be different). Keep this in mind.

First, back up the lib directory where you installed Packet Tracer. This is /opt/pt/lib by default.
cd /opt/pt
sudo cp -r lib lib.bak

UPDATE: Second, you may need to install the following packages. Execute the following:

sudo apt-get install libqtwebkit2.2-cil libqt4-script libqt4-qt3support libqt4-sql

Copy the following files from /usr/lib to /opt/pt/lib, or wherever you installed Packet Tracer.

libQt3Support.so.4.7.2
libQtCore.so.4.7.2
libQtGui.so.4.7.2
libQtNetwork.so.4.7.2
libQtScript.so.4.7.2
libQtSql.so.4.7.2
libQtWebKit.so.4.7.2

So, for the first file, you'll do:
sudo cp /usr/lib/libQt3Support.so.4.7.2 /opt/pt/lib
sudo cp /usr/lib/libQtCore.so.4.7.2 /opt/pt/lib
... and so forth, for the remaining Qt files on the list above.

Then? Go ahead and delete the 4.4.3 counterparts in the /opt/pt/lib directory. For example:

sudo rm libQt3Support.so.4.4.3
sudo rm libQtCore.so.4.4.3
... and so forth.

Now? Well, Packet Tracer will be looking for the 4.4.3 files! We need to trick Packet Tracer into using the higher version Qt libraries.

The trick? Symlinks.

sudo ln -s [TARGET] [SYMLINK_FILE_NAME]

So... (do this in the /opt/pt/lib directory, or wherever the PT library directory is)

sudo ln -s libQt3Support.so.4.7.2 libQt3Support.so.4.4.3
sudo ln -s libQtCore.so.4.7.2 libQtCore.so.4.4.3
... and so forth, for all of the Qt files we copied.

As a result, when Packet Tracer tries to access the 4.4.3 libraries, they'll actually be using the 4.7.2 libraries.

Finally, you'll want to make all of the libraries we've copied over from /usr/lib executable. To do this, perform the following:

sudo chmod +x libQt3Support.so.4.7.2
sudo chmod +x libQtCore.so.4.7.2
... and so forth.

Now run Packet Tracer. You should be good to go.

You'll notice that there are two Qt files we didn't touch.

libQtAssistantClient.so.4.4.3
libQtXml.so.4.4.3

There's a reason. First, when I was doing all of this for myself, I initially didn't find the 4.7.2 counterpart for libQtAssistantClient library in the /usr/lib directory. So, I tried to perform the above steps without this file.

Second, there is a libQtXml.so.4.7.2 file in /usr/lib. However, if you use this file in /opt/pt/lib and run Packet Tracer, it will segfault when you try to do things like delete devices. I think this has to do with methods/functions in the code that can change from some versions to others, but don't quote me on that. So, as a result, I avoid using this file.

If you're a savvy user, you may see other ways to perform essentially what I have done above. No problem. I just posted what I did so you get the idea of what I accomplished.

And the result? Look... pretty!


If you want to contrast my steps with the troubleshooting steps that others have taken, see the links below:


No comments:

Post a Comment