Most of you probably had need to connect remotely on other computer. It might have been because one of your friends simply needed your help or you had several machines (physical or virtual machines) and you simply needed to reach remote one. If both machines were running MS Windows, you were probably using Remote Desktop for this purpose.
So, what if you want to remotely connect to Linux machine desktop (yes, I usually connect using SSH and use CLI only but this is about using full graphical interface remotely)? Well, as you may know, Remote Desktop Protocol (RDP) is proprietary protocol developed by Microsoft so it is not natively supported by non MS Windows platforms (Linux, MAC and others). So? What is solution here?
Well, I'm mostly using Ubuntu Linux (both for desktop and server machines) so I can share some of the options available. However, I'm pretty sure that most of Linux distributions have similar (or even same) features so it might work with them as well.
Actually, so far I know for two options. First option is Linux version of Remote Desktop. Principle is exactly the same but protocol is a bit different. As far as I know, this feature is already present and enabled on Ubuntu desktop machines so there is only one thing you need to do on client machine (machine you wish to remotely connect to) is to enable the feature. Simply click on "Settings", then "Preferences" and then "Remote Desktop" to open window with Ubuntu Remote Desktop Preferences. Alternative way is to use Dash Home to quickly navigate to this options window:
Now, on options screen simply enable this feature:
Using preferences window you can easily set up several security options as well, It is highly recommended that you enable password. And, do not forget to write down IP address of your host machine since it will be needed on remote side in order to create connection. Ubuntu remote desktop technology is based on VNC standard which means that, after enabling this feature on your system, you will be able to connect to it from any other machine using any VNC client. Again, Ubuntu already has such client - Remmina Remote Desktop Client:
After starting up application, in order to create new connection simply click on "Create a new remote desktop file" option. You will be presented with "Remote Desktop Preference" window on which you can configure your connection.
Firstly, and most obviously, give your connection meaningful name. Secondly, as this particular client has several options and can use several protocols - RDP, SFTP, SSH and VNC, select correct protocol from the list. In this case, it is VNC. After that, in "Server" field enter IP address of the machine you wish to connect to, fill in user credentials ("User name" and "Password") and set up quality as well as other options you may wish to. By clicking on "Save" you will obviously save this connection and by clicking on "Connect" you will immediately start it. If you have configured client correctly, in just a matter of seconds you will see and have full control over remote machine desktop:
Do keep in mind that, if on client machine you have set up "You must confirm each access to this machine" option, you will not be able to connect on remote machine desktop until somebody from that machine allows it first.
Similarly, by using any VNC client, you will be able to connect to your Ubuntu machine from any other system such as MS Windows or MAC.
So, that was the first option. Now, let's take a look at the second one - using actual Microsoft's Remote Desktop protocol. Like I already said, RDP is not natively supported by Ubuntu but, luckily, there is xrdp. Xrdp is an open source X server and RDP server which means that it "understands" RDP protocol enabling connections from Remote Desktop clients. So, first thing you need to do is to install it on your system. On Ubuntu you can simply use apt-get to perform installation:
After you finish your installation, there is one more thing you need to do in order to make it work correctly. Actually, Ubuntu desktop is runing by default in 3D mode. However, RDP clients are able only to deal with 2D desktops. So, we need to set up xrdp to start all RDP connections in 2D mode. How do we do this? Well, in order to configure xrdp to create 2D session with all connecting RDP clients, we need to create new configuration file named .xsession which needs to be stored in your home directory. If you plan to connect to machine on more than one account, than you will have to create such file for each account individually.
So, go to chosen home directory and there create file named .xsession using your favorite textual editor (nano, vi, gedit...). Once created, type the following configuration in it:
Now restart xrdp in order to read new configuration and you're ready to go. Now, from any Windows machine, you can use Remote Desktop program to connect to your Ubuntu desktop machine:
Simply open new Remote Desktop Connection, type in IP address of target machine and click on "Connect". After few moments you will be prompted with window in which you will enter your user credentials:
Simply type in your user name and password and voila - in a matter of seconds you will have full remote desktop connection and control of your Ubuntu machine directly from Windows machine:
There you have it - two ways to connect to your Ubuntu desktop from remote machine. I'm sure there are many other ways you can achieve same thing but those are the ones I find the easiest and quite effective.
So, what if you want to remotely connect to Linux machine desktop (yes, I usually connect using SSH and use CLI only but this is about using full graphical interface remotely)? Well, as you may know, Remote Desktop Protocol (RDP) is proprietary protocol developed by Microsoft so it is not natively supported by non MS Windows platforms (Linux, MAC and others). So? What is solution here?
Well, I'm mostly using Ubuntu Linux (both for desktop and server machines) so I can share some of the options available. However, I'm pretty sure that most of Linux distributions have similar (or even same) features so it might work with them as well.
Actually, so far I know for two options. First option is Linux version of Remote Desktop. Principle is exactly the same but protocol is a bit different. As far as I know, this feature is already present and enabled on Ubuntu desktop machines so there is only one thing you need to do on client machine (machine you wish to remotely connect to) is to enable the feature. Simply click on "Settings", then "Preferences" and then "Remote Desktop" to open window with Ubuntu Remote Desktop Preferences. Alternative way is to use Dash Home to quickly navigate to this options window:
Now, on options screen simply enable this feature:
Using preferences window you can easily set up several security options as well, It is highly recommended that you enable password. And, do not forget to write down IP address of your host machine since it will be needed on remote side in order to create connection. Ubuntu remote desktop technology is based on VNC standard which means that, after enabling this feature on your system, you will be able to connect to it from any other machine using any VNC client. Again, Ubuntu already has such client - Remmina Remote Desktop Client:
After starting up application, in order to create new connection simply click on "Create a new remote desktop file" option. You will be presented with "Remote Desktop Preference" window on which you can configure your connection.
Firstly, and most obviously, give your connection meaningful name. Secondly, as this particular client has several options and can use several protocols - RDP, SFTP, SSH and VNC, select correct protocol from the list. In this case, it is VNC. After that, in "Server" field enter IP address of the machine you wish to connect to, fill in user credentials ("User name" and "Password") and set up quality as well as other options you may wish to. By clicking on "Save" you will obviously save this connection and by clicking on "Connect" you will immediately start it. If you have configured client correctly, in just a matter of seconds you will see and have full control over remote machine desktop:
Do keep in mind that, if on client machine you have set up "You must confirm each access to this machine" option, you will not be able to connect on remote machine desktop until somebody from that machine allows it first.
Similarly, by using any VNC client, you will be able to connect to your Ubuntu machine from any other system such as MS Windows or MAC.
So, that was the first option. Now, let's take a look at the second one - using actual Microsoft's Remote Desktop protocol. Like I already said, RDP is not natively supported by Ubuntu but, luckily, there is xrdp. Xrdp is an open source X server and RDP server which means that it "understands" RDP protocol enabling connections from Remote Desktop clients. So, first thing you need to do is to install it on your system. On Ubuntu you can simply use apt-get to perform installation:
sudo apt-get install xrdp
After you finish your installation, there is one more thing you need to do in order to make it work correctly. Actually, Ubuntu desktop is runing by default in 3D mode. However, RDP clients are able only to deal with 2D desktops. So, we need to set up xrdp to start all RDP connections in 2D mode. How do we do this? Well, in order to configure xrdp to create 2D session with all connecting RDP clients, we need to create new configuration file named .xsession which needs to be stored in your home directory. If you plan to connect to machine on more than one account, than you will have to create such file for each account individually.
So, go to chosen home directory and there create file named .xsession using your favorite textual editor (nano, vi, gedit...). Once created, type the following configuration in it:
gnome-session --session=ubuntu-2d
Simply open new Remote Desktop Connection, type in IP address of target machine and click on "Connect". After few moments you will be prompted with window in which you will enter your user credentials:








No comments:
Post a Comment