Elsinore

User Forum

www.screenconnect.com
Welcome Guest Search | Active Topics | Log In | Register

Tag as favorite
need help on linux unattended install
blkfin
#1 Posted : Friday, August 26, 2011 9:12:35 PM
Rank: Newbie
Joined: 8/26/2011
Posts: 3
Greetings

We are attempting to install the an unattended instance on Ubuntu 10.10.

This is our specific need for this product.

I have read the couple of entries but have some more questions:

at this point we have

1. installed java6-jre
2. created /var/lib/screenConnectGuestClient

so we have set the JAVA_HOME in the sc.sh file

# Set this to your Java installation
JAVA_HOME=/usr/bin/java

the assumptions are that the only other edits to be made are on lines 44 - 47

# Change these based on your ScreenConnect installation and how you want the client configured
scRelayHost="MY_DNS.com"
scRelayPort="8041"
scEncryptionKey="????????"
scSessionTitle="%LOGNAME%"

scRelayHost,scRelayPort, & scSessionTitle are all fine.

the question is how and where do we find the scEncryptionKey?

additionally, reviewing http://forum.screenconne...9_Linux-Unattended.aspx

it states "The two JAR files and this script should be copied to "/var/lib/screenConnectGuestClient/"

What two jar files?

And finally can we have a little more detail on actual command line to complete the following instructions

1. "After copying to that directory, you'll need to create a symbolic link from under init.d to the sc.sh file. "

2. "Then use insserv to add it as a service."

3. "Then use another tool to configure it to start at startup."


Thanks In Advance

Jim


Jake Morgan
#2 Posted : Friday, August 26, 2011 10:34:41 PM
Rank: Administration
Joined: 4/9/2010
Posts: 859
Great to hear we have a guinea pig! We tested this internally, and we've had customers implement linux unattended, but they never report back.

Quote:
the question is how and where do we find the scEncryptionKey?


Do an attended session on that machine that delivers the JNLP file with the Java client. This has the encryption key as an argument. You'll see it; it's the long base64 encoded string.

Quote:
it states "The two JAR files and this script should be copied to "/var/lib/screenConnectGuestClient/"


Elsinore.ScreenConnect.Core.jar and Elsinore.ScreenConnect.Client.jar are in the Bin directory of your installation. You'll also see them referenced in this JNLP file.

Quote:
1. "After copying to that directory, you'll need to create a symbolic link from under init.d to the sc.sh file. "


/etc/init.d is a directory. I'd create the sc.sh in there as a symbolic link to the instance at /var/lib/screenConnectGuestClient/sc.sh

Quote:
2. "Then use insserv to add it as a service."


http://manpages.ubuntu.c...rdy/man8/insserv.8.html

You run insserv with the script as an argument. Like this:

Code:
insserv /etc/init.d/sc.sh


Quote:
3. "Then use another tool to configure it to start at startup."


You know, I'm not sure what I meant by this. I think each distro may have a different way of specifying when services are supposed to run. Quite honestly, I had hoped someone who really knew linux would chime in and tell me all the things we did wrong ;)
blkfin
#3 Posted : Monday, August 29, 2011 3:52:18 PM
Rank: Newbie
Joined: 8/26/2011
Posts: 3
Ok here is our findings so far....

with the included errors....

$ pwd
/var/lib/screenConnectGuestClient
$ ls -ald *
-rwxr-xr-x 1 root root 68110 2011-07-22 10:20 Elsinore.ScreenConnect.Client.jar
-rwxr-xr-x 1 root root 112239 2011-07-22 10:19 Elsinore.ScreenConnect.Core.jar
-rwxrwxrwx 1 root root 7682 2011-08-29 10:09 sc.sh


run from command line:

sudo ./sc.sh
sudo: unable to execute ./sc.sh: No such file or directory


run from command line with java path:

$ pwd
/var/lib/screenConnectGuestClient
$ sudo /usr/bin/java ./sc.sh
Exception in thread "main" java.lang.NoClassDefFoundError: //sc/sh
Caused by: java.lang.ClassNotFoundException: ..sc.sh
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: ./sc.sh. Program will exit.



Not sure where to go from here .

Thanks

Jim
Jake Morgan
#4 Posted : Monday, August 29, 2011 4:07:45 PM
Rank: Administration
Joined: 4/9/2010
Posts: 859
I think you'll need to leave JAVA_HOME to be "/usr"

In the script it shows:
Code:
javaExe="$JAVA_HOME/bin/$javaCommand"                      # file name of the Java application launcher executable


So it appends /bin/$javaCommand
Jake Morgan
#5 Posted : Monday, August 29, 2011 6:07:42 PM
Rank: Administration
Joined: 4/9/2010
Posts: 859
Even with that java fix, I'm not sure the script will work by executing it directly. initd passes various arguments to control the service. You'll need to register the script with initd to get everything working.
blkfin
#6 Posted : Thursday, September 01, 2011 5:45:55 PM
Rank: Newbie
Joined: 8/26/2011
Posts: 3
Ok so after a couple of days we have settled on a hybrid fix that appears to be working.

We have not been able to get the daemon running consistently.

So I thought I would post here what we have done so to help anyone else that me need it.


Ubuntu 10.10


install java6 jre

$ sudo add-apt-repository ppa:sun-java-community-team/sun-java6
$ sudo apt-get install sun-java6-jre

Then via firefox we connect to our SC host.

http://xx.xx.xx.xx:8040

we set up a public session to connect to.

after the initial connection and the Elsinore.ScreenConnect.Client.jnlp download we disconnect.

now we go into the firefox downloads directory and copy the Elsinore.ScreenConnect.Client.jnlp to another directory (i.e. /bin).

We then edit the Elsinore.ScreenConnect.Client.jnlp file changing two arguments

line 15 - the session identifier ( looks like <argument>bb4a62f2-bf52-4ff7-9fe6-aeccaa9b2b5f</argument>

change it to : <argument>00000000-0000-0000-0000-00000000000</argument>

also change line 18 <argument>THIS.IS.YOUR.HOSTID</argument>

change it to the Server Name so you can keep them straight <argument>SERVER.NAME</argument>

I then chmod 755 and dos2unix the the file

$ sudo chmod 755 Elsinore.ScreenConnect.Client.jnlp
$ sudo dos2unix Elsinore.ScreenConnect.Client.jnlp

Then right click the file and "execute", make sure you choose "Java 6 web start" as the application.

You will now be connected.

So now the challenge was to get it to autostart.

So what I did was write a quick bash script to run at startup.

sc2.sh

#!/bin/bash
createSC() {
/usr/bin/javaws -Xnosplash FULLPATHTO/Elsinore.ScreenConnect.Client.jnlp
if [[ $? -eq 0 ]]; then
echo Screen Connection created successfully
else
echo An error occurred creating connection
fi
}
if ps ax | grep -v grep | grep -c "FULLPATHTO/Elsinore.ScreenConnect.Client.jnlp" > /dev/null
then
echo "SC service running, everything is fine"
exit
else
echo Creating New Remote Connection
sleep 90
createSC
exit
fi


put it in the /bin directory with the .jnlp file

I then chmod 755 and dos2unix the file

$ sudo chmod 755 sc2.sh
$ sudo dos2unix sc2.sh


PLEASE NOTE: I put an 90 sec delay before it starts the java connect so the server has time to connect to the internet, if it is not connected it will fail. So there will be a delay before you see the connection dialog on the server.


Finally I put the sc2.sh in the startup session

again using Ubuntu 10.10 with Xfce interface

Applications >> Settings >> Xfce 4 Settings manager >> Session and Startup

Choose "Application Startup Tab"

Click "Add"

>> Name: "ScreenConnect"

>> Command : Browse to your "sc2.sh" file (NOT THE .JNLP FILE)

Click OK >> Close

Now reboot. 90 seconds after the desktop shows you should see the connection dialog and also see the SERVER.NAME on your Screen Connect Console under "Unattended"

Now after every reboot the system will come back up and connect to the SC Console.

So I hope this helps anyone using Linux.

Of course if someone gets the daemon piece running please lets know.

Thanks and Good Luck

Jim


EDIT: I have been able to replicate this on 6 servers so far without issue






wavesound
#7 Posted : Friday, November 25, 2011 8:18:01 PM
Rank: Member
Joined: 11/25/2011
Posts: 18
Any updates on this issue? We're considering ScreenConnect, but unless we can run unattended sessions on Ubuntu, I think we may have to reconsider...
Jake Morgan
#8 Posted : Saturday, November 26, 2011 11:52:31 PM
Rank: Administration
Joined: 4/9/2010
Posts: 859
We have quite a few customers using a variant of this solution here:
http://forum.screenconne...9_Linux-Unattended.aspx

ScreenConnect runs fine; it's just a matter of getting the startup configured correctly.
Users browsing this topic
Guest
Tag as favorite
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.