Remote desktop: Difference between revisions

From 太極
Jump to navigation Jump to search
 
(39 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Comparison =
[https://en.wikipedia.org/wiki/Comparison_of_remote_desktop_software Comparison of remote desktop software]
= NoMachine =
https://www.nomachine.com/accessing-your-remote-linux-desktop-on-amazon-elastic-compute-cloud-via-NoMachine
It seems nomachine is using port 4000.
<pre>
odroid@odroid:~$ sudo nmap -sV localhost
Starting Nmap 7.01 ( https://nmap.org ) at 2016-11-16 20:10 EST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000051s latency).
Other addresses for localhost (not scanned): ::1
rDNS record for 127.0.0.1: odroid
Not shown: 997 closed ports
PORT    STATE SERVICE        VERSION
22/tcp  open  ssh            OpenSSH 7.2p2 Ubuntu 4ubuntu2.1 (Ubuntu Linux; protocol 2.0)
4000/tcp open  remoteanything?
7001/tcp open  X11            (access denied)
Service Info: OSs: Linux, Unix; CPE: cpe:/o:linux:linux_kernel
odroid@odroid:~$ sudo lsof -i :4000
COMMAND PID USER  FD  TYPE DEVICE SIZE/OFF NODE NAME
nxd    735  nx    3u  IPv4  19208      0t0  TCP *:4000 (LISTEN)
nxd    735  nx    4u  IPv6  21234      0t0  TCP *:4000 (LISTEN)
</pre>
[https://www.nomachine.com/ NoMachine]. I ran the service on my Ubuntu 12.04 server. I also tested the client on my Android 6.0 tablet and Odroid xu4 running Ubuntu 15.10. I am using the version 5.0.63. I need to use my server's user account info to connect.
{{Pre}}
odroid@odroid:~/Downloads$ ps -ef | grep nx
nx      12168    1  1 21:11 ?        00:00:20 /usr/NX/bin/nxserver.bin root 12151 --daemon
odroid  12199 12168  1 21:11 ?        00:00:12 /usr/NX/bin/nxnode.bin
nx      12225 12168  0 21:11 ?        00:00:00 /usr/NX/bin/nxd
odroid  12263 12199  1 21:11 ?        00:00:13 /usr/NX/bin/nxclient.bin --monitor --pid 1153
nx      15916 12225 24 21:28 ?        00:00:08 /usr/NX/bin/nxserver.bin -c /etc/NX/nxserver --login -H 5
odroid  15944 15916 33 21:29 ?        00:00:04 /usr/NX/bin/nxnode.bin -H 5
odroid  16130  8527  0 21:29 pts/1    00:00:00 grep --color=auto nx
odroid@odroid:~/Downloads$ ls /usr/NX/bin
drivers      nxd        nxkb        nxplayer      nxsh        nxusbd
nxagent      nxesd      nxkeygen    nxplayer.bin  nxspool
nxauth        nxexec      nxlocate    nxpost        nxssh
nxclient      nxfs        nxlpd      nxprint      nxssh-add
nxclient.bin  nxfsm      nxnode      nxserver      nxssh-agent
nxcodec.bin  nxfsserver  nxnode.bin  nxserver.bin  nxtunctl
</pre>
If for some reason some nx programs disappeared, restart the service by
{{Pre}}
sudo /usr/NX/bin/nxserver --restart
</pre>
It is interesting that nomachine is faster than 'ssh -X' method when I tested running a Qt application launched from Qt Creator. For example, the progress bar is not moving when it is supposed to move forward and backward when the app is launched through 'ssh -X'.
= ThinLinc =
[https://youtu.be/lTdTZfjSRY4 ThinLinc Overview and Tutorial - How to Install and Utilize this Linux Remote Desktop Solution]. Not successful from my testing. Also, the [https://community.thinlinc.com/t/thinlinc-server-uninstallation-4-12-1/227 instruction] "sudo apt remove thinlinc- " does not work to uninstall it. The [https://www.cendio.com/resources/docs/tag/ admin guide] has no information about uninstallation.
= Remote desktop connection from Ubuntu to Ubuntu (vino) =
= Remote desktop connection from Ubuntu to Ubuntu (vino) =
* [https://cloudlinuxtech.com/enable-remote-desktop-ubuntu/ How to enable Remote Desktop in Ubuntu - Remmina {easiest update 2022}]
* [https://cloudlinuxtech.com/enable-remote-desktop-ubuntu/ How to enable Remote Desktop in Ubuntu - Remmina {easiest update 2022}]
Line 31: Line 88:
</li>
</li>
</ul>
</ul>
== Remmina ==
* File sharing from Linux to Windows.
** Remmina does not support drag and drop of files between the local and remote desktops. However, you can share a local folder with the remote desktop and access its contents from the remote machine. To do this, you need to create a new Remmina RDP connection or edit an existing one. In the “Basic” tab, '''choose a shared folder''' from a local Linux machine. In the “Advanced” tab, change the sound to local. Save the connection and connect to the remote desktop. The shared folder should now appear in the remote desktop’s file explorer


= Tightvnc server =
= Tightvnc server =
Line 37: Line 98:
* [https://www.howtoforge.com/how-to-install-vnc-server-on-debian-11/ How to Install VNC Server on Debian 11]
* [https://www.howtoforge.com/how-to-install-vnc-server-on-debian-11/ How to Install VNC Server on Debian 11]
* [https://youtu.be/633OWaW3cyo Linux Desktop in the Cloud Tutorial | Create and Access From Anywhere] tightvncserver + remmina client
* [https://youtu.be/633OWaW3cyo Linux Desktop in the Cloud Tutorial | Create and Access From Anywhere] tightvncserver + remmina client
== Tunnel the VNC traffic through SSH connection ==
On the server,
<pre>
$ sudo apt remove --purge snapd
$ sudo apt-mark hold snapd
$ sudo apt update
$ sudo apt upgrade
$ sudo apt autoremove
$ sudo apt install xfce4 tightvncserver
$ tightvncserver  # require 8 characters for password
</pre>
Now the client can connect to '''vnc://[IP address]:5901'''. TightVNC don't connect you to the desktop that you're logged into, but rather start a fresh one of their own. To kill the server, run '''vncserver -kill :1''' .
Editing the startup script with nano .vnc/xstartup and at the very end add the line:
<pre>
startxfce4&
</pre>
Now restart TightVNC and this time when you  connect you're interfacing directly with the Xfce desktop.
Tip 1: '''VNC server system startup script'''. [https://linuxconfig.org/vnc-server-on-ubuntu-20-04-focal-fossa-linux VNC server on Ubuntu 20.04 Focal Fossa Linux]. PS: I try to use /etc/rc.local file but "ps -ef | grep vnc" shows vncserver is not up automatically and "systemctl status rc-local.service" shows some problems even rc-local is active & running.
Tip 2: If you want to make your remote desktop remotely accessible, it's terrible to forward traffic in the router directly since VNC traffic is not encrypted as seriesly as SSH traffice. Instead we tunnel the VNC traffice over an SSH connection. On the client desktop, we first set up the SSH connection from our desktop to the server:
<pre>
$ ssh [user]@[i-address] -L5901:localhost:59000
</pre>
The SSH session starts as usual, but in the background we've connected port 59000 on our local machine to port 5901 on the host. So in the remote connection dialog, if we instead connected to '''localhost:59000''', we are doing so over our SSH tunnel. For a server not hiding behind a home router, you should add a firewall rule to prevent access to VNC directly.
Tip 3: If we need to change the vnc password, we can do it via the command '''vncpasswd'''. [https://linuxconfig.org/how-to-change-vnc-password-on-linux How to change VNC password on Linux]. This works for any VNC server software.
== Client/viewer ==
<ul>
<li>https://wiki.archlinux.org/title/TigerVNC
<li>[https://www.cyberciti.biz/faq/install-and-configure-tigervnc-server-on-ubuntu-18-04/ How To Install and Configure TigerVNC server on Ubuntu]. It includes screenshots of connecting and how to use SSH tunnel.
<pre>
sudo apt install tigervnc-viewer
vncviewer
# To remove it
sudo apt remove tigervnc-viewer
sudo apt purge tigervnc-viewer
</pre>
If we tigervnc-viewer, we need to add '''5901''' to the IP address such as 192.168.86.2:5901
</ul>


= [https://www.realvnc.com/ RealVNC] =
= [https://www.realvnc.com/ RealVNC] =
Line 71: Line 179:


= Remote Desktop Protocol =
= Remote Desktop Protocol =
== Remote desktop connection from Windows 7: xrdp ==
== GNOME RDP (preferred) ==
xtightvncserver may not play well in Unity.  
* [https://www.howtogeek.com/429190/how-to-set-up-remote-desktop-on-ubuntu/ How to Remote Desktop to an Ubuntu Computer]
** VNC is it is no longer considered a secure protocol.
** The VNC back end for the GNOME remote desktop functionality has been turned off by default in GNOME.
** Wayland interferes with VNC.
 
* [https://youtu.be/63uppKZ_Alk VNC and RDP Ubuntu 22.04, Jammy Jellyfish, Remote Access, Screen Sharing, with lock screen fix] (works when I tested on MS Remote Desktop Client app in iPad/macbook). This is based on GNOME RDP. There is no extra software to install.
** Settings - Sharing - Turn on the Sharing toggle switch on the right corner of the Setting app.
** '''Checked 'Remote Desktop' '''
** Optionally checked 'Enable Legacy VNC Protocal' if you want to use VNC for connection
** '''Checked 'Remote Control' '''
** Optional: Change Authentication User Name/Password
** '''In the Authentication section - change the password.'''
** Press 'X' to close the dialog
* [https://youtu.be/nfx8MXkExLk Checking out Remote Desktop Solutions For Linux] on Ubuntu 22.04 ([https://release.gnome.org/42/ GNOME 42]). Before Ubuntu 22.04, users need to use a VNC client to connect to Ubuntu. But since Ubuntu 22.04, users can use either xrdp or vnc software to connect to Ubuntu desktop.
* [https://bytexd.com/how-to-install-gnome-desktop-in-ubuntu/ How to Install GNOME Desktop in Ubuntu 22.04 or 20.04]. There are a few choices:
** ubuntu-gnome-desktop package
** ubuntu-desktop-minimal package
** vanilla-gnome-desktop package
** gnome-session package
** Tasksel


Install xrdp on Ubuntu. That's it. See
== Ubuntu 22.04 VNC ==
* http://www.ubuntututorials.com/remote-desktop-ubuntu-12-04-windows-7/ Ubuntu 12.04
[https://claudiu.psychlab.eu/post/homelab-3-install-configure-guacamole-as-docker-container/ HomeLab 3: Install and configure Apache Guacamole as Docker Container]
* http://www.tweaking4all.com/software/linux-software/use-xrdp-remote-access-ubuntu-14-04/ Ubuntu 14.04
* https://community.hpcloud.com/article/using-windows-rdp-access-your-ubuntu-instance
* http://www.ubuntugeek.com/xrdp-remote-desktop-protocol-rdp-server.html
* [https://itslinuxfoss.com/xrdp-server-on-debian-11/ How to Install Xrdp Server on Debian 11]


== Remote desktop connection from Windows 7: xrdp ==
<ul>
<li>[https://itslinuxfoss.com/xrdp-server-on-debian-11/ How to Install Xrdp Server on Debian 11]
<li>(2022/12/11). For some reason Ubuntu 22.04 does not work. Debian 11 GNOME does not work either. [https://www.linuxcapable.com/how-to-install-kde-plasma-on-debian-11-bullseye/ Debian 11 '''KDE'''] works. No special instruction needed except when we log into Debian we need to select KDE Plasma. NOTE:
* xrdp will not duplicate/share the desktop's screen to the remote client,
* although I log in to the desktop with KDE, the client still use GNOME ('''neofetch'''),
* we need to use an account on the OS to log in (no separate account was created for xrdp),
* I use iPad's RDP to test.
<pre>
<pre>
sudo apt-get install xrdp
sudo apt install xrdp
sudo /etc/init.d/xrdp start
sudo systemctl status xrdp
</pre>
</pre>
 
<li>On Windows, open its Remote Desktop client utility '''mstsc.exe'''.
On Windows 7, open its Remote Desktop client utility '''mstsc.exe'''.
<li>Instruction from [https://wiki.radxa.com/Rockpi4/vnc Rock Pi 4].
 
</ul>
Instruction from [https://wiki.radxa.com/Rockpi4/vnc Rock Pi 4].


== Remote desktop connection to Windows 7 from xubuntu: rdesktop ==
== Remote desktop connection to Windows 7 from xubuntu: rdesktop ==
Line 98: Line 228:
</pre>
</pre>
where '''-f''' option means full screen and '''-g''' means geometry.
where '''-f''' option means full screen and '''-g''' means geometry.
= AnyDesk (cross platform) =
* [https://itsfoss.com/install-anydesk-ubuntu Install AnyDesk on Ubuntu Linux]. Not open source. Free for personal use.
* [https://linuxiac.com/remote-desktop-with-linux/ Remote Desktop with Linux: 5 Apps Which You Can Use]
* [https://askubuntu.com/a/1209967 Anydesk on Ubuntu does not save Unattended Access Security Setting]. However, it does not work on Lubuntu 20.04.


= Teamviewer =
= Teamviewer =
Line 109: Line 234:


== RustDesk ==
== RustDesk ==
* By default, it uses its own relay servers. But we can use our own relay server by running a docker container. Then we can install the client program on two machines.
* [https://youtu.be/9nzHm3xGz2I Rustdesk - an Open Source, Self Hosted alternative to TeamViewer, AnyDesk, GoToAssist, and the like] and [https://shownotes.opensourceisawesome.com/rustdesk/ Notes]
* [https://youtu.be/9nzHm3xGz2I Rustdesk - an Open Source, Self Hosted alternative to TeamViewer, AnyDesk, GoToAssist, and the like] and [https://shownotes.opensourceisawesome.com/rustdesk/ Notes]
* [https://youtu.be/PDnqFnnbVHg Pi-Hosted : Must Have Tool For System Admins - Rust Desk Open Source Remote Desktop Software] (video)
* [https://youtu.be/PDnqFnnbVHg Pi-Hosted : Must Have Tool For System Admins - Rust Desk Open Source Remote Desktop Software] (video)
* [https://apps.apple.com/us/app/rustdesk-remote-desktop/id1581225015 iOS] app from Apple App Store.


= Guacamole =
== AnyDesk (cross platform, closed-source) ==
* [https://itsfoss.com/install-anydesk-ubuntu Install AnyDesk on Ubuntu Linux]. Not open source. Free for personal use.
* [https://linuxiac.com/remote-desktop-with-linux/ Remote Desktop with Linux: 5 Apps Which You Can Use]
* [https://askubuntu.com/a/1209967 Anydesk on Ubuntu does not save Unattended Access Security Setting]. However, it does not work on Lubuntu 20.04.
* Ubuntu 22.04 works by some extra steps. Search "Anydesk - How to Fix Display_Server_Not_Supported Error for Linux". [https://stefanos.cloud/kb/how-to-resolve-anydesk-issues-in-ubuntu-linux/ How to resolve AnyDesk issues in Ubuntu Linux]. Tested on Ubuntu VM from Proxmox. The keyboard response is a little slow and unstable. Not sure if it is associated with Ubuntu 22.04 & wayland.
*# Type " sudo gedit /etc/gdm3/custom.conf "
*# Uncomment the line " WaylandEnable=false "
*# Change the line " AutomaticLogin = user1 " to " AutomaticLogin = $USERNAME
*# Uncomment the two lines " AutomaticLoginEnable = true " & " AutomaticLogin = $USERNAME "
*# Save the document and restart your Linux machine.
 
= Guacamole (Remote Desktop in the browser) =
* Apache Guacamole is a '''clientless''' remote desktop gateway. It supports standard protocols like VNC, RDP, and SSH.
** We call it clientless because no plugins or client software are required.
** Thanks to HTML5, once Guacamole is installed on a server, all you need to access your desktops is a web browser.
* [https://computingforgeeks.com/install-and-use-guacamole-on-ubuntu/ Install and Use Guacamole Remote Desktop on Ubuntu 20.04]
* [https://computingforgeeks.com/install-and-use-guacamole-on-ubuntu/ Install and Use Guacamole Remote Desktop on Ubuntu 20.04]
* [https://www.howtoforge.com/how-to-install-apache-guacamole-on-debian-11/ How to Install Apache Guacamole on Debian 11]
* [https://www.howtoforge.com/how-to-install-apache-guacamole-on-debian-11/ How to Install Apache Guacamole on Debian 11]
Line 119: Line 260:
* [https://dannyda.com/2020/06/12/how-to-create-a-remote-desktop-gateway-server-on-proxmox-ve-pve/ How to: Create a Remote Desktop Gateway server on Proxmox VE (PVE)]. After running the script and logging in, I don't get anything under "ALL CONNECTIONS". This is tested on Debian 11 VM. Reboot doesn't help.
* [https://dannyda.com/2020/06/12/how-to-create-a-remote-desktop-gateway-server-on-proxmox-ve-pve/ How to: Create a Remote Desktop Gateway server on Proxmox VE (PVE)]. After running the script and logging in, I don't get anything under "ALL CONNECTIONS". This is tested on Debian 11 VM. Reboot doesn't help.


= NoMachine and Amazon cloud =
== RPort ==
https://www.nomachine.com/accessing-your-remote-linux-desktop-on-amazon-elastic-compute-cloud-via-NoMachine
* https://rport.io/ - Self-hosted open source remote management solution for Windows, macOS & Linux.
 
** VPN, Public IP address, or Port forward is not necessary to access each remote machines
It seems nomachine is using port 4000.
** Use script execution function to automatically apply a system update on a remote machine
<pre>
** Two factor authentication:
odroid@odroid:~$ sudo nmap -sV localhost
*** Use the [https://kb.rport.io/install-the-rport-server/enable-two-factor-authentication/use-push-on-mobile-for-2fa Pushover app] to receive one-time tokens
 
*** Use [https://kb.rport.io/install-the-rport-server/enable-two-factor-authentication/use-totp TOTP] time-based one-time password
Starting Nmap 7.01 ( https://nmap.org ) at 2016-11-16 20:10 EST
* [https://techdirectarchive.com/2021/11/10/rport-free-and-open-source-remote-management-tool/ RPORT the free and open source remote management tool]
Nmap scan report for localhost (127.0.0.1)
* RPort has the ability to create a tunnel to a remote RDP server with a built-in HTTPS proxy and uses the '''Apache Guacamole Server''' to connect to the remote RDP Server. This brings the remote desktop into your browser without the need for an RDP viewer. However, you don’t need a fully featured Guacamole installation, only the guacd daemon is needed 1. RPort has its own version of '''guacd''' installed to /opt/rport-guacamole and by default, it listens only on localhost port 9445. See [https://oss.rport.io/advanced/rdp-proxy/ RDP-Proxy], [https://github.com/realvnc-labs/rport-guacamole Pre-compiled Guacamole Proxy Daemon packages].
Host is up (0.000051s latency).
Other addresses for localhost (not scanned): ::1
rDNS record for 127.0.0.1: odroid
Not shown: 997 closed ports
PORT    STATE SERVICE        VERSION
22/tcp  open  ssh            OpenSSH 7.2p2 Ubuntu 4ubuntu2.1 (Ubuntu Linux; protocol 2.0)
4000/tcp open  remoteanything?
7001/tcp open  X11            (access denied)
Service Info: OSs: Linux, Unix; CPE: cpe:/o:linux:linux_kernel


odroid@odroid:~$ sudo lsof -i :4000
* [https://youtu.be/Xc_5qE7ZyYA?t=542 RPort - an open source, self hosted Remote Machine Management System running on Linux!] (4/5/2022) & [https://wiki.opensourceisawesome.com/books/rport/page/installing-and-configure-rport-for-remote-monitoring-and-access Notes]
COMMAND PID USER  FD  TYPE DEVICE SIZE/OFF NODE NAME
** [https://youtu.be/Xc_5qE7ZyYA?t=826 RPort log in screen]
nxd    735  nx    3u  IPv4  19208      0t0  TCP *:4000 (LISTEN)
** [https://youtu.be/Xc_5qE7ZyYA?t=861 TOTP initializing] (time-based one-time passwords). Google, Microsoft, Bitwarden, ...
nxd    735  nx    4u  IPv6  21234      0t0  TCP *:4000 (LISTEN)
*** I used Microsoft. I press "+" and scan the QR code
</pre>
*** It'll send a code to my phone
*** I need to enter the code to the RPort login screen
*** Done. I've logged into RPort
** [https://youtu.be/Xc_5qE7ZyYA?t=929 RPort interface setup]
** [https://youtu.be/Xc_5qE7ZyYA?t=1148 Administering machines with RPort]
** [https://youtu.be/Xc_5qE7ZyYA?t=1176 See the current machines resources details including cpu, ram, disk]
** [https://youtu.be/Xc_5qE7ZyYA?t=1322 Graphical cpu/ram/network history]
** [https://youtu.be/Xc_5qE7ZyYA?t=1366 Tunnels] & SSH. After launching a tunnel, [https://youtu.be/Xc_5qE7ZyYA?t=1453 it opened Remmina] on that linux system. So we can log in through a secure tunnel that's being routed by my system. It's not the normal port 22 thing. It's actually running through out to internet and back through a [https://youtu.be/Xc_5qE7ZyYA?t=1510 secure tunnel]. If I don't do anything with my tunnel within 10 minutes, the tunnel will be closed and/or destroyed.
** [https://youtu.be/Xc_5qE7ZyYA?t=1526 Tunnels] & VNC. You do have to [https://youtu.be/Xc_5qE7ZyYA?t=1558 set up port forwarding on your router]. You can choose the option of noVNC.
** [https://youtu.be/Xc_5qE7ZyYA?t=1705 Add a new client]


[https://www.nomachine.com/ NoMachine]. I ran the service on my Ubuntu 12.04 server. I also tested the client on my Android 6.0 tablet and Odroid xu4 running Ubuntu 15.10. I am using the version 5.0.63. I need to use my server's user account info to connect.
* [https://youtu.be/qQCQ6dDwClY RPort - Update on using this Awesome Open Source Remote Machine Management system!] (3/9/2023) & [https://wiki.opensourceisawesome.com/books/rport/page/installing-and-configure-rport-for-remote-monitoring-and-access Notes]
{{Pre}}
** The tool is more like a remote machine management system, not remote support
odroid@odroid:~/Downloads$ ps -ef | grep nx
** It's nice we can install RPort on a Linux container such as Promox LXC
nx      12168    1  1 21:11 ?        00:00:20 /usr/NX/bin/nxserver.bin root 12151 --daemon
** If a fqdn is not provided, [https://kb.rport.io/install-the-rport-server/install-on-premises a random fqdn will be created according to the manual]. For my testing purpose, I use my local IP as the fqdn.
odroid  12199 12168  1 21:11 ?        00:00:12 /usr/NX/bin/nxnode.bin
** The RPort admin url is XXX.XXX.XXX.XXX:5000
nx      12225 12168 0 21:11 ?        00:00:00 /usr/NX/bin/nxd
** In the '''Inventory''' tab of a client, it can show "Update Status" & what can be updated.  
odroid  12263 12199  1 21:11 ?        00:00:13 /usr/NX/bin/nxclient.bin --monitor --pid 1153
** I create a client on Ubuntu. I also create an SSH tunnel (the client needs to have enabled openssh-server). After I launch the tunnel, it open Remmina from my Linux machine and connect to the client through RPort server IP and port 20000. By default, a tunnel will be closed after 5 minutes of inactivity.
nx      15916 12225 24 21:28 ?       00:00:08 /usr/NX/bin/nxserver.bin -c /etc/NX/nxserver --login -H 5
** Using [https://kb.rport.io/using-the-remote-access/creating-tunnels/vnc-via-browser noVNC] requires a VNC server running on the remote host.
odroid  15944 15916 33 21:29 ?       00:00:04 /usr/NX/bin/nxnode.bin -H 5
** Question: On a client machine such as linux, we need to run two commands "curl https://pairing.rport.io/swwGhEm > rport-installer.sh" & "sudo sh rport-installer.sh -x -s -r -b -i". If we don't need RPort anymore on the client machine, follow this: [https://kb.rport.io/digging-deeper/advanced-client-management/uninstall-the-rport-client remove RPort on a client]
odroid  16130  8527  0 21:29 pts/1    00:00:00 grep --color=auto nx
** Question: How do we remove RPort from the server? "ps -ef" shows "/usr/local/bin/rportd -c /etc/rport/rportd.conf". That is rportd is a server program. So if we kill the process, it'll not be running.
** After I restart the server, RPort is not started? To do that, we need to Run the server with systemd; see [https://oss.rport.io/get-started/quick-start/ Quick Start]


odroid@odroid:~/Downloads$ ls /usr/NX/bin
* [https://youtu.be/DZ0Ocwga43w Remote Desktop & Access Tools comparison between 4 great open source, self hosted options] & [https://wiki.opensourceisawesome.com/books/the-remote-access-application-comparison/page/comparing-4-open-source-remote-access-tools Notes] 2/1/2023. [https://youtu.be/DZ0Ocwga43w?t=128 4 columns] on the comparison table.
drivers      nxd        nxkb        nxplayer      nxsh        nxusbd
** Guacam (not in the video but in the Notes)
nxagent      nxesd      nxkeygen    nxplayer.bin  nxspool
** [https://github.com/realvnc-labs/rport RPort] 614 stars - has system monitoring, [https://kb.rport.io/using-the-remote-access/creating-tunnels/rdp-via-browser using browser for RDP]
nxauth        nxexec      nxlocate    nxpost        nxssh
** [https://github.com/Ylianst/MeshCentral MeshCentral] 2.4k stars - looks good in general. ''With Meshcentral you can start up pc (boot to BIOS / change boot order)''. [https://meshcentral2.blogspot.com/2020/11/meshcentral-multi-upload-live-cpu-file.html CPU/RAM usage in real time]
nxclient      nxfs        nxlpd      nxprint      nxssh-add
** [https://github.com/rustdesk/rustdesk RustDesk] 41.7k stars - like TeamViewer/Citrix
nxclient.bin  nxfsm      nxnode      nxserver      nxssh-agent
** [https://github.com/immense/Remotely Remotely] 3.4k stars - good for get a desktop support
nxcodec.bin  nxfsserver  nxnode.bin  nxserver.bin  nxtunctl
</pre>
If for some reason some nx programs disappeared, restart the service by
{{Pre}}
sudo /usr/NX/bin/nxserver --restart
</pre>


It is interesting that nomachine is faster than 'ssh -X' method when I tested running a Qt application launched from Qt Creator. For example, the progress bar is not moving when it is supposed to move forward and backward when the app is launched through 'ssh -X'.
= VM on Proxmox =
* https://pve.proxmox.com/wiki/VNC_Client_Access
* On iPad the '''noVNC''' method works fine. Not bad.
** I can open the virtual keyboard using the drawer on the LHS.
** The cursor/mouse is directly controlled by the finger we use.
** change Local Scaling in the drawer - settings.
* SPICE/Virt-viewer: [https://www.qnap.com/en/how-to/tutorial/article/how-to-use-the-spice-client-virt-viewer-to-connect-to-a-vm-console Windows] client only.
* [https://youtu.be/RW1pwM94rvQ VNC Client with a Proxmox VM]. It works when I use the Remmina client on Linux. But when I use RealVNC client on iPad, it will shut down the VM immediately.


= Remote desktop using Chrome =
= Remote desktop using Chrome =
Line 203: Line 346:
[https://youtu.be/_WMGcFv0QqQ Turbo charge your Headless Raspberry Pi]
[https://youtu.be/_WMGcFv0QqQ Turbo charge your Headless Raspberry Pi]


== Mirror/second screen ==
== Mirror/second screen: Deskreen ==
[https://youtu.be/EOzqhLPXLCY This Trick Allows You to Extend Your Display On any OS and Device!]. Turns any device with a web browser into a secondary screen for your computer over WiFi with this trick on Linux, Windows, or Mac. A dummy VGA or HDMI is needed.
[https://youtu.be/EOzqhLPXLCY This Trick Allows You to Extend Your Display On any OS and Device!]. Turns any device with a web browser into a secondary screen for your computer over WiFi with this trick on Linux, Windows, or Mac. A dummy VGA or HDMI is needed.
* WEYLUS ► https://github.com/H-M-H/Weylus (support wayland)
* WEYLUS ► https://github.com/H-M-H/Weylus (support wayland)
* Deskscreen ►  https://deskreen.com/lang-en (support wayland)
* Deskreen ►  https://deskreen.com/lang-en (support wayland)


= Remote desktop connection to NCI (outdated) =
= Remote desktop connection to NCI (outdated) =

Latest revision as of 11:29, 30 January 2024

Comparison

Comparison of remote desktop software

NoMachine

https://www.nomachine.com/accessing-your-remote-linux-desktop-on-amazon-elastic-compute-cloud-via-NoMachine

It seems nomachine is using port 4000.

odroid@odroid:~$ sudo nmap -sV localhost

Starting Nmap 7.01 ( https://nmap.org ) at 2016-11-16 20:10 EST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000051s latency).
Other addresses for localhost (not scanned): ::1
rDNS record for 127.0.0.1: odroid
Not shown: 997 closed ports
PORT     STATE SERVICE         VERSION
22/tcp   open  ssh             OpenSSH 7.2p2 Ubuntu 4ubuntu2.1 (Ubuntu Linux; protocol 2.0)
4000/tcp open  remoteanything?
7001/tcp open  X11             (access denied)
Service Info: OSs: Linux, Unix; CPE: cpe:/o:linux:linux_kernel

odroid@odroid:~$ sudo lsof -i :4000
COMMAND PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
nxd     735   nx    3u  IPv4  19208      0t0  TCP *:4000 (LISTEN)
nxd     735   nx    4u  IPv6  21234      0t0  TCP *:4000 (LISTEN)

NoMachine. I ran the service on my Ubuntu 12.04 server. I also tested the client on my Android 6.0 tablet and Odroid xu4 running Ubuntu 15.10. I am using the version 5.0.63. I need to use my server's user account info to connect.

odroid@odroid:~/Downloads$ ps -ef | grep nx
nx       12168     1  1 21:11 ?        00:00:20 /usr/NX/bin/nxserver.bin root 12151 --daemon
odroid   12199 12168  1 21:11 ?        00:00:12 /usr/NX/bin/nxnode.bin
nx       12225 12168  0 21:11 ?        00:00:00 /usr/NX/bin/nxd
odroid   12263 12199  1 21:11 ?        00:00:13 /usr/NX/bin/nxclient.bin --monitor --pid 1153
nx       15916 12225 24 21:28 ?        00:00:08 /usr/NX/bin/nxserver.bin -c /etc/NX/nxserver --login -H 5
odroid   15944 15916 33 21:29 ?        00:00:04 /usr/NX/bin/nxnode.bin -H 5
odroid   16130  8527  0 21:29 pts/1    00:00:00 grep --color=auto nx

odroid@odroid:~/Downloads$ ls /usr/NX/bin
drivers       nxd         nxkb        nxplayer      nxsh         nxusbd
nxagent       nxesd       nxkeygen    nxplayer.bin  nxspool
nxauth        nxexec      nxlocate    nxpost        nxssh
nxclient      nxfs        nxlpd       nxprint       nxssh-add
nxclient.bin  nxfsm       nxnode      nxserver      nxssh-agent
nxcodec.bin   nxfsserver  nxnode.bin  nxserver.bin  nxtunctl

If for some reason some nx programs disappeared, restart the service by

sudo /usr/NX/bin/nxserver --restart

It is interesting that nomachine is faster than 'ssh -X' method when I tested running a Qt application launched from Qt Creator. For example, the progress bar is not moving when it is supposed to move forward and backward when the app is launched through 'ssh -X'.

ThinLinc

ThinLinc Overview and Tutorial - How to Install and Utilize this Linux Remote Desktop Solution. Not successful from my testing. Also, the instruction "sudo apt remove thinlinc- " does not work to uninstall it. The admin guide has no information about uninstallation.

Remote desktop connection from Ubuntu to Ubuntu (vino)

  • Ubuntu Gnome Desktop (youtube) It works when I tested it on Ubuntu 18.04.
    sudo apt install vino
    # Go to GNOME settings -> sharing -> enable remote desktop. 
    # Type a password (not username is needed for remote desktop).
    sudo ufw allow from any to any port 5900 proto tcp
    sudo apt install dconf-editor 
    dconf-editor
    # go to org -> gnome -> desktop -> remote access -> require encryption -> turn it off
    

    In Remmina, type a new name. In the 'Protocol' drop-down list, select Remmina VNC plugin. Enter the server IP and enter the User password (again, no Username is needed). Hit "Connect". Done! Or use IP:5900 in order to quickly connect (use nmap localhost to check the exact VNC port).

  • How to Remote Access to Ubuntu 16.04 from Windows. The instruction is the same for older versions of Ubuntu.
    • On a Ubuntu server. Go to Dash, type 'desktop sharing' and select it. Check sharing. Close the dialog. Open a terminal and run ps -ef | grep vino to make sure the server is running.
    • Disable encryption. Run sudo apt install dconf-editor. Go to Dash and type 'dconf' and select 'dconf editor'. When it opens, navigate to org -> gnome -> desktop -> remote-access, and uncheck the value of 'require-encryption.' Another way is to run gsettings set org.gnome.Vino require-encryption false.
    • On a client machine (eg another Ubuntu), open a remote desktop client program (eg Remmina). Choose VNC as the protocol. Enter necessary information to connect to the server.
  • How to connect to a remote desktop from Linux Remmina's minimal UI makes it easy to remotely access Linux PCs and Windows 10
  • How to set up remote desktop on Ubuntu, access it from macOS
    $ gsettings set org.gnome.Vino require-encryption false
    $ gsettings get org.gnome.Vino require-encryption
    

Remmina

  • File sharing from Linux to Windows.
    • Remmina does not support drag and drop of files between the local and remote desktops. However, you can share a local folder with the remote desktop and access its contents from the remote machine. To do this, you need to create a new Remmina RDP connection or edit an existing one. In the “Basic” tab, choose a shared folder from a local Linux machine. In the “Advanced” tab, change the sound to local. Save the connection and connect to the remote desktop. The shared folder should now appear in the remote desktop’s file explorer

Tightvnc server

Tunnel the VNC traffic through SSH connection

On the server,

$ sudo apt remove --purge snapd
$ sudo apt-mark hold snapd

$ sudo apt update
$ sudo apt upgrade
$ sudo apt autoremove

$ sudo apt install xfce4 tightvncserver

$ tightvncserver  # require 8 characters for password

Now the client can connect to vnc://[IP address]:5901. TightVNC don't connect you to the desktop that you're logged into, but rather start a fresh one of their own. To kill the server, run vncserver -kill :1 .

Editing the startup script with nano .vnc/xstartup and at the very end add the line:

startxfce4&

Now restart TightVNC and this time when you connect you're interfacing directly with the Xfce desktop.

Tip 1: VNC server system startup script. VNC server on Ubuntu 20.04 Focal Fossa Linux. PS: I try to use /etc/rc.local file but "ps -ef | grep vnc" shows vncserver is not up automatically and "systemctl status rc-local.service" shows some problems even rc-local is active & running.

Tip 2: If you want to make your remote desktop remotely accessible, it's terrible to forward traffic in the router directly since VNC traffic is not encrypted as seriesly as SSH traffice. Instead we tunnel the VNC traffice over an SSH connection. On the client desktop, we first set up the SSH connection from our desktop to the server:

$ ssh [user]@[i-address] -L5901:localhost:59000

The SSH session starts as usual, but in the background we've connected port 59000 on our local machine to port 5901 on the host. So in the remote connection dialog, if we instead connected to localhost:59000, we are doing so over our SSH tunnel. For a server not hiding behind a home router, you should add a firewall rule to prevent access to VNC directly.

Tip 3: If we need to change the vnc password, we can do it via the command vncpasswd. How to change VNC password on Linux. This works for any VNC server software.

Client/viewer

RealVNC

RealVNC Is lame. On client, I need to

  1. Sign into the account
  2. Remember and type the server password.
  3. To use the virtual keyboard, I need to use my finger to click the virtual keyboard icon; not try to use the cursor to click the virtual keyboard icon.

It seems RealVNC will start itself again if it was not stopped when the OS shutdown.

Alternatives: TeamViewer or AnyDesk (no free plan). Raspberry Pi's documentation about VNC

The default vnc server included in Ubuntu is not quite compatible with other clients. For example I can connect to Ubuntu 14.04 from Ubuntu 16.04 but not from a Mac. The 3rd party software is better. See the following screenshot after I have installed RealVNC server.

Realvnc-server.png

Note that RealVNC Server is not free for commercial users but is free for home subscription/users up to 5 computers (running the server) & 3 users (team members); see https://manage.realvnc.com/. An email and a password can be used to sign in your account for activating the license in VNC Server.

To start VNC server, use (https://www.realvnc.com/docs/debian-install-remove.html)

sudo /etc/init.d/vncserver-x11-serviced start

The RealVNC will have an icon sitting on the tray at the top-right corner.

Before using VNC viewer, we also need to create a VNC password in VNC Server.

On Mac, the viewer can be launched from Applications -> VNC Viewer (if we have drag and drop the app to the Applications folder).

x11vnc

How to Connect with VNC to a Linux Computer Across the Network

Remote Desktop Protocol

GNOME RDP (preferred)

  • How to Remote Desktop to an Ubuntu Computer
    • VNC is it is no longer considered a secure protocol.
    • The VNC back end for the GNOME remote desktop functionality has been turned off by default in GNOME.
    • Wayland interferes with VNC.
  • VNC and RDP Ubuntu 22.04, Jammy Jellyfish, Remote Access, Screen Sharing, with lock screen fix (works when I tested on MS Remote Desktop Client app in iPad/macbook). This is based on GNOME RDP. There is no extra software to install.
    • Settings - Sharing - Turn on the Sharing toggle switch on the right corner of the Setting app.
    • Checked 'Remote Desktop'
    • Optionally checked 'Enable Legacy VNC Protocal' if you want to use VNC for connection
    • Checked 'Remote Control'
    • Optional: Change Authentication User Name/Password
    • In the Authentication section - change the password.
    • Press 'X' to close the dialog
  • Checking out Remote Desktop Solutions For Linux on Ubuntu 22.04 (GNOME 42). Before Ubuntu 22.04, users need to use a VNC client to connect to Ubuntu. But since Ubuntu 22.04, users can use either xrdp or vnc software to connect to Ubuntu desktop.
  • How to Install GNOME Desktop in Ubuntu 22.04 or 20.04. There are a few choices:
    • ubuntu-gnome-desktop package
    • ubuntu-desktop-minimal package
    • vanilla-gnome-desktop package
    • gnome-session package
    • Tasksel

Ubuntu 22.04 VNC

HomeLab 3: Install and configure Apache Guacamole as Docker Container

Remote desktop connection from Windows 7: xrdp

  • How to Install Xrdp Server on Debian 11
  • (2022/12/11). For some reason Ubuntu 22.04 does not work. Debian 11 GNOME does not work either. Debian 11 KDE works. No special instruction needed except when we log into Debian we need to select KDE Plasma. NOTE:
    • xrdp will not duplicate/share the desktop's screen to the remote client,
    • although I log in to the desktop with KDE, the client still use GNOME (neofetch),
    • we need to use an account on the OS to log in (no separate account was created for xrdp),
    • I use iPad's RDP to test.
    sudo apt install xrdp
    sudo systemctl status xrdp
    
  • On Windows, open its Remote Desktop client utility mstsc.exe.
  • Instruction from Rock Pi 4.

Remote desktop connection to Windows 7 from xubuntu: rdesktop

sudo apt-get update
sudo apt-get install rdesktop
rdesktop xxx.xxx.x.x -f -u USERNAME -p PASSWORD
rdesktop 192.168.1.4 -g 1280x720 -u USERNAME -p PASSWORD

where -f option means full screen and -g means geometry.

Teamviewer

RustDesk

AnyDesk (cross platform, closed-source)

Guacamole (Remote Desktop in the browser)

RPort

  • https://rport.io/ - Self-hosted open source remote management solution for Windows, macOS & Linux.
    • VPN, Public IP address, or Port forward is not necessary to access each remote machines
    • Use script execution function to automatically apply a system update on a remote machine
    • Two factor authentication:
      • Use the Pushover app to receive one-time tokens
      • Use TOTP time-based one-time password
  • RPORT the free and open source remote management tool
  • RPort has the ability to create a tunnel to a remote RDP server with a built-in HTTPS proxy and uses the Apache Guacamole Server to connect to the remote RDP Server. This brings the remote desktop into your browser without the need for an RDP viewer. However, you don’t need a fully featured Guacamole installation, only the guacd daemon is needed 1. RPort has its own version of guacd installed to /opt/rport-guacamole and by default, it listens only on localhost port 9445. See RDP-Proxy, Pre-compiled Guacamole Proxy Daemon packages.
  • RPort - Update on using this Awesome Open Source Remote Machine Management system! (3/9/2023) & Notes
    • The tool is more like a remote machine management system, not remote support
    • It's nice we can install RPort on a Linux container such as Promox LXC
    • If a fqdn is not provided, a random fqdn will be created according to the manual. For my testing purpose, I use my local IP as the fqdn.
    • The RPort admin url is XXX.XXX.XXX.XXX:5000
    • In the Inventory tab of a client, it can show "Update Status" & what can be updated.
    • I create a client on Ubuntu. I also create an SSH tunnel (the client needs to have enabled openssh-server). After I launch the tunnel, it open Remmina from my Linux machine and connect to the client through RPort server IP and port 20000. By default, a tunnel will be closed after 5 minutes of inactivity.
    • Using noVNC requires a VNC server running on the remote host.
    • Question: On a client machine such as linux, we need to run two commands "curl https://pairing.rport.io/swwGhEm > rport-installer.sh" & "sudo sh rport-installer.sh -x -s -r -b -i". If we don't need RPort anymore on the client machine, follow this: remove RPort on a client
    • Question: How do we remove RPort from the server? "ps -ef" shows "/usr/local/bin/rportd -c /etc/rport/rportd.conf". That is rportd is a server program. So if we kill the process, it'll not be running.
    • After I restart the server, RPort is not started? To do that, we need to Run the server with systemd; see Quick Start

VM on Proxmox

  • https://pve.proxmox.com/wiki/VNC_Client_Access
  • On iPad the noVNC method works fine. Not bad.
    • I can open the virtual keyboard using the drawer on the LHS.
    • The cursor/mouse is directly controlled by the finger we use.
    • change Local Scaling in the drawer - settings.
  • SPICE/Virt-viewer: Windows client only.
  • VNC Client with a Proxmox VM. It works when I use the Remmina client on Linux. But when I use RealVNC client on iPad, it will shut down the VM immediately.

Remote desktop using Chrome

X2Go

used in Linux Data Science Virtual Machine by Microsoft.

Remote desktop connection through vmware workstation

We shall be able to remote desktop connect to a Windows guest machine if the guest machine has configured to use bridge connection and a static IP. If there is a problem, it is likely caused by Window's firewall. See the two screenshots. We can just turn off the firewall of home network but keep the firewall on for the public network.

We don't need to use port forward for the remote desktop connection.

ViewActiveNetwork.png Firewall.png

Share your keyboard and mouse between computers: KVM

Why You No Longer Need a KVM Switch for Multi-PC Setups

Barrier

Share your keyboard and mouse between computers with Barrier

Barrier KVM - Contol Multiple Computers With Single Keyboard & Mouse (youtube)

TinyPilot

TinyPilot Use your Raspberry Pi as a browser-based KVM

Dummy HDMI adapter

VNC + headless Raspberry Pi

Turbo charge your Headless Raspberry Pi

Mirror/second screen: Deskreen

This Trick Allows You to Extend Your Display On any OS and Device!. Turns any device with a web browser into a secondary screen for your computer over WiFi with this trick on Linux, Windows, or Mac. A dummy VGA or HDMI is needed.

Remote desktop connection to NCI (outdated)

Note the information here is outdated now.

The version 1.7.1 of rdesktop program in Ubuntu 14 has a bug with mouse cursor (invisible). To fix the bug, download the version 1.8.3 and build it. See http://ubuntuforums.org/showthread.php?t=2266743

sudo apt-get update
sudo apt-get install build-essential libx11-dev libssl-dev libgssglue-dev libpcsclite-dev
tar zxvf rdesktop-1.8.3.tar.gz 
cd rdesktop-1.8.3
./configure
make
sudo make install

After that the new rdesktop is located under /usr/local/bin folder. The old rdesktop installed through apt-get is not deleted.

ts.nci.nih.gov:1494

DOMAIN: NIH

resolution: 1024 x 768

Use remmina or rdesktop or freerdp (sudo apt-get install freerdp-x11)

rdesktop ts.nci.nih.gov:1494 -d NIH -u XXXXX -g 1024x768

To share a folder from the local machine, use "-r" option

rdesktop ts.nci.nih.gov:1494 -d NIH -u XXXXX -g 1280x1024 -r disk:remotedisk=/home/$USER/Downloads

The new secure connection relies on the SmartCard is using ncits-p111.nci.nih.gov.