0

My main computer is dual boot (Ubuntu 20.04, Windows 10) and connected to our family TV. Sometimes I'm working on something and somebody else wants to use the TV so I have to leave it as they switch over to the cable box. If I'm logged into Windows 10, I can just go to my Ubuntu laptop, open Remmina, start an RDP session, and everything I was working on pops up exactly as I left it on my laptop. I'm still logged in, all my windows are still open, etc.

However, if I'm logged into Ubuntu on the TV, I can't seem to find a setup that works the same. VNC seems useless because my laptop resolution is so much smaller than the computer I'm connecting to, so I can only see a small portion of my screen. I tried installing xrdp and remoting in that way, but when I do, I can't see any of my previously open windows. It's as if I'm being logged into a different user or session. To make things worse, if I had Firefox open on the main computer I can't open it on the laptop because it says there's already an instance open even though I can't see it.

I'm just looking for a setup that works just like my Ubuntu laptop remoting into a Windows 10 session. Any help is much appreciated. Thanks!

Billy
  • 55
  • 1
  • 6
  • 1
    Xrdp only works if you are not logged in. It won't work with an existing session. You can try AnyDesk. You can set it up for unattended access. – user68186 Feb 06 '22 at 01:03
  • I was able to get xrdp working while logged in by following a solution that involved editing the /etc/xrdp/startwm.sh file and adding a couple lines.
    `unset DBUS_SESSION_BUS_ADDRESS`  
    `unset XDG_RUNTIME_DIR`  
    
    

    That said, I couldn't see any of my already open windows. I'll give AnyDesk a try, thanks.

    – Billy Feb 06 '22 at 01:12
  • 1
    Let me know if AnyDesk works for you. I will convert my comments to an answer. – user68186 Feb 06 '22 at 01:24
  • 1
    I'm trying it out right now. It's not 100% the same since it's more like screen sharing than logging in. When I use RDP from Ubuntu to access Windows 10, the session opens at the same size and resolution as my laptop so it looks native. With AnyDesk it will stretch or shrink the screen to fit my laptop as best as it can, but since the aspect ratio is different I have grey bars at the top and bottom that I haven't been able to solve yet. That said, the performance is quite good and this is definitely a 95% solution and something I can work with. Thanks! – Billy Feb 06 '22 at 01:43
  • If you think the answer below is correct then please click on the gray check mark next to it and turn it green ✅. This will mark the problem as solved and help others. – user68186 May 20 '22 at 19:52

1 Answers1

0

Update for Ubuntu 22.04 and above

Ubuntu 22.04 and above now allows RDP (and legacy VNC) protocol for remote desktop sharing and control when the user is logged in. This method uses the app Gnome Remote Desktop in the remote computer and is configured through the System Settings app.

enter image description here

The screenshot above shows the RDP preotocol setup.

Notes

  1. You must be locally logged in, in the remote computer (attached to TV). If you are logged out, this will not work.
  2. When using Remmina or Windows RDP in your laptop to connect to the desktop you will need to use the username and password set up in the Settings page above.
  3. See Connect when Remote Desktop is on login screen or screen locked (without autologin) for how to add the gnome extension Allow Locked Remote Desktop so that the remote computer can be accessed even with the screen is locked.

Original Answer

Limitation of Gnome

Xrdp (the RDP protocol) works differently in Windows and in Ubuntu. In particular, gnome does not allow xrdp to access an existing local session. In other words, you can use xrdp only when you are logged out of the local session. Similarly, if you remain logged in remotely using xrdp, you won't be able to login to the deskop locally until you logout or kill the remote session from the terminal.

VNC Option -geometry

You can add the -geometry WxH option to the VNC server startup script. Where W is the width of your laptop screen and H is the height. For example, my laptop has the native resolution of 1366x768. So, I can use -geometry 1366x768. This scales everything down to fit my laptop but it makes the words on the remote screentoo small for me to read.

Other Software

There are some closed-source but free for non-commercial use software you can try.

I have not tried NoMachine. I have tried both AnyDesk and TeamViewer and they both work. I like AnyDesk because it is a leaner app as compared with TeamViewer and NoMachine. for example, the deb file download size of the three apps at the time of this writings are:

  • AnyDesk 5.3 MB
  • NoMachine 47.8 MB
  • TeamViewer 68.1 MB

AnyDesk

Download and install AnyDesk in both the main computer and the laptop. The same software works as a client and a server. The installation process will add its PPA to the list of repositories, and AnyDesk will be updated like most Ubuntu software.

Unattended Access

By default AnyDesk does not allow unattended access. That is, when someone tries to remotely access your main computer using AnyDesk you will have to accept the connection from within the main computer. This is not possible in your use-case.

Open AnyDesk on your main computer. Click on the "hamburger" menu icon on the top left corner and click on Settings

Go to the Security tab on the right panel of the Settings window.

enter image description here

You have to click on the Unlock Security Settings and enter your password to get this page to work. Once unlocked you will see a page like this:

enter image description here

Check the Enable Unattended Access box and set a password. If you want you can also enable Two Factor Authentication. This will require installing an app on your phone that can generate two factor authentication tokens, such as Google Authenticator, or Authy.

Finally, note down the AnyDesk ID number of your main computer. You can see it under the This Desk heading on the left panel.

enter image description here

You can close the Anydesk app on the Main computer. The app need not be open for remote access.

On your laptop open AnyDesk and enter the ID number of the main computer in the Remote Desk box on the left panel and click on the Play icon ▶.

Hope this helps

user68186
  • 33,360