Help starting Vine server on login screen via SSH

I have tried in SSH from the vine server directory:

./Contents/MacOS/OSXvnc-server -rfbport 5901 -rfbnoauth

Screen Format not supported.

./Contents/MacOS/Vine\ Server -rfbport 5901 -rfbnoauth

FAILED to establish the default connection to the Window server

Any suggestions?

Thanks — Sophie

When launching from a non-gui session (like an SSH login) You will need to launch your server as Root to gain access to the Console (Primary display).

So use the first command with sudo and then enter your password (assuming you are an administrator).

./Contents/MacOS/OSXvnc-server -rfbport 5901 -rfbnoauth 

I tried adding the sudo, enter password, and after a couple of “Loading bundle…” I get:

Mon Sep 15 08:00:36 mini.local OSXvnc-server[197] : 3891612: (connectAn dCheck) Untrusted apps are not allowed to connect to or launch Window Server bef ore login.
2008-09-15 08:00:36.263 OSXvnc-server[197:a0b] screen format not supported.

Using 3.0 Vine + Leopard.

Am I doing something wrong?

Thanks … Sophie

To launch Vine Server before ANY user has logged in on 10.5 you MUST use LaunchD. That is what the System Server does for you when you configure it with the Vine Server GUI. To do that from the command line (via SSH) you will need to upload a Launch Agent configuration file and then use the launchctl command.

/bin/launchctl load -S LoginWindow /Library/LaunchAgents/com.redstonesoftware.VineServer.plist

Attached is a SAMPLE file that you should modify based on your needs and place in /Library/LaunchAgents
You can pull this file to your remote machine with CURL:

curl http://www.redstonesoftware.com/phpBB2/files/com.redstonesoftware.vineserver.plist -o /Library/LaunchAgents/com.redstonesoftware.vineserver.plist

I tried this, the launchctl gives no error, but I get a “unable to connect - connection refused” when I try to vnc in.

It works fine if I have started the System Server. But if I have not, I cannot seem to get it started via ssh.

Thanks for any and all help … Sophie

Strange, that worked in my test here – in addition to the command above try also issuing

/bin/launchctl load -S Aqua /Library/LaunchAgents/com.redstonesoftware.VineServer.plist

Warning: that sample plist has typos in it. The correct string to the app should be:

/Applications/Vine Server.app/Contents/MacOS/OSXvnc-server

That will get you to the login screen but at least for me kills the VNC session after you log in. You have to wait about 20 seconds for launchctl to restart Vine automatically; you can watch it happen in /var/log/system.log

Thank you for pointing out the typo - that correction has been uploaded.

You are correct that after logging in the server must restart to provide access to the new user session.

See ChinaUnix above a users post, like in linux when to use ssh login without a password each time, they can not use the key way.
Web search for a moment, there are users expect to write with an automatic logon script, but after I tried, but found that can not be used.
Then to see people that use sshpass can solve the problem. So, if you write a script. Script written in simple, do not consider security issues. To use this script to install sshpass the software.
sshlogin.sh:
#! / Bin / bash
#================================================= ==============================

FILENAME:

Sshlogin.sh

DESCRIPTION:

Script to use user and password from config file to login remote

Ssh server.

This script needs 1 argument to login the remote ssh server:

Ipaddr = IP Addreess of remote ssh server.

For example:

#. / Sshlogin.sh 192.168.0.1

You need to create a config file (pass.dat) with entries like:

Server1 | user | password

Server2 | user | password

REVISION (MM / DD / YYYY):

07/01/2009 Shengkui Leng (shengkui.leng @ advantech.com.cn)

- Initial version

#================================================= ==============================
#------------------------------------------------- -----------------------------

NAME:

Print_usage

DESCRIPTION:

Print usage information

PARAMETERS:

$ 1 - Program name

RETURNS:

None

#------------------------------------------------- -----------------------------
print_usage ()
(
echo “Usage: $ 1”
exit 1
)
[$ #-Eq 1] | | print_usage $ 0
CONFIG_FILE = pass.dat
SERVER = $ 1
ipaddr = “”
username = “”
password = “”
found = 0
while read line; do
ipaddr = $ (echo $ line | cut-d ‘|’-f1)
username = $ (echo $ line | cut-d ‘|’-f2)
password = $ (echo $ line | cut-d ‘|’-f3)
if ["$ SERVER" == “$ ipaddr”]; then
# The server found!
found = 1
break
fi
done <$ CONFIG_FILE
if [$ found-eq 0]; then
echo “The server not found!”
exit 2
fi
if [-z “$ password”] | | [-z “$ ipaddr”] | | [-z “$ username”]; then
echo “Invalid config file: $ CONFIG_FILE!”
exit 3
fi
echo “Logining (ssh) $ username @ $ ipaddr …”
sshpass-p “$ password” ssh $ username @ $ ipaddr
exit 0
In addition to a record passwords, user names and ssh server IP file pass.dat:
pass.dat:
192.168.0.1 | root | a123B56
192.168.0.2 | root | 7X890Yz
Another problem is that if the first login with ssh when a particular server, ssh will prompt:
The authenticity of host '192 .168.0.1 (192.168.0.11) 'can’t be established.
RSA key fingerprint is 7b: b9: c3: cd: 01: cd: 2f: 19:4 e: 96: d3: 66:27:55:7 f: 65.
Are you sure you want to continue connecting (yes / no)?
The above script does not deal with this situation, interested friends, try to improve what it can own.