Connect to Linux GUI remotely

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
jack0987
Level 3
Level 3
Posts: 127
Joined: Fri Jul 18, 2014 9:24 pm

Connect to Linux GUI remotely

Post by jack0987 »

Is it possible to connect to my linux computer GUI remotely from Windows. In my case Windows 10.

What are my options? Are they free? Thanks.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
djph
Level 7
Level 7
Posts: 1928
Joined: Thu Jun 27, 2019 5:43 am
Location: ::1

Re: Connect to Linux GUI remotely

Post by djph »

teamviewer, anydesk, vnc, probably others as well.

Though, what's your end-goal of the remote access? (moving files around, email, general browsing, something else?)
jack0987
Level 3
Level 3
Posts: 127
Joined: Fri Jul 18, 2014 9:24 pm

Re: Connect to Linux GUI remotely

Post by jack0987 »

djph wrote: Tue Sep 21, 2021 6:40 am teamviewer, anydesk, vnc, probably others as well.

Though, what's your end-goal of the remote access? (moving files around, email, general browsing, something else?)
Files, run programs, cross platform. For the time being, I would like to access my linux computer from my Windows 10 one.

From what I am reading, teamviewer seems to be considered the best choice. However it does not appear to be free.
I wonder just how expensive it is.
djph
Level 7
Level 7
Posts: 1928
Joined: Thu Jun 27, 2019 5:43 am
Location: ::1

Re: Connect to Linux GUI remotely

Post by djph »

The teamviewer website says it's free for personal, non-commercial use.

it should work for the uses you've mentioned. Might have some limitations in terms of what applications work "nicely" and all (especially file transfer), but it's probably the easiest to run with.

File transfer itself may be easier with nextcloud (or dropbox/gdrive if you have those; although I think they've been pulling away from "Linux Support" in their desktop-sync clients).
ivar
Level 5
Level 5
Posts: 617
Joined: Sun Mar 21, 2021 10:30 pm
Location: far north

Re: Connect to Linux GUI remotely

Post by ivar »

nomachine works well also
ralplpcr
Level 6
Level 6
Posts: 1096
Joined: Tue Jul 28, 2015 10:11 am

Re: Connect to Linux GUI remotely

Post by ralplpcr »

Teamviewer is probably the best in terms of performance & ease of use. That being said, it is definitely NOT open source, and you are not "free" to do whatever you wish with the unpaid version. If they detect that you're located on a network they deem "a corporate environment", you'll be restricted to 5 minute connections only. File transfers through the app are slow, but it is probably the most stable for the minimum of effort in configuring.

AnyDesk is a close 2nd, in my opinion. It takes a little fiddling to get the settings just right, but once it's set you end up with very similar performance to Teamviewer. It does NOT have the restrictions of "you're on a business network and must pay" that Teamviewer does. I use it frequently when I need to connect to a remote system on a different network. File transfers are still slow through the app, but they're mostly bearable.

If your two computers are on the *same* network (ie - one upstairs & one downstairs in your own house), then the best option might be to install an RDP client on your Linux box. I've had good luck with xRDP, but there are several others you can use. Once you have that running on Linux, connecting from Windows is as easy as firing up the built-in Remote Desktop Connection. You get basically the exact same features as you would with a RDP connection to a Windows box, with excellent speed and reliability. There is no file transfer protocol in RDP, but setting up SAMBA solves that handily.

You mentioned "running programs" as one of your desired functions. Be aware that with *any* remote connection protocol, certain operations will break the connection - especially if they interfere or alter the network connection. If a reboot occurs on the remote machine, you need to make sure that whatever remote software is being used will auto-start at bootup - - otherwise, you'll have to log in physically before being able to reconnect.

edit: it is xRDP I've been using, not FreeRDP
User avatar
AndyMH
Level 21
Level 21
Posts: 13728
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Connect to Linux GUI remotely

Post by AndyMH »

ralplpcr wrote: Wed Sep 22, 2021 7:00 am If your two computers are on the *same* network (ie - one upstairs & one downstairs in your own house), then the best option might be to install an RDP client on your Linux box.
For that use case I find nomachine easiest, it just works 'out of the box'. Remoting into other computers across the internet I use anydesk and prefer it to teamviewer.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
jack0987
Level 3
Level 3
Posts: 127
Joined: Fri Jul 18, 2014 9:24 pm

Re: Connect to Linux GUI remotely

Post by jack0987 »

AndyMH wrote: Wed Sep 22, 2021 9:37 am
ralplpcr wrote: Wed Sep 22, 2021 7:00 am If your two computers are on the *same* network (ie - one upstairs & one downstairs in your own house), then the best option might be to install an RDP client on your Linux box.
For that use case I find nomachine easiest, it just works 'out of the box'. Remoting into other computers across the internet I use anydesk and prefer it to teamviewer.
Thanks to both of you.

I am having troubles with team viewer and because of their invasive nature I think I will be inclined not to use them at this time.

I am considering xRDP but will look at nomachine and anydesk.

I need xRDP to work on the local network as well as over the web. Are there problems?
ralplpcr
Level 6
Level 6
Posts: 1096
Joined: Tue Jul 28, 2015 10:11 am

Re: Connect to Linux GUI remotely

Post by ralplpcr »

jack0987 wrote: Wed Sep 22, 2021 10:12 am ....I need xRDP to work on the local network as well as over the web. Are there problems?
xRDP is intended to work when the two machines are on the same network. It generally WILL NOT work over the web - - though there are ways around that through a VPN.

If you're looking to connect over the internet, AnyDesk is my recommendation for a free & simple method. You do need to set a password for "unattended access" on the remote machine, as well as copy the "remote desk" number so you can tell AnyDesk where to connect....but otherwise the default settings should be adequate. It's available for both Linux and Windows.
jack0987
Level 3
Level 3
Posts: 127
Joined: Fri Jul 18, 2014 9:24 pm

Re: Connect to Linux GUI remotely

Post by jack0987 »

ralplpcr wrote: Wed Sep 22, 2021 10:19 am
jack0987 wrote: Wed Sep 22, 2021 10:12 am ....I need xRDP to work on the local network as well as over the web. Are there problems?
xRDP is intended to work when the two machines are on the same network. It generally WILL NOT work over the web - - though there are ways around that through a VPN.
xRDP may very well work over the web. You need to do port forwarding in your router to port 3389.
he default port of RDP. Please refer to this link:

https://www.linuxtoday.com/blog/setting ... %20Windows

Since the default RDP port is 3389, a port change may be in order to avoid conflicts with multiple computers on the network.
I have changed all of my RDP ports to different numbers and do not use 3389 at all.

From outside the local network I access them like this: <local network ip>:<port number>
Note the ":".

Of course, you have to know the ip address of your network. If the address is static your good to go. If it is dynamic, you will need to know when it changes.

Another issue with RDP is that hackers search for it and will run passwords in the hope of gaining access. Use a real good password.
In addition, on Windows you can restrict which ip addresses are allowed to connect. Use this feature on Windows RDP if you can.
I do not know if xPDP will do this.

EDIT: RDP does not have an autoban feature that I know of. It really should.
ivar
Level 5
Level 5
Posts: 617
Joined: Sun Mar 21, 2021 10:30 pm
Location: far north

Re: Connect to Linux GUI remotely

Post by ivar »

ivar wrote: Tue Sep 21, 2021 11:52 am nomachine works well also
I did not notice "remotely" at first ... :oops: - I've set up an OpenVPN tunnel to an asus router at my remote location. So then I can run ssh or nomachine over the vpn tunnel
ralplpcr
Level 6
Level 6
Posts: 1096
Joined: Tue Jul 28, 2015 10:11 am

Re: Connect to Linux GUI remotely

Post by ralplpcr »

jack0987 wrote: Wed Sep 22, 2021 4:42 pm xRDP may very well work over the web. You need to do port forwarding in your router to port 3389.
he default port of RDP. .....<snip>
Another issue with RDP is that hackers search for it and will run passwords in the hope of gaining access. Use a real good password.
In addition, on Windows you can restrict which ip addresses are allowed to connect. Use this feature on Windows RDP if you can.
I do not know if xPDP will do this.

EDIT: RDP does not have an autoban feature that I know of. It really should.
Yes, you are correct - - that is another possible way around it, however it gets messy. Especially when you consider NAT, and if there is more than 1 computer sitting behind the home router. And as you mentioned, if your IP address isn't static, that adds another twist into the mix.

Could it be done that way? Probably. Should it? I guess it depends on you? Personally, I only use xRDP either to connect to my company's machines when I'm logged into their VPN *or* between machines located in my own house. I use AnyDesk for "other" remote machines. If they're not in a protected network, I don't necessarily trust Microsoft's RDP protocol to do a thing to prevent the hacking you mention.
jack0987
Level 3
Level 3
Posts: 127
Joined: Fri Jul 18, 2014 9:24 pm

Re: Connect to Linux GUI remotely

Post by jack0987 »

ralplpcr wrote: Wed Sep 22, 2021 6:30 pm Yes, you are correct - - that is another possible way around it, however it gets messy. Especially when you consider NAT, and if there is more than 1 computer sitting behind the home router. And as you mentioned, if your IP address isn't static, that adds another twist into the mix.

Could it be done that way? Probably. Should it? I guess it depends on you? Personally, I only use xRDP either to connect to my company's machines when I'm logged into their VPN *or* between machines located in my own house. I use AnyDesk for "other" remote machines. If they're not in a protected network, I don't necessarily trust Microsoft's RDP protocol to do a thing to prevent the hacking you mention.
As a plus, my WAN ip address is static.
I am going to use xRDP and RDP for now because it is what I know the most about.
I will still look at AnyDesk and VPN. My present lack of knowledge here is holding me back here from what may be better options as you have stated.

As you said, it can be messy in that there are a lot of configuration changes to be done. For computers on the local network, I assign them a static ip address. I then give each one it's own port number. Going further, I then add restrictions for the ip addresses that are allowed to connect to them. Since there is no autoban feature to RDPs, it is a big open door to hackers when you go out on to the web.

Do you know if you can set allowed ip addresses with xRDP.
ivar
Level 5
Level 5
Posts: 617
Joined: Sun Mar 21, 2021 10:30 pm
Location: far north

Re: Connect to Linux GUI remotely

Post by ivar »

for autoban , I'd think you can use Fail2ban?
ralplpcr
Level 6
Level 6
Posts: 1096
Joined: Tue Jul 28, 2015 10:11 am

Re: Connect to Linux GUI remotely

Post by ralplpcr »

jack0987 wrote: Thu Sep 23, 2021 8:34 am Do you know if you can set allowed ip addresses with xRDP.
I don't think you can directly, but you can set them up indirectly via Linux's built-in ufw firewall?

It takes a little configuration, but once you've got the syntax figured out you can set it to allow/disallow specific IP addresses or subnets, particular ports, or even specify TCP or UDP protocols.

There is a pretty decent tutorial for ufw on this site: https://www.linuxbabe.com/security/ufw-firewall-debian-ubuntu-linux-mint-server

Once you have enabled ufw, you set the rules via the terminal. For example, if you wanted to permit INPUT to port 3389 from the 192.168.0.0/24 network only (typical home subnet with up to 256 IPs available), you would enter:

Code: Select all

sudo ufw allow 3389/tcp
sudo ufw insert 1 allow in from 192.168.0.0/24 to any port  3389 proto tcp
Want to BLOCK output to a specific machine?

Code: Select all

sudo ufw insert 1 deny out to 12.34.56.78
...and so forth.

[You do need to perform a sudo systemctl restart ufw after each operation]

You can check the status of ufw by using the command sudo ufw status numbered. Keep in mind: Rules are acted upon in order - - if you have DENY before an ALLOW, the DENY is acted upon first.

Code: Select all

ralplpcr@example~ $ sudo ufw status numbered
Status: active

     To                         Action      From
     --                         ------      ----
[ 1] 7070/tcp                   ALLOW IN    192.168.137.0/24          
[ 2] 5900/tcp                   ALLOW IN    192.168.137.0/24          
[ 3] 3389/tcp                   ALLOW IN    192.168.137.0/24          
[ 4] 3306/tcp                   ALLOW IN    192.168.137.0/24          
[ 5] 3701/tcp                   ALLOW IN    192.168.137.0/24          
[ 6] 445/tcp                    ALLOW IN    192.168.137.0/24          
[ 7] 443/tcp                    ALLOW IN    192.168.137.0/24          
[ 8] 139/tcp                    ALLOW IN    192.168.137.0/24          
[ 9] 80/tcp                     ALLOW IN    192.168.137.0/24          
[10] 22/tcp                     ALLOW IN    192.168.137.0/24          
[11] 21/tcp                     ALLOW IN    192.168.137.0/24          
[12] 10.0.0.0/8                 ALLOW OUT   Anywhere                   (out)
[13] Anywhere                   DENY OUT    Anywhere                   (out)
[14] Anywhere (v6)              DENY OUT    Anywhere (v6)              (out)

ralplpcr@example~ $ 
There is also a graphical interface you can use (gufw in the software manager), however I haven't found it to be particularly useful. :wink:

Hope this helps?
jack0987
Level 3
Level 3
Posts: 127
Joined: Fri Jul 18, 2014 9:24 pm

Re: Connect to Linux GUI remotely

Post by jack0987 »

I may need to make a change.

xRDP starts a new session on the remote computer. This is an undesired effect.

AnyDesk appears to be a subscription service and will get a thumbs down along with Teamviewer for now.

That leaves me searching for other alternatives.

How about x0vcnserver?
ralplpcr
Level 6
Level 6
Posts: 1096
Joined: Tue Jul 28, 2015 10:11 am

Re: Connect to Linux GUI remotely

Post by ralplpcr »

AnyDesk does have the possibility of subscribing/paying, but it isn't required. I've been using it for several years just fine - - most recently, I installed it on my mother's laptop and have been able to successfully connect to/control it from ~600mi away.

Check out https://anydesk.com/en/free-remote-desktop-access.
I try not to abuse it, but I've got over 30 machines to which I'll connect, and have had no complaints? You *are* limited to only 2 or 3 active connections at any time if you don't pay....but since there is no email or registration required, it's been good enough for me?

Never tried x0vcnserver - - may be worth a shot?
jack0987
Level 3
Level 3
Posts: 127
Joined: Fri Jul 18, 2014 9:24 pm

Re: Connect to Linux GUI remotely

Post by jack0987 »

Just tried NoMachine and it appears to be working perfectly for me right out of the box.

Anydesk is giving me troubles where it will not connect to the remote machine unless I go to the remote and accept the connection.
Any idea what I might do?
ralplpcr
Level 6
Level 6
Posts: 1096
Joined: Tue Jul 28, 2015 10:11 am

Re: Connect to Linux GUI remotely

Post by ralplpcr »

jack0987 wrote: Fri Sep 24, 2021 3:56 pm Anydesk is giving me troubles where it will not connect to the remote machine unless I go to the remote and accept the connection.
Any idea what I might do?
Set a password for "unattended access" on the remote machine.
Reboot if it's the Windows machine.
If it's the Linux machine, you can close all instances of AnyDesk, and then run sudo systemctl restart anydesk. (or do a reboot, if you prefer?)

You also need to make sure that AnyDesk is started up in order to connect.
I *think* Windows adds AnyDesk to the "startup programs" automatically. All that should be needed there is the "unattended access" password. (you choose your own password)
In Linux, I added a launcher to /usr/bin/anydesk --tray in the startup programs, and then added the "unattended access" password I wanted.

Like I said, AnyDesk requires a little "fiddling" to get it just right....if NoMachine does what you want, by all means feel free to use it. :wink: I'm just sharing what *I* did in a similar situation. It works for me?
User avatar
AndyMH
Level 21
Level 21
Posts: 13728
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Connect to Linux GUI remotely

Post by AndyMH »

ralplpcr wrote: Fri Sep 24, 2021 5:39 pm You also need to make sure that AnyDesk is started up in order to connect.
I *think* Windows adds AnyDesk to the "startup programs" automatically. All that should be needed there is the "unattended access" password. (you choose your own password)
Anydesk automatically added itself to startup apps when I installed it, not what I wanted so turned it off.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Locked

Return to “Beginner Questions”