Tweetegy On the edge of chaos with Ruby, Rails, JavaScript and AngularJS.

| About | Search | Archive | Github | RSS |

Remote desktop using a single tsclient terminal command

If you use Ubuntu and have to work on remote computers that require using a GUI (like Windows machines for example), then you will find this following tip very useful! Firstly let me explain what you will have; after just a few minutes of minor configuration, you will be able to remote desktop into a Windows (or other) machine with just one swift command in the terminal! Say for example, you have a remote machine called “jungle” then wouldn’t it be nice if you could remote to it using the following single command?

remotejungle

I Thought so! OK, so here’s how! Firstly create a folder called .tsclient under your home directory (note the period before the name of the folder so that it is kept hidden by default).

cd
mkdir .tsclient

Create a file (if not already) called .bash_aliases and save it under your home directory:

cd
touch .bash_aiases

Now edit that file and add the alias for remoting into your remote machine, like so:

alias remotejungle='tsclient -x ~/.tsclient/remotejungle.rdp'

Note that this sets up the alias “remotejungle” so that it executes the command “tsclient -x ~/.tsclient/remotejungle.rdp”. As you can see it expects to find a file remotejungle.rdp in the .tsclients folder. In order to create this file you need to use the “Terminal Server Client” GUI application to setup your desired session settings for display screen size, color depth, remote sound, keyboard and so on and then click the “Save As” button and save the file as remotejungle.rdp to ~/.tsclient/.

The final step is to modify the .bashrc file so that it picks up the alias list. Open up the .bashrc file in an editor and uncomment the following lines:

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

You’ll probably have to reload the .bashrc file again by opening a new terminal or executing the following command should also reload the .bashrc file:

source .bashrc

Now your good to go! Just try to remote into your computer using the alias that you setup during this tutorial and you will never be happier to remote into Windows from Ubuntu!

Ubuntu - Terminal Server Client