Earlier in this forum it is stated that it is currently not possible to pre-fill host name and port in Vine Server. However a workaround using developer tools is described. But as I understand it, it is possible to use command line arguments with Vine Server. Would it be possible to write a shell script that initiated a reverse connection to a specific listening client? And if so, how?
‘:)’
Vine Server is comprised of two pieces. A GUI front end which let’s users specify preferences and a back end, old-fashioned command-line server that actually does the screen serving.
The command-line server is located “inside” the application and is called OSXvnc-server. Usage arguments are documented in the User Manual, or call the server with --help. To initiate a reverse connection you use
-connectHost host
I’m sorry, but my knowledge of how to actually use these commands in a shell script is rather limited. But I am willing to learn, and the best way to do that is by following a live example. So what I was hoping for was to be told exactely what to type in terminal to execute the commands, and also an example shell script…
:oops:
Ok, now I get it. And for others wondering about how to make use of the command line arguments, the key is to get the path to the command line server inside the Vine Server package into terminal: Right-click on the Vine Server app, and choose Show Package Contents. Navigate into Contents/MacOS. Drag OSXvnc-server onto an open terminal window, and the path will appear. Append your argument to the string.
Example:
Last login: Wed Dec 13 23:55:52 on ttyp2
Welcome to Darwin!
No1:~ username$ /Applications/VNC/Vine\ Server.app/Contents/MacOS/OSXvnc-server -connectHost 10.0.0.3 -connectPort 5905
This will silently launch a reverse connection to a listening client with IP 10.0.0.3 on port 5905.
The string can be put into a shell script (a text file with extension .command, and with read/write permission for the owner, and read permission for others):
#!/bin/sh
/Applications/VNC/Vine\ Server.app/Contents/MacOS/OSXvnc-server -connectHost 10.0.0.3 -connectPort 5905
This way all your help-needing friend have to do to start a reverse connection to you, is to double-click the shell script you (earlier) have made on his desktop. :mrgreen:
On thing I haven’t figured out yet, is how to terminate the server without having to quit it in the Activity Monitor… Any suggestions?
Just a quick note to my own posting above. The shell script file has to be made executable:
In the terminal window, write
CHMOD 755
and then drag and drop the textfile into the terminal window and hit the enter key. This makes the file an executable file with read-write permission to the owner, and read permission to others. You have to be logged in as an administrator for it to work.
Jon,
Thanks for posting the very helpful information! I just noticed one small typo in the last message: I believe it should be ‘chmod’ rather than ‘CDMOD’
Thanks again!
Ooops. Ofcourse. :roll: