LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-29-2010, 03:49 PM   #1
goosezor
LQ Newbie
 
Registered: May 2010
Posts: 9

Rep: Reputation: 0
RDP Capability Needed


I am looking to setup some computers as thinclients to connect to my MS Terminal Servers. We have a homebrew application that configures RDP sessions. A user logs into a webpage that dynamically generates a "launch.rdp" file. This file is generated to balance the load between servers.

What I'd like to do is configure an image to boot up into Mozilla. When the user goes to the webpage, I'd like the launch.rdp file to open up in a terminal server session.

I've tried with rdesktop and tsclient, but unfortunately neither would work with a "rdp" file. Any help or suggestions are appreciated. Thanks!
 
Old 05-29-2010, 06:53 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hi,

Welcome to LQ!

Any chance of seeing one of those RDP files?



Cheers,
Tink
 
Old 05-29-2010, 08:15 PM   #3
goosezor
LQ Newbie
 
Registered: May 2010
Posts: 9

Original Poster
Rep: Reputation: 0
It's just a normal RDP connection file. Here is an example:

Code:
screen mode id:i:2
desktopwidth:i:1280
desktopheight:i:1024
session bpp:i:24
winposstr:s:2,3,0,0,800,600
full address:s:172.16.0.117
compression:i:1
keyboardhook:i:2
audiomode:i:0
redirectdrives:i:1
redirectprinters:i:1
redirectcomports:i:0
redirectsmartcards:i:1
displayconnectionbar:i:1
autoreconnection enabled:i:1
username:s:User
domain:s:America
alternate shell:s:
shell working directory:s:
disable wallpaper:i:0
disable full window drag:i:0
disable menu anims:i:0
disable themes:i:0
disable cursor setting:i:0
bitmapcachepersistenable:i:1
 
Old 05-30-2010, 04:05 AM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
I'll hazzard a guess and say that you'll have to write a wrapper
in e.g., perl, around this. Linux' rdesktop program doesn't know
what an rdp file is (is meant to be). A wrapper could parse the
values out of the rdp file and pass them as command-line parameters
to rdesktop (some of them, anyway; not sure rdesktop can make
sense of all of them).


Cheers,
Tink
 
Old 05-30-2010, 02:16 PM   #5
goosezor
LQ Newbie
 
Registered: May 2010
Posts: 9

Original Poster
Rep: Reputation: 0
Do you have any idea how I could write a wrapper? I was able to write a small launch script to open an RDP session:

Code:
#!/bin/sh
/usr/bin/rdesktop -d DOMAIN -g 1024x768 172.16.10.117
The only thing that I'd really need to pull out of the .rdp file is the address string.
 
Old 05-30-2010, 02:35 PM   #6
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
Heres a start for you:

Code:
#!/usr/bin/env perl
#

use warnings;
use strict;

open RDP, "./rdp_file";

my $vals = {};

while( <RDP> ) {
    my @line = split ":", $_;
    my ( $label, $type, $value ) = @line;

    # Put something in here if you want to double check that
    # $value is of type $type. Look at ref()

    $vals->{ $label } = $value;
}

close RDP;

# Here you interact as per the convention
# print $ref->{"name of the arg you want"}

print $vals->{"username"};
 
Old 05-30-2010, 03:09 PM   #7
goosezor
LQ Newbie
 
Registered: May 2010
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks for the reply James, looks very promising. Where would I plug in my variables though?
 
Old 05-30-2010, 03:16 PM   #8
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
Sorry, I should have explained it.

That one there is reading from a file called 'rdp_file' and attaching it to the file handle 'RDP'.

It all depends on how the script is going to react with the dynamic launch.rdp file; or at least how it gets a copy of it. You could add the functionality for this to grab a copy of this over http (http://search.cpan.org/~gaas/libwww-...836/lib/LWP.pm or even better http://search.cpan.org/~gaas/libwww-.../LWP/Simple.pm) and then instead of reading from a file splitting it by line into an array and doing the same operation
 
Old 05-30-2010, 03:22 PM   #9
goosezor
LQ Newbie
 
Registered: May 2010
Posts: 9

Original Poster
Rep: Reputation: 0
I guess I'm hoping to do this as simplistic as possible. If I could just get the script to look through the launch.rdp file, pull out the address, and then add it to the rdesktop command that would be perfect.
 
Old 05-30-2010, 03:24 PM   #10
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
Well if the launch.rdp is dynamic, you want the script to get the file, pick it out, and start up. Give me a few mins to start a similar environment on my test rig and I'll give you something you can use
 
Old 05-30-2010, 03:29 PM   #11
goosezor
LQ Newbie
 
Registered: May 2010
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks James. The RDP file is dynamically generated, and the only variable that changes is the server address.
 
Old 05-30-2010, 03:35 PM   #12
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
Code:
#!/usr/bin/env perl
#

use warnings;
use strict;
use LWP::Simple;

my $rdp_file = get( "http://localhost/rdp_file" );
my @rdp_arr = split "\n", $rdp_file;

my $vals = {};

foreach ( @rdp_arr ) {
    my @line = split ":", $_;
    my ( $label, $type, $value ) = @line;

    $vals->{ $label } = $value;
}


# Here you interact as per the convention
# print $ref->{"name of the arg you want"}

print $vals->{"username"};

# You must uncomment the line below and fill out args in that
#system( "rdesktop " );
Just change the get() call to wherever your users nav to when they want the dynamic file.
 
Old 05-30-2010, 07:32 PM   #13
goosezor
LQ Newbie
 
Registered: May 2010
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks again James. Can you take me through what this script is doing? Also I copied it down, but I am getting an error when executing. It says "Use of uninitialized value in print at line 23".

PS - If it helps the line that I need to pull out of the rdp file is "full address:s:172.16.0.117". Thank you again.
 
Old 05-30-2010, 07:41 PM   #14
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
Okay, have you changed the line
Code:
my $rdp_file = get( "http://localhost/rdp_file" );
to reflect the website which returns the dynamic page you need?
 
Old 05-30-2010, 08:06 PM   #15
goosezor
LQ Newbie
 
Registered: May 2010
Posts: 9

Original Poster
Rep: Reputation: 0
Yes, it's pointed to the RDP file on the webserver.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RDP printing thunyiwe Linux - General 1 03-31-2010 09:17 PM
Open Suse11 Ralinkusb and or Atheros wireless capability needed please Wareagle3 Linux - Newbie 11 12-02-2008 06:58 AM
Open Suse11 Ralinkusb and or Atheros wireless capability needed please Wareagle3 Linux - Newbie 1 11-29-2008 06:40 PM
Setting up RDP ZenicStriker Linux - Server 3 01-15-2007 11:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration