Occasionally it is useful allow connections between desktop sessions running on different computers. This can be very handy when troubleshooting a problem as both users will be able to see the error on the problematic system and either user can take control of the mouse and keyboard in order to fix the problem. Typically this is a temporary situation as providing access to one's computer allows a remote user the ability to both view and modify its settings.
This section will demonstrate two remote desktop scenarios: how to configure an RDP connection to another computer from PC-BSD and how to invite another computer to connect to your desktop session.
Connecting to Another Computer With RDP
The remote desktop protocol (RDP) protocol can be used to make a connection to another computer. This section will demonstrate what is needed on the remote computer for an RDP connection, how to connect using KDE's KRDC, and how to connect using VNC.
Preparing the Remote System
Depending upon the operating system, you may have to first install or enable RDP software on the remote computer:
- not every edition of Windows provides a fully functional version of RDP; for example, it may not be fully supported in a Home Edition of Windows. Even if the full version of RDP is included, remote access may or may not be enabled by default. If you have trouble connecting using RDP, do a Google search for "remote desktop" and the name of the version of Windows you are using to find out how to configure its remote desktop settings. If you still can't connect, you will need to download, install and configure VNC server software on the system.
- if the other computer you are connecting to is a Mac, Linux, or BSD system, you will have to first install either xrdp or a VNC server on the other system. Depending upon the operating system, either software may or may not already be installed. If it is not, check the software repository for the operating system or use Google to find out how to install and configure one of these applications on that operating system. If you are connecting to another PC-BSD system, the krfb VNC server is automatically installed with KDE and additional VNC server software is available in AppCafe™.
If the remote system is protected by a firewall, you will need to check that it allows connections to the TCP port required by the type of connection that you will be using:
RDP: uses port 3389
VNC: uses port 5900 (for the first connection, 5901 for the second connection, etc.)
If you need to manually add a firewall rule, it is best to only allow the IP address of the computer that will be connecting. You should immediately remove or disable this firewall rule after the connection is finished so that other computers do not try to connect to the computer. Since your PC-BSD system is considered to be the client and will be initiating the connection, you do not have to modify the firewall on the PC-BSD system.
Connecting with KDE's KRDC
If your PC-BSD system has the KDE desktop installed, you can initiate a connection request using KRDC. To launch this application, go to Application Launcher -> Internet -> Remote Desktop Client within KDE or type krdc at the command line within any desktop. If you click F1 while in KRDC you can access the Remote Connection Desktop Handbook to learn more about how to use this application.
Figure 5.9a shows the initial KRDC screen which allows you to specify which system you wish to connect to.
Figure 5.9a: Creating a Connection Using KRDC
Use the drop down menu to indicate whether the remote system is using RDP or VNC for the connection. Then type in the IP address of the system you wish to connect to. If you are connecting to a VNC system, the IP address needs to be followed by a colon and a number indicating the number of the session. Typically, the number will be 1 unless the VNC server is hosting multiple simultaneous connections. Once you press enter, the connection will be initiated and you will see the screen shown in Figure 5.9b:
Figure 5.9b: Settings for the Connection
Here is a quick overview of the settings:
Desktop resolution: since the contents of the screen are sent over the network, select the lowest resolution that still allows you to see what is happening on the other system. If you have a very fast network connection, you can choose a higher resolution; if you find that the other system is very slow to refresh its screen, try choosing a lower resolution.
Color depth: choose the lowest color depth that allows you to see the other system; you can choose a higher color depth if the network connection is fast.
Keyboard layout: this drop down menu allows you to select the desired keyboard layout.
Sound: this drop down menu allows you to choose whether any sounds heard during the connection are produced on this system, the remote system, or to disable sound during the connection.
Console login: if you are connecting to a Unix-like system, you can check this box if you wish to have access to the other system's command line console.
Extra options: allows you to specify rdesktop switches that aren't covered by the other options in this screen.
Show this dialog again for this host: if you plan on using the same settings every time you connect to this computer, you can uncheck this box. If you need to change the settings at a later time, you can right-click the connection (which will appear in a list as a past connection) and choose Settings from the right-click menu.
Remember password: KWallet is KDE's password storage system. If this box stays checked, you will only need to input the password the first time you make this connection as it will be saved for you. If this is the first time you have stored a password using KWallet, it will prompt you for some information to set up your wallet.
Once you press OK, a connection will be initiated and you will receive pop-up messages asking for a username then a password; the details you provide must match a user account on the system you are connecting to. Once your authentication details are confirmed, you should see the desktop of the other system. If you move your mouse, it will move on the other desktop as well. Click the "View Only" button in the top toolbar whenever you wish to disable this mouse behaviour. When you are finished your session, you can click the "Disconnect" button in the top toolbar.
Connecting with VNC
Allowing Another Computer to Connect Using Desktop Sharing
If you wish another user to connect to your computer, you can use the Krfb desktop sharing application to generate a connection invitation. To launch this application go to Application Launcher -> Internet -> Desktop Sharing or type krfb from the command prompt. If you press F1 while in this application, it will open the Desktop Sharing Handbook where you can learn more about using this utility. Figure 5.9c shows the initial screen for this application:
Figure 5.9c: Initiating a Connection Request Using Krfb
There are two types of invitations that you can create:
Personal Invitation: if you click this button it will display the hostname that the other person will use to connect, a temporary password to use for the connection, and an connection request expiration time of one hour. It will include a warning reminding you to only give this information to the person you wish to connect as anyone can connect using that information. The connection itself can be made from any VNC client. If the person is using PC-BSD, they can use KRDC as described above. On other operating systems, they will need to check if VNC is installed and download a VNC client if it is not. Once you press the Close button, the invitation expiry date will be listed in the main screen.
Email Invitation: if you click this button it will display a warning that anyone who reads the email containing the invitation can connect. Once you click the Continue button, the default email program will open up containing the invitation so that you can input the email address of the recipient and send the email.
It should be noted that the most secure way to convey the invitation information is through an alternate communications channel such as a phone call. Ideally, you are speaking to the other person as they connect so you can walk them through the problem you are experiencing and they can let you know what they are doing to your system as you watch them do it.
Figure 5.9d shows an example of a personal invitation:
Figure 5.9d: Connection Invitation Created Using Krfb
Once the other person has the invitation, they should input the information in the invitation into their VNC client (also called a VNC viewer) in order to start a connection. You will know when they try to connect as a pop-up message will appear on your screen similar to Figure 5.9e:
Figure 5.9e: The Other User is Trying to Connect Using the Invitation
In this example, a computer with an IP address of 192.168.1.111 is trying to connect. Buttons are provided to either accept or refuse the connection. You can also check or uncheck the box to "allow remote user to control keyboard and mouse". If you accept the connection, the other user will be prompted to input the invitation password. Once the password is accepted, they will see your desktop.