Not able to connect to Juniper VPN on Lubuntu 13.04

6,695

Solution 1

If You got Juniper SA older than 7.3, then You need to install both 32 and 64 bit. You need to launch java 32 bit to run network connect.

You need to install libxtst6:i386 package to run 32bit version of java on 64 bit system:

sudo apt-get install libxtst6:i386 libxrender1:i386 libxi6:i386 libncurses5:i386 libncursesw5:i386 libncurses-ruby:i386

(if it fails, then install whole ia32-libs package).

install 64 bit version in /usr/lib/java/jre/

install 32 bit version in /usr/lib/java32/jre/

then do following:

sudo mv /usr/lib/java/jre/bin/java{,.orig}

sudo gedit /usr/lib/java/jre/bin/java

file should look like this:

#!/bin/bash
if [ "$3" = "NC" ]
then
  /usr/lib/java32/jre/bin/java "$@"
else
  /usr/lib/java/jre/bin/java.orig "$@"
fi

Then You need to make it executive:

sudo chmod +x /usr/lib/java/jre/bin/java

Then use update-alternatives to install appropriate version of java:

sudo update-alternatives --install /usr/lib/mozilla/plugins/libnpjp2.so java_plugin /usr/lib/java/jre/lib/amd64/libnpjp2.so 10
sudo update-alternatives --install /usr/bin/java java /usr/lib/java/jre/bin/java 10
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/java/jre/bin/javaws 10

If You have encrypted home folder, since 13.04 there is nosuid added to mount options, so You can move .juniper folder outside of encrypted home, ie: /opt an the create a symlink:

cd ~
mv .juniper /opt
ln -s /opt/.juniper .

Determine if You have installed java plugin in Firefox (in add-ons -> plugins). If So, You should be ready to go.

I took recipe from that page: http://ubuntuforums.org/showthread.php?t=232607&page=51

But if You want to run openjdk, then follow those steps:

sudo apt-get install openjdk-7-jre icedtea-7-plugin openjdk-7-jre:i386 ia32-libs
sudo mv /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java{,.orig}
sudo gedit /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java

It shoul look like this:

#!/bin/bash
if [ "$3" = "NC" ]
then
  /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java "$@"
else
  /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java.orig "$@"
fi

Make it executive:

chmod +x /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java

So far it worked for me.

Regards,

Mario.

Solution 2

This is what I got to work on my Ubuntu 13.10 machine...

sudo apt-get install openjdk-7-jre icedtea-7-plugin

sudo apt-get install openjdk-7-jre:i386

At this point /usr/bin/java links to /etc/alternatives/java and that links to /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java. So now we can replace the first java link with a script:

cd /usr/bin

sudo mv -f java java.orig

sudo vi java

Insert these lines;

\#!/bin/bash
if [ "$3" = "NC" ]
then
  /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java "$@"
else
  /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java "$@"
fi

Save the file and exit vi

sudo chmod +x java

I don't know if this is needed or not, but I did it. Optional other links in /usr/bin to replace with scripts in same fashion as above

javac, javadoc, javah, javap, javaws

For the java plugin to firefox/mozilla point to the 64 bit version from the www.java.com installation directory. For me this was /usr/java/jre1.7.0_51

cd /usr

sudo mkdir java

cd java

sudo tar zxvf ~/Downloads/jre-7u51-linux-x64.tar.gz

cd /usr/lib/mozilla/plugins

sudo ln -s /usr/java/jre1.7.0_51/lib/amd64/libnpjp2.so

Restart the browser to pick up the plugin change.

Share:
6,695

Related videos on Youtube

China Diapers
Author by

China Diapers

Updated on September 18, 2022

Comments

  • China Diapers
    China Diapers almost 2 years

    I am using Lubuntu 13.04. Tried this with Chrome, Firefox and Epiphany with the same result.

    1. I log into my VPN webpage
    2. Click start to open a connection.
    3. Window pops up asking me if I want to install the jar file -> I click yes
    4. Terminal pops up asking me for root password which I enter
    5. Progress bar updates momentarily when it seems to time out and I am returned to step 2
    6. I click start again and the progress bar continues where it left off, repeat this a few times
    7. Eventually progress reaches end of bar but nothing happens
    8. If I ping the machine I am trying to connect to the machine is not found
    9. I don't see the VPN in my list of connections

    I have tried the steps outlined by Mad Scientist at http://mad-scientist.us/juniper.html but it does not connect either (status show "connecting" for a second then "disconnected"), but I think something fundamental is going wrong before this stage anyway.

    Any ideas?

    *UPDATE***

    According to the Juniper site from 7.3 onwards, Juniper SA devices support 64-bit Ubuntu for Network Connect:

    "A native 64-bit VPN Tunneling client is not yet available. Instead, changes in the existing 32-bit client were made so that it can be run on 64-bit platforms. Because of this, VPN Tunneling has dependencies with 32-bit Java and 32-bit standard libraries even when running on a 64-bit platform." - http://www.juniper.net/techpubs/en_US/sa7.3/topics/reference/general/secure-access-nc-64-bit-linux-support.html

    So apparently the answer is to install the 64bit jre/jdk and icedtea then install the 32bit jre:

    sudo apt-get install openjdk-7-jre icedtea-7-plugin sudo apt-get install openjdk-7-jre:i386

    I wiped my drive, reinstalled and tried the above without success. After entering my root password I would expect something to happen notifying me I am connected to the vpn, but as I said I keep getting returned to the page with the start button and if I keep clicking this eventually the progress completes but no notification that I am connected and I am unable to ping the machine.

    That being said if I log out and back into the vpn website I get a message that another session is in progress. However if I type 'mcli con' in the terminal (not sure if this is the best command to use) I don't see any VPN connection

    I have verified on Java.com that Java 7 64 bit is my default.

    • karan
      karan about 11 years
      Can you please tell me which version of Java you are running?
    • China Diapers
      China Diapers about 11 years
      I am using Java 7
    • David Edwards
      David Edwards about 11 years
      Are you using a 64-bit or 32-bit install? See the top answer here askubuntu.com/questions/136194/juniper-setup-on-12-04
    • China Diapers
      China Diapers about 11 years
      I am using 64 bit Lubuntu if that's what you mean. Thanks will check out the link
    • China Diapers
      China Diapers about 11 years
      See update to original post
    • China Diapers
      China Diapers about 11 years
      This is killing me!
    • Braiam
      Braiam almost 11 years
      Please include those steps as answer instead of leaving it in the question, so it can be voted.
  • mason81
    mason81 over 10 years
    This was a huge help! I've tried numerous other methods of getting Juniper VPN NC to work on Ubuntu 64bit, but this was the only one that worked for me. Thank you!
  • Joost Van Durme
    Joost Van Durme over 10 years
    I'm using Mint 16 based on 13.10 but it doesn't completely work. The NC applet appears but suddenly disappears again. Before that I'm getting the question to be sure that the 32 bit libraries are installed. So i got further then before I did all this. Before the NC applet did not appear at all. Do you happen to know why the NC applet disappears again?
  • Ken Williams
    Ken Williams almost 10 years
    people who are downvoting: please say why.