Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am connecting to the system with Putty (this is Windows SSH client) then running some service in interactive personal mode.

For example this is a script to run freeswitch:

dims@nebulla:~$ cat freeswitch.sh
#!/bin/sh
cd ~/bin/freeswitch/bin
gnome-terminal -e ./freeswitch &

I.e. it is installed in user directory.

Also DISPLAY is set to :0

The problem is that I can't use this script until login once.

Script responds with

dims@nebulla:~$ ./freeswitch.sh
dims@nebulla:~$ No protocol specified
Failed to parse arguments: Cannot open display:

After login, I can do "Switch user" and see login screen but script will be able to run since desktop exists.

My question is: is it possible to "preload" my desktop, so that initial situation was as if I loogged in and the went to switch user?

share|improve this question

2 Answers 2

well there is a option of auto login . so that when you switch on that pc it will login automatically .

For GUI you can configure it from system settings -> User accounts.

enter image description here

from Terminal do this

gksudo gedit /etc/lightdm/lightdm.conf 

the you will get

[SeatDefaults]  
greeter-session=unity-greeter  
user-session=ubuntu  
autologin-user=username

There at the username , put your user name . then save and close it . to apply changes restart your system or relogin .

Hope that helps.

share|improve this answer
    
Won't this make the system unprotected? Anybody came to desktop will see it opened. Also credentials will be stored in lightdm.conf unencrypted. I meant is it possible to preload desktop without entering a password explicitly as it done with VNC virtual desktops for example. –  Dims Dec 1 '12 at 12:31

ican's answer is totally correct. However, I think your aiming for the wrong goal. I am not sure what freeswitch is so I am going to remove it, and use gedit.

First, Linux is way more "network oriented" then windows. This is true right down to the gui level. X windows, is a network protocol. You can run one of several X servers on windows and then use putty to connect to your Linux box and run gedit. The window would then appear on your windows box as if you where running it natively.

Another option that is very similar, but good if you want to support running gedit full time is Xvnc. You can start a vnc server (that you connect to from windows). This will give you a totally independent DISPLAY to run gedit on. Xvnc can start as a server, as a particular user, and auto execute some commands. This will help you get started in that direction, but will take a bit of research. I suspect the is the solution you want.

A third solution is XDMCP. This protocol allows you to login to an entire X session from a remote X server. Basically you would connect to the "login screen" from your windows box and go from there. This page is a good start for XDMCP

A forth solution is to launch X then run your script inside it. This would give you a "special" Desktop that you could use for just that application. This would not "break" your normal install or login, but would separate out your application. A quick example script would be...

#/bin/bash
sudo X :2 &
sleep 5 # wait for X to start up
export DISPLAY=:2 # set the X display
metacity --replace # start a window manager (this may not be installed)
gedit # run the actual program

Of note is that the forth example can be used in Xvnc or XDMCP sessions as well.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.