Cracking the Juniper Network Connect problem on Linux 64 bit

One of the most frustrating problems that I have ever worked on was to get this darn VPN connect work and I used a 32 bit Ubuntu for over a year and half on a 64 bit machine only because I could not get the VPN connect work.

Finally, with _due_ help from a colleague Ebben – I have a way to get things going on 64 bit Mint 12 (moved from Ubuntu recently as I hate Unity…).

The most useful resource in this regard are the Mad Scientist page and the Ubuntu forum thread  discussing this issue. Please refer these pages for 32 bit setup. I am devoting this post only for 64 bit and assuming most things are in place or you know how to set it for a 32 bit Linux.

Hoping the following are more than sufficient to get things going (at least on Mint which comes with Sun Java in place but I put the steps nevertheless) –

1. Install Opera – I chose opera as it works well for me and I could not get the 32 bit plugin work with the other 64 bit browsers. If it works for you kindly let know.

You can install the package using the command below –

$ sudo apt-get install opera      # assuming the repository is in place if not refer this.

2. Install Sun Java – Excerpt from the Mad Scientist page

On 32-bit Ubuntu I use:

sudo aptitude install sun-java6-plugin sun-java6-jdk sun-java6-jre

On 64-bit Ubuntu I use the above plus this:

sudo aptitude install ia32-sun-java6-bin

3. Get the 32 plugin in place

Ensure that the 32 Java plugin is pointed to from the browser of your choice. In opera –

Check the page opera:about for the plugins path and

$ cd /usr/lib/opera/plugins
$ sudo ln -s /usr/lib/jvm/ia32-java-6-sun-1.6.0.26/jre/lib/i386/libnpjp2.so

You can test the plugin using the URL – about:plugins

For opera it translated to opera:plugins

On refresh plugins I saw the Java related plugins in place –

Java(TM) Plug-in 1.6.0_26

Java(TM) Plug-in 1.6.0_26

Java(TM) Plug-in 1.6.0_26

NOTE: A restart of the browser might be necessary if you have already opened it – it worked for me without a restart! 🙂

4. You are good to go

Just key in the URL that connects you and this works like a charm as it would on a 32 bit Linux.

Hope this post helps you save _some_ time.

NOTE: I see that on 12.04 Sun Java can’t be installed using any repositories due to broken dependencies. I tried installing Oracle 7 as suggested here –

http://www.liberiangeek.net/2012/07/download-and-install-sun-java-6-7-in-ubuntu-12-04-precise-pangolin-easily-with-this-script/

I followed these steps –

$ wget https://github.com/flexiondotorg/oab-java6/raw/0.2.4/oab-java.sh 
$ chmod +x oab-java.sh

$ sudo ./oab-java.sh -7
$ sudo apt-get install oracle-java7-jre oracle-java7-jdk oracle-java7-plugin oracle-java7-fonts

Then I added the 32 bit plugin - 

$ sudo apt-get install ia32-oracle-java7-bin
$ cd /usr/lib/opera/plugins
$ sudo ln -s /usr/lib/jvm/ia32-java-7-oracle/jre/lib/i386/libnpjp2.so

Ok for those none of the above works there is some relief -

Ebben has also written this wonderful script jvpn which works like a charm for me now – https://github.com/earies/jvpn/blob/master/README

If the browser work around is failing or you want a better mechanism you can try Ebben’s script instead. These are the steps for jvpn to work

JVPN

1. Install the following –

$ sudo apt-get install ia32-libs gcc-multilib

2. Log into the Juniper Network Connect via browser to install the ~/.juniper_networks folder.

3. Remove the ncui binary –

$ rm .juniper_networks/network_connect/ncui

4. Run the jvpn script –

$ jvpn --site=XXX --curses
Password:  
ncui binary does not exist, would you like to compile now? (Y/N): Y
>> jvpn    : INFO     ncui binary does not exist, searching for shared object for compilation
>> jvpn    : INFO     ncui compiled successfully
>> jvpn    : INFO     Initiating VPN to: xxx-access.company.com
>> jvpn    : INFO     Authenticated
>> jvpn    : INFO     DSID found - caching to: /home/mynk/.jvpn/cache/xxx-access.company.com.dsid
>> jvpn    : INFO     Certificate file not found [/home/mynk/.jvpn/certs/xxx-access.company.com.crt]
>> jvpn    : INFO     Retreiving server certificate from: xxx-access.company.com
>> jvpn    : INFO     All values retreived - Connecting to VPN gateway
>> jvpn    : INFO     ncui started with pid: 8490
>> jvpn    : INFO     Connected to VPN successfully

Hope this works for you! 🙂

Comments 28

Author Details

  1. Why don’t you use the madscientist’s script? It can be run with the -nogui option, so the Java version is not a problem.

    • I did try all the options and combinations. I run into this IVE 10 error which is due to the host checker being enabled (this is also the case on a 32 bit machine). I don’t understand the problem fully but a colleague is getting a script that will work around this issue. Till then wanted a quick work around. Even in this I am still struggling to run the 32 bit browser without affecting the 64 bit setup. Not gotten across those issues. Will update once through…

  2. Hi,

    I think I have a peculiar problem. I have 64 bit machine running 64 bit Fedora and all the web-browsers are 64 bit. The problem is I have 64 bit Java plugin installed and all the browsers are picking the plugin from the same directory (/usr/lib64/mozilla/plugins/libjavaplugin.so)
    Do you have any workaround for this type of issue?
    Either a way to point my browsers to take 32 bit plugin which is also installed but the browsers are not taking the 32 plugin.
    I tried running the ncsvc from command line, but I get the same error which I get if I use the NC.jar from again command line
    The Error is:
    Failed to connect/authenticate with IVE. Error 2
    Please check the ive hostname/ip and the ive certificate.

    I tried hard since a week to get it done but with complete failure. I dont want to give up though. If you try to help me out I will figure it out and will put all my experience on the net.

    Thanks.

    • I have used 32 bit plugin in most places. Do you have any reason to use the 64 bit plugin? Here is what my directory looks like –

      [/usr/lib/firefox/plugins]$ ls -l libnpjp2.so
      lrwxrwxrwx 1 root root 62 2012-01-23 17:52 libnpjp2.so -> /usr/lib/jvm/ia32-java-6-sun-1.6.0.26/jre/lib/i386/libnpjp2.so

      How do you check if which plug-in is being used by a browser. I can check the same for Opera. I don’t see FF and chromium work. I only see that Opera works. If I know why that is so I can probably have a better understanding.

      As for your issue – I am not sure how to change the search order for plugins. I check the options under about:config and found nothing relevant. I believe your solution should lie in that.

      Let me know if you figure it out.

      thx,
      mynk

      • Thanks for the reply. I dop not have any reason to use 64 bit plugin. But the browsers which I am using are taking the 64 bit plugin. I saw that in Opera. It shows the path of the plugin in use. Hope it is the same for you.
        You have any method to change the same? I feel it is because of this I am not able to start network connect.

  3. @sikku

    If you followed this step –

    $ cd /usr/lib/opera/plugins
    $ sudo ln -s /usr/lib/jvm/ia32-java-6-sun-1.6.0.26/jre/lib/i386/libnpjp2.so

    you should be able to get it work. How are you checking what plugin is installed as in how do you know it is 64 bit? Are you looking at about:plugins? That was blank for me before I ran the steps above. If you see there you can click on disable for the plugins you don’t want opera to use. I see both …opera/plugins & …mozilla/plugins but both of them are 32 bit in my case. I could also disable the …mozilla/plugins if it hindered my use of firefox or other browsers.

    Hope this helps,
    Mynk

  4. There is no directory with:
    $ cd /usr/lib/opera
    bash: cd: /usr/lib/opera: No such file or directory
    I have:
    $ cd /usr/lib64/opera/

    I think you are using 32 bit opera. I guess I have to install 32 bit opera and check if it works.
    In about:plugins I see the path of the plugin, as it points to 64 bit plugin.

  5. I did install 32 bit opera but I uninstalled it as it caused problems. You should have the directory in any case.

    If you have /usr/lib64/opera then create the symlink under that directory. You can always change the sym link to what you prefer.

  6. I removed 64 bit opera and installed 32 bit opera and linked the 32 bit java plugin and then ran the network_connect from the browser link. Initially I got this error “failed to install the Tarantella Client Component”
    Then I remove the directory ~/.tarantella from my home dir and then again tried running. This time I was able to launch SGD successfully. Thanks for your inputs. 🙂

  7. I’m running into similar issues…that’s true Firefox x64 won’t accept to work with the Oracle JRE 32-bit plugin. I tried zillions of combos so far, with no luck.
    Also: Oracle Java is no longer installable via Ubuntu repositories (sudo aptitude) … sun-java6-plugin, sun-java6-jdk, sun-java6-jre, ia32-sun-java6-bin .. gone…
    Maybe I’ll get lucky with Opera, as you did, since I’m also forced to use a 32-bit Ubuntu to get this VPN to work.
    Saying “maybe” because I’m on 10.04 Ubuntu though, not on Mint.
    Cheers!

    • Did this work or you still need help. I know how to get the sun-java installed & there is a reference provided in the post for the same. I tried with Opera and using it as it works for a 64 bit browser. I don’t know if it will fail with FF. I need to try again sometime.

  8. Amit Bhagia

    Guys,

    On 10.7.4 with safari 5.1.7- Juniper network connect client shows up with transparent login and password entry fields. Any fix for this?

    Thanks,
    Amit

  9. After a few days of fighting with Juniper and their lousy client, and the mad scientist script i can finally connect. Thank you….

      • Sorry I didn’t see the question. Let me preface my response by saying I run Gentoo, so it’s a little different. I’m also now having a different problem.

        However, I did discover that Firefox and Chrome do not use 32-bit plugins. So I installed Opera and emul-linux-x86-java-1.6.

        What I had to do to get Opera to load the 32-bit java plugin was to symlink /usr/lib64/jvm/emul-linux-x86-java-1.6/lib/i386/libnpjp2.so to /usr/lib32/nsbrowser/plugins

  10. Thank you so much. I have spent forever trying to get this to work and have tried just about everything but Opera. I thought I had it working except then I got the IVE failed to connect issue.

  11. I got it to work with Oracle Java 7. If you download the 32-bit JRE here: http://www.oracle.com/technetwork/java/javase/downloads/index.html (I used the tarball distribution), unpack the tarball to /usr/lib/jvm, and then simply ln -s sudo ln -s /usr/lib/jvm/ia32-java-7-oracle/lib/i386/libnpjp2.so /usr/lib/opera/plugins/

    This was prompted by an Opera upgrade to version 12 on Linux Mint, when the Java plugin started crashing on network connect. Works with Java 7, though.

  12. Condomitti

    Man, you saved my life! thanks a lot!
    Worked like a charm for me in Opera.

  13. When I run:
    sudo apt-get install ia32-oracle-java7-bin

    It says package not found. It seems the script doesn’t download the 32bit libs. I wonder how you got it installed, because is not listed with synaptic

Mayank Rungta

Leave a Reply to Dodo Cancel Reply