WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [SOLVED] rdesktop on startup  (Read 7855 times)

Offline Rdesk

  • Newbie
  • *
  • Posts: 13
[SOLVED] rdesktop on startup
« on: February 24, 2011, 10:19:01 AM »
Hello,

Im trying to boot directly to rdesktop, i have remastered Tinycore and added rdesktop, openssl and glibc_gconv.
I did remaster it like its discribed in the wiki " http://wiki.tinycorelinux.com/Remastering " and put the extensions in the /tmp/tce/optional folder like discribed in the wiki.
The Image boots and the extensions work right.
 
Here is my Problem, i want to start rdesktop only, not get through to the desktop.
I made a script in the .X.d folder but nothing happens.
In the remaster process i need to create the .X.d folder under /home/tc, is that right?

Thank you!
« Last Edit: March 19, 2011, 01:35:42 AM by Rdesk »

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4223
Re: rdesktop on startup
« Reply #1 on: February 24, 2011, 02:03:18 PM »
Hi Rdesk
As far as I know when X starts it runs any files found in that directory.
I did notice an /etc/skel/.X.d directory, maybe it belongs there.
Did you remember to make the script executable? Does it run if you
invoke it from the command line?

Offline Rdesk

  • Newbie
  • *
  • Posts: 13
Re: rdesktop on startup
« Reply #2 on: February 24, 2011, 09:10:26 PM »
 ::) Didnt checked the file permissions.

Now it runs in the command line ;). I will make a complete remaster later today to check if it does function on boot, which i think it will.

Howsoever many thanks to you Rich!!

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4223
Re: rdesktop on startup
« Reply #3 on: February 24, 2011, 10:39:41 PM »
Hi Rdesk
Glad I could help. Maybe when you have it sorted out you can post where you placed
the script to help others in the future and add [SOLVED] to the title of this thread.

Offline maro

  • Hero Member
  • *****
  • Posts: 1229
Re: rdesktop on startup
« Reply #4 on: February 25, 2011, 09:37:44 PM »
I'm not quite sure that using a startup file in '~/X.d' is the best approach if you also " ... want to start rdesktop only, not get through to the desktop ...". Using the '~/X.d' mechanism is more geared towards starting a GUI application after the "desktop" (e.g. the WM like 'flwm_topside' and potentially 'wbar') are already up and running.

There is an earlier thread where some aspects of starting an application automatically and how to "secure" the system from its user were discussed.

Offline Rdesk

  • Newbie
  • *
  • Posts: 13
Re: rdesktop on startup
« Reply #5 on: February 26, 2011, 02:01:58 AM »
You are right the .X.d directory starts X-apps after the start of the WM.

In the post #6 in the other thread you said that you can change the boot code in .xsession.
So what i understand is that i need to change "$DESKTOP" 2>-tmp etc into "$DESKTOP=rdesktop" ? is that right?

I dont need to change the ability of the user to crash the xserver or get to the terminal session, i just want to start rdesktop before any WM starts.

Thank you for any advice

Offline maro

  • Hero Member
  • *****
  • Posts: 1229
Re: rdesktop on startup
« Reply #6 on: February 26, 2011, 07:12:15 PM »
... So what i understand is that i need to change "$DESKTOP" 2>-tmp etc into "$DESKTOP=rdesktop" ? is that right?
NOPE!! The environment variable $DESKTOP contains the name of the WM. It's value will be determined by the '/etc'sysconfig/desktop' file (with a default value of 'flwm_topside'). Alternatively one could use the 'desktop=WM-NAME' boot code to change the value in '/etc'sysconfig/desktop' (and hence the WM).

Quote
I dont need to change the ability of the user to crash the xserver or get to the terminal session, i just want to start rdesktop before any WM starts.
I get the impression you don't understand what a WM does (you might want to have a quick look here), and are confusing it with the function of the X server. The minimal requirement for 'rdesktop' to run would be a running X server.

I can't see any point why one would like to start a GUI application (like 'rdesktop') before the WM gets started (via $DESKTOP" 2>/tmp/wm_errors in '~/.xsession') as compared to using the already provided '~/X.d' mechanism. The startup time of the default WM (plus potentially 'wbar') is so small that I don't see the point. OTOH I can understand that someone would like to operate in a kiosk mode (i.e. just run one specific GUI application instead of a WM which would allow to start multiple applications). So if one is happy enough to "shake things up" one could replace all but the first two lines of '~/.xsession' (or rather '/etc/skel/.xsession' in the case of a remastering) with the startup command sequence of the intended GUI application.

As I explained in the other thread I'm not a user of 'rdesktop' but after running a quick "30 second test" I'm now certain that the 'desktop=rdesktop' suggestion won't work. The reason is that the 'rdesktop' command actually needs at least a SERVER parameter to work (and that can't be supplied via the current way of executing $DESKTOP in '~/.xsession'). But if one is prepared to install the 'xdrdesktop.tcz' extension instead (or rather in addition) of 'rdesktop.tcz' the "trick" via a boot code (i.e. 'desktop=xdrdektop') without the need to make changes to other files should work OK. It might be worth to also add the 'noicons' boot code, to prevent the running of 'wbar'.

Furthermore the need to specify a SERVER parameter when executing 'rdektop' means that one would have to be hard-coded somewhere in the remastered initrd (either via '~/.X.d' or via '.xsession'). That might be OK if there is only ever one server one wants to connect to. Using 'xdrdesktop' instead would make things more flexible, or a custumised '/etc/skel/.rdesktop/xdrdesktop' could be included in the remastered initrd that contains some sane default values (e.g. some servers to choose from).

Offline Rdesk

  • Newbie
  • *
  • Posts: 13
Re: rdesktop on startup
« Reply #7 on: February 28, 2011, 03:18:19 AM »
I did get it to work now. I changed the lines in the .xsession after the x-server is loaded with "exec xdrdesktop".
I now got xdrdesktop started right after the x-server is loaded on boot.

But 2 questions remain for me...

First and more important how to cutomize or create /etc/skel/.rdesktop/xdrdesktop to create some server and other values for xdrdesktop?

Second, how can i just start rdesktop without xdrdesktop to connect right into an rdp-connection after x-server has started.
I tried to modify the .xsession with /usr/local/bin/rdesktop -f IP but it didnt worked. Is there a parameter which i could use with xdredesktop to start right into a rdp-session?
I know its less flexible, but i want that users who arent familiar with xdrdesktop can just load the image of TC and be connected to the remote machine.

Thank you for any advice
« Last Edit: February 28, 2011, 11:38:43 AM by Rdesk »

Offline Rdesk

  • Newbie
  • *
  • Posts: 13
Re: rdesktop on startup
« Reply #8 on: March 12, 2011, 01:31:41 AM »
I got it to work now. If you want to start rdesktop to an specific ip right after the x-server loaded and before any WM you have to modify your .xsession like this:

sleep 5
/usr/local/bin/rdesktop -f ip
exec exittc

the sleep 5 timer was the trick for me. Seems like the network connection needs a little time to establish the link before you can connect to a remote desktop.

exec exittc is to shutdown the pc after you are done with the remote desktop session. So when you press esc you see a small window with shutdown and reboot options.

Thanks for any help!