Kaseya Community

RDP (Terminal Server) Remote Control from Linux

  • To use Kaseya RDP Remote Control (of a machine with an agent installed) from a Linux PC:

    Install Wine and Rdesktop
    (In Ubuntu variants: sudo apt-get install wine rdesktop)

    Copy the below code into a text file called krdpexec (or whatever you would like to call it).


    #!/bin/bash
    # Written by Shawn Jackson for i-worx Enterprises Inc on November 14, 2008
    # Copyright 2008 i-worx Enterprises Inc.

    # You may use and redistribute this script, in whole or in part, providing you
    # include this notice and do not distribute it as a part of a commercial product.

    # Get number of active Kaseya RDP connections
    prevOpenConnections=`netstat -lnp | grep "wineserver\|noActiveX" | grep -c 0.0.0.0:9...`
    echo $prevOpenConnections
    # Execute the noActiveX... file
    wine $1 &
    # Wait until there is another Kaseya RDP listening session/port
    until [ `netstat -lnp | grep "wineserver\|noActiveX" | grep -c 0.0.0.0:9...` -gt $prevOpenConnections ]; do
    echo Current: `netstat -lnp | grep "wineserver\|noActiveX" | grep -c 0.0.0.0:9...`
    echo Prev: $prevOpenConnections
    # If fewer connections are open than initially (one was closed) then update prevOpenConnections
    if [ `netstat -lnp | grep "wineserver\|noActiveX" | grep -c 0.0.0.0:9...` -lt $prevOpenConnections ]; then
    prevOpenConnections=`netstat -lnp | grep "wineserver\|noActiveX" | grep -c 0.0.0.0:9...`
    fi
    sleep 1
    done
    # Now that there is a new Kaseya RDP listening attempt to connect to each.
    # This is a bit of a hack, but only the new session will accept your connection.
    var=`netstat -lnp | grep "wineserver\|noActiveX" | grep -o 0.0.0.0:9...`
    listeningsessions=(`echo $var`)
    for i in "${listeningsessions[@]}"; do
    echo /usr/bin/rdesktop -T $i -f $i
    /usr/bin/rdesktop -T $i -f $i &
    sleep 1
    done


    At a command line change permissions allowing the script to be executed:

    chmod a+x krdpexec


    Log in to Kaseya, find the machine you would like to remote control with RDP and click on it. Run the NoActiveX... EXE (you are given a link to when ActiveX fails to load) with the krdpexec script. (In Firefox: select "Open With..." and in the drop-down choose "Other" then navigate to and select the krdpexec file you created)

    Enjoy.

    Legacy Forum Name: RDP (Terminal Server) Remote Control from Linux,
    Legacy Posted By Username: i-worx
  • Thank you for this and the VNC instructions.

    Legacy Forum Name: How-To,
    Legacy Posted By Username: cnwicsurrett
  • Easier way,,,,


    google ie4linux and follow the directions for installing IE. Then you can install vnc from the .exe, you'll need to start the vncviewer--listen before you connect, or set it to start when you open IE. It works really well.

    Legacy Forum Name: How-To,
    Legacy Posted By Username: darcement
  • darcement
    Easier way,,,,


    google ie4linux and follow the directions for installing IE. Then you can install vnc from the .exe, you'll need to start the vncviewer--listen before you connect, or set it to start when you open IE. It works really well.


    How does this accomplish connecting via RDP from a Linux box?

    Legacy Forum Name: How-To,
    Legacy Posted By Username: cnwicsurrett
  • Thank you very much. Always just a few steps from dropping the windows kvm, but never quite gettting there!

    Legacy Forum Name: How-To,
    Legacy Posted By Username: mparr
  • I'm running on a Macbook now and I use Darwine to get remote control to work through Kaseya in Safari.

    I'm trying to get away from having to run a VM to use IE7 in Kaseya, despite the fact that Vmware Fusion with Unity mode is ridiculously cool.

    Legacy Forum Name: How-To,
    Legacy Posted By Username: Benjamin.Lavalley@kaseya.com
  • darcement
    Easier way,,,,


    google ie4linux and follow the directions for installing IE. Then you can install vnc from the .exe, you'll need to start the vncviewer--listen before you connect, or set it to start when you open IE. It works really well.


    This is awesome, thank you. One question/problem I'm having, however, I can't find the spot to do the vncviewer--listen. It never prompted me to download the exe file for the VNC.

    Legacy Forum Name: How-To,
    Legacy Posted By Username: efanning
  • efanning
    This is awesome, thank you. One question/problem I'm having, however, I can't find the spot to do the vncviewer--listen. It never prompted me to download the exe file for the VNC.


    you can setup an app luncher and in the command part put "wine \Location of your c: in wine\vncviewer --listen" and it'll start the vnc session and give you a vnc session in the sys tray bar.

    Legacy Forum Name: How-To,
    Legacy Posted By Username: darcement
  • [QUOTE=i-worx;34477]To use Kaseya RDP Remote Control (of a machine with an agent installed) from a Linux PC:

    Install Wine and Rdesktop
    (In Ubuntu variants: sudo apt-get install wine rdesktop)

    Copy the below code into a text file called krdpexec (or whatever you would like to call it).


    #!/bin/bash
    # Written by Shawn Jackson for i-worx Enterprises Inc on November 14, 2008
    # Copyright 2008 i-worx Enterprises Inc.

    # You may use and redistribute this script, in whole or in part, providing you
    # include this notice and do not distribute it as a part of a commercial product.

    # Get number of active Kaseya RDP connections
    prevOpenConnections=`netstat -lnp | grep "wineserver\|noActiveX" | grep -c 0.0.0.0:9...`
    echo $prevOpenConnections
    # Execute the noActiveX... file
    wine $1 &
    # Wait until there is another Kaseya RDP listening session/port
    until [ `netstat -lnp | grep "wineserver\|noActiveX" | grep -c 0.0.0.0:9...` -gt $prevOpenConnections ]; do
    echo Current: `netstat -lnp | grep "wineserver\|noActiveX" | grep -c 0.0.0.0:9...`
    echo Prev: $prevOpenConnections
    # If fewer connections are open than initially (one was closed) then update prevOpenConnections
    if [ `netstat -lnp | grep "wineserver\|noActiveX" | grep -c 0.0.0.0:9...` -lt $prevOpenConnections ]; then
    prevOpenConnections=`netstat -lnp | grep "wineserver\|noActiveX" | grep -c 0.0.0.0:9...`
    fi
    sleep 1
    done
    # Now that there is a new Kaseya RDP listening attempt to connect to each.
    # This is a bit of a hack, but only the new session will accept your connection.
    var=`netstat -lnp | grep "wineserver\|noActiveX" | grep -o 0.0.0.0:9...`
    listeningsessions=(`echo $var`)
    for i in "${listeningsessions[@]}"; do
    echo /usr/bin/rdesktop -T $i -f $i
    /usr/bin/rdesktop -T $i -f $i &
    sleep 1
    done


    At a command line change permissions allowing the script to be executed:

    chmod a+x krdpexec


    Log in to Kaseya, find the machine you would like to remote control with RDP and click on it. Run the NoActiveX... EXE (you are given a link to when ActiveX fails to load) with the krdpexec script. (In Firefox: select "Open With..." and in the drop-down choose "Other" then navigate to and select the krdpexec file you created)

    Enjoy.[/QUOTE]

    Thanks for the great notes with this. I'm currently running Ubuntu 9.10 x64 and when firefox downloads the .exe for either RDP or K-VNC (after having VNCVIEWER --listen turned on) I'm able to run just by right clicking the file and selecting the Open Wine Windows Program Loader then the RDP text file is created that I can use in my Terminal Services Program. I was just wondering if anyone else had the experience of the text file not being created when selecting krdpexec script but just directly opening with Wine?

    Legacy Forum Name: How-To,
    Legacy Posted By Username: jblessman