Remote desktop¶
Exercise remote-desktop-annex.pdf · PDF
Aina phones you: "The invoice program shows a window with an error and a button I cannot read." You are at home. With SSH you can get a shell on her PC. But can you see her window?
No. A shell gives you letters, not windows. Sometimes the thing you must use is a window. For that you need a different tool, one that brings the whole screen of a far machine to yours. You have probably used one already, if a teacher or an IT person ever "took control" of your computer to help you.
What you will learn
- Say when a remote desktop is the right tool and when a shell is better
- Compare RDP and VNC: who made them, which port, what travels
- Turn on Remote Desktop on Windows 11 and connect to it from Linux with Remmina
- Share a GNOME desktop and connect to it
- Why a remote desktop port is never opened to the Internet
Sitting on its chair from far away¶
A remote desktop draws the screen of a far machine on yours, and sends your keyboard and mouse to act there.
If SSH is a phone call to the machine (you say commands, it answers in words), a remote desktop is sitting on its chair from far away: you see its screen and move its mouse. Pictures weigh much more than letters, so a remote desktop needs much more network than a shell.
flowchart LR
subgraph YOU ["Your Ubuntu PC (the client)"]
REM["<b>Remmina</b><br>draws the far screen"]
end
subgraph FAR ["win11 or deb-lab (the host)"]
HOST["<b>Remote desktop service</b><br>port 3389"]
end
REM -->|"keys and mouse"| HOST
HOST -->|"the screen"| REM
The machine you control is the host; the program you use to control it is the client. On the Ubuntu PCs the client is Remmina, which speaks both families below.
Two families: RDP and VNC¶
| RDP | VNC | |
|---|---|---|
| Full name | Remote Desktop Protocol | Virtual Network Computing |
| From | Microsoft; arrived with Windows NT 4.0 Terminal Server Edition, 1998 | Olivetti & Oracle Research Laboratory, Cambridge (UK); paper published in 1998 |
| Port | TCP and UDP 3389 | TCP 5900 (+ screen number) |
| What travels | Drawing orders, sound, clipboard, disks, printers | Pictures of the screen, keys, mouse (protocol RFB) |
| Typical session | You log in and get a session; on Windows 11 the local screen is locked | You see what the person at the machine sees: good for helping somebody |
| Built in | Windows Pro, Enterprise, Education can be the host; Home can only connect to others | Many free servers and clients for every system |
GNOME on Linux now speaks RDP too, and shows both behaviours:
- Remote Login gives you a new session, like Windows does.
- Desktop Sharing shows the session that is already open: you and the person at the machine see the same screen.
And TeamViewer or AnyDesk?
They are not RDP. They are other products with their own protocols, and the connection passes through the company's own servers on the Internet.
RDP into Windows 11¶
First check the edition: Settings → System → About. It must be Pro, Enterprise or Education; Windows 11 Home cannot be the host.
- In
win11: Settings → System → Remote Desktop → switch it On → Confirm. - Find its address in PowerShell with
ipconfig. -
Check that Windows is listening:
A line with
LocalPort 3389andState Listenmeans the service is waiting. -
On the Ubuntu PC, open Remmina → new connection → protocol RDP → the address → your Windows user name and password → Connect → accept the certificate.
Now look at the win11 window in virt-manager: it shows the lock screen. RDP gives you your own session, and only one person uses the machine at a time.
Where people get stuck
- Remmina says Unable to connect: wrong address, or the VM is on another virtual network.
- The Remote Desktop switch is missing: the edition is Home.
- Windows refuses the user: the account needs a password. Accounts without one cannot log in remotely.
Share the GNOME desktop¶
In deb-lab, logged in:
- Settings → System → Remote Desktop → Desktop Sharing. Switch on Desktop Sharing and Remote Control.
- Note the user name and password the panel shows. They are not your Linux account.
-
Find the address with
ip -br a, and check the port:A listener on
*:3389(or3390, if Remote Login is also on) is the GNOME remote desktop service. -
On the Ubuntu PC: Remmina → RDP → that address (add
:3390if that was the port) → the user and password from the panel.
Move the mouse in Remmina and watch the deb-lab window in virt-manager: both show the same desktop and the mouse moves in both. This is sharing, not a new session: exactly what you need to help Aina find her button.
If there is no Remote Desktop entry in GNOME Settings, install it with sudo apt install gnome-remote-desktop and log in again.
Never open it to the Internet¶
Remember the online server from SSH remote access: programs were knocking on port 22 all day, guessing passwords. They knock on 3389 and 5900 too, and a remote desktop gives them a whole screen.
Rule: a remote desktop port is for the inside of the network. From outside, you first enter through a VPN (Unit 3) or through SSH, and then connect.
Careful: encrypted is not the same as safe
RDP is encrypted. Encryption hides the conversation; it does not stop password guessing, and it does not fix bugs in the service. Changing 3389 to another number does not help either: scanners try every port. VPN first.
When you are done, switch Remote Desktop off again on win11 and deb-lab. A door you do not use is a door you close.
Shell or desktop?¶
A remote desktop feels easier, so it is tempting to use it for everything. Don't. On a server there is often no desktop to show (ubu-srv has none), a shell works over a bad connection, and commands can be written in your log and repeated. Use a desktop only when the job is a window.
| Situation | Tool | Why |
|---|---|---|
Restart the web service on ubu-srv |
SSH | One command; the server has no desktop |
| Aina cannot find a button in the invoice program | Remote desktop (sharing) | You must see what she sees |
| Copy a backup file from the server to your laptop | scp |
A file, not a screen |
| Use a Windows-only design program from a Linux laptop | RDP | The program is a window on another machine |
| Change one line in a config file, from a train with bad Wi-Fi | SSH | Letters need almost no network |
| Install updates on twenty servers | SSH | The same command twenty times can be a script |
Key takeaways¶
- A remote desktop brings a far machine's screen to yours; it needs much more network than a shell.
- RDP (Microsoft, 1998, port 3389) gives you a session; VNC (Cambridge, 1998, port 5900, protocol RFB) classically shows the screen in use.
- Windows 11 Pro, Enterprise and Education can be RDP hosts; Home can only connect. GNOME offers Desktop Sharing and Remote Login.
- Remmina is the client on the Ubuntu PCs and speaks both RDP and VNC.
- Never expose a remote desktop port to the Internet: enter through a VPN or SSH first, and switch it off when unused.
- Choose the tool by the job: a window needs a desktop; commands, files and bad connections need SSH and
scp.
Quick check¶
1. Which Windows 11 edition cannot be controlled with Remote Desktop?
- Home
- Pro
- Education
- Enterprise
Only Pro, Enterprise and Education can be the host of a Remote Desktop session. Home can connect to other machines, but nobody can connect to it.
2. On which port does RDP listen?
- 3389
- 22
- 445
- 5900
RDP uses TCP and UDP 3389. 22 is SSH, 445 is SMB file sharing, and 5900 is VNC.
3. You must change one line of a configuration file on a server, over slow Wi-Fi. Which tool is best?
- SSH
- RDP
- VNC
- A shared GNOME desktop
Letters need almost no network, and the server may have no desktop at all. SSH is lighter, works on bad connections and its commands can be logged and repeated.
4. How should someone outside the office reach a PC's remote desktop?
- Through a VPN or SSH first, then connect
- By opening port 3389 on the router
- By moving 3389 to a different port number
- By choosing a very long password for it
A remote desktop port is for the inside of the network. Scanners try every port, and encryption does not stop guessing or bugs. Enter with a VPN or SSH first.
5. You share the GNOME desktop of deb-lab and connect with Remmina. What do you see?
- The same desktop as the person sitting at deb-lab
- A new empty session, while deb-lab shows the lock screen
- Only a terminal, because GNOME shares a shell
- Nothing, because GNOME only speaks VNC
Desktop Sharing shows the session that is already open: both windows show the same screen and the mouse moves in both. Remote Login is the GNOME option that gives a new session.
6. What is the main difference between a remote desktop and SSH?
- A remote desktop sends pictures of the screen, SSH sends text
- A remote desktop is encrypted, SSH is not
- A remote desktop works on servers without a desktop
- A remote desktop uses port 22, SSH uses 3389
SSH is a phone call in words; a remote desktop is sitting on the chair from far away. Both are encrypted, but pictures need much more network than letters.
7. Aina, from the administration department, cannot find a button in the invoice program and asks for help. Select the two that are true.
- A remote desktop that shares her open session fits this job
- When you finish, the remote desktop should be switched off again
- SSH is enough, because it shows her program's window
- Copying the program with scp to your laptop solves it
You must see what she sees, so this is a job for a shared desktop. A door you do not use is a door you close: switch it off afterwards.
Two ways to be on a machine without being there. Now the server starts doing what a server is for: giving files to everybody. Next: Samba file server.