Monday, April 2, 2012

Virtualization Performance with Ubuntu and VMWare or Virtualbox

I've been using Linux as my primary OS for a couple of years not.  However, as a network guy I still need a windows box around for various tasks.  Mostly because the company I work for uses GoToMeeting online data conferencing and they lack Linux support.

I've found using a Virtual install of Windows to work  best for my needs.  A couple of months ago I built a new Windows 7 virtual install but it suddenly slowed to a crawl!  When I first built the box it would boot up to the login prompt in about 30 seconds.  More recently it was was taking more like 5 minutes to boot up.  And when it was my entire host Linux box was slowed down as well.  I noticed that disk utilization was through the roof when this was happening.

Further inspection showed that the host was swapping to the disk like crazy while the VM Windows install was booting up.  The swapping combined with the disk access of the VM overloaded the physical disk system and brought everything down with it.   I've got 4 GB of ram on the system, so I should be able to run the VM with a couple of gigs so RAM and still have enough left over for the host.

The solution to the issue was to decrease the swappiness of the host system.

sudo sysctl vm.swappiness=10
The swappiness setting effects the algorithm that controls when memory is swapped to disk.  The default value on Ubuntu systems is set to 60.  I lowered it down to 10 and have seen a HUGE performance improvement when running the VM!  I've since verified that that work with VMWare or Virtualbox.

Please the SwapFAQ article for more information.

Thursday, January 12, 2012

Running junipernc on 64 bit Ubuntu 11.10

So I just got a new laptop and set it up with 64 bit Ubuntu 11.10 (It has 4GB of memory).  I figured I'd just use the procedure I documented here to run the Juniper vpn client.  Unfortunately this did not work.  The gui dialog never opened and it never connected.  The junipernc script writes log files to the /tmp directory and I found the following error: \


Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/ericw/.juniper_networks/jdk1.6.0_30/jre/lib/i386/xawt/libmawt.so: libXtst.so.6: wrong ELF class: ELFCLASS64
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703)
at java.lang.Runtime.load0(Runtime.java:770)
at java.lang.System.load(System.java:1003)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1724)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38)
at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29)
at java.awt.Component.<clinit>(Component.java:566)
Could not find the main class: NC. Program will exit.

I'm no expert, but it looks like the 32bit version of Java is trying to use a 64 bit library (libXtst.so.6).  My solution at this point is to run the junipernc script with the -nojava option.  This avoids the java issue altogether, but without the gui I don't know when it's connected or not.  This is not an ideal situation, but at least I can get access to my company network.

UPDATE
In the comments quickfix recommends installing ia32-libs:
sudo apt-get install ia32-libs