# How to connect via remote desktop from Windows 10 to freebsd



## Truculent_Freddi (May 12, 2021)

I need to connect remotely to freebsd from under Windows so that I can work with the system and at the same time have a graphical interface for convenient work


----------



## zirias@ (May 12, 2021)

net/xrdp


----------



## Geezer (May 12, 2021)

You cannot rpd from windows to freebsd. You can use vnc, with the server on freebsd and client on windows.


----------



## zirias@ (May 12, 2021)

Geezer said:


> You cannot rpd from windows to freebsd.


Sure you can. Just install and configure net/xrdp.

Here's a screenshot with a local fvwm session and FreeRDP connected to a remote machine running a KDE/Plasma session:








						FreeBSD Screen Shots
					

I prefer Xfce and a minimalistic look. Very satisfied with the look of my FreeBSD 12.2 system :)   I also like it minimal ;)  GTK & Openbox theme: https://www.gnome-look.org/p/1350205/ Icon Theme: x11-themes/numix-icon-theme + x11-themes/numix-icon-theme-circle  Using: x11-wm/openbox with x11/tint




					forums.freebsd.org
				




And here the same from a Windows machine:


----------



## Geezer (May 12, 2021)

So you can, look at that.



> Xrdp uses Xvnc or X11rdp to manage the X session



What a re the pros and cons of X11rdp over VNC?


----------



## kpedersen (May 12, 2021)

One I tend to use is ssh/x11 forwarding. I still find it faster than Xvnc and Xrdp (which uses Xvnc underneath anyway). Especially over LAN. I even use it for a few 3D simulation tools.

You can get a decent free Windows X11 server here: https://sourceforge.net/projects/vcxsrv/
Then you can use the inbuilt Windows SSH client (or putty/plink that VcXsrv provides).


----------



## kpedersen (May 12, 2021)

debguy said:


> OpenGL is still _not_ easily transported and isn't something people are doing (not using Wayland or XCB anyhow).


It is a little disappointing that the industry has dropped the ball on this. And to be fair, Vulkan's design doesn't really lend as well to this as OpenGL did.

However it does open up potential business opportunities for those relatively few companies who really do need remote graphics. We have a general offering for that: http://thamessoftware.co.uk/hydra.html. Mostly developed because it interested us personally rather than some great monetization opportunity haha.

That said, computers are getting so fast (for software rendering) and networks are getting fast (for streaming a rasterized image) that I can half understand why there is discontinued interest in this design. Even if it does feel wasteful.


----------



## 6502 (May 12, 2021)

Or Xming instead of VNC.


----------



## kpedersen (May 12, 2021)

6502 said:


> Or Xming instead of VNC.


I used to use that, however the free offering has become a little out of date. I would recommend VcXsrv instead.


----------



## sko (May 12, 2021)

I'm using [ports]deskutils/anydesk[/ports] to access windows clients and some FreeBSD hosts from my FreeBSD workstations. It also works the other way around (windows -> freebsd). You just have to set a password for unattended remote access, then you don't need to manually accept the incoming connection on the remote host.

The port sometimes lacks behind the official release, but you can just download the prebuilt binary from anydesk.com and run it.


----------



## zirias@ (May 12, 2021)

kpedersen said:


> I still find it faster than Xvnc and Xrdp (which uses Xvnc underneath anyway)


Xrdp has the option of RDP integrated into the X server using x11-drivers/xorgxrdp. This should perform quite nice, but unfortunately, it doesn't work on my machine (segfaults, PR 238736…)  Still, Xvnc works "good enough" for most applications here.



Geezer said:


> What a re the pros and cons of X11rdp over VNC?


I think RDP is conceptually quite nice, as it provides session start with login, but also transferring a session to a different client or even letting it run disconnected. OTOH, it doesn't provide accessing the same session from two clients simultaneously.

IMHO, it's nice that the client comes with the Windows base system.


----------



## Geezer (May 12, 2021)

Zirias said:


> IMHO, it's nice that the client comes with the Windows base system.


It seems ironic that you can get the RDP client and server from the packages on freebsd, but on windows (ordinary version) you only get the client.


----------



## zirias@ (May 12, 2021)

Geezer said:


> It seems ironic that you can get the RDP client and server from the packages on freebsd, but on windows (ordinary version) you only get the client.


That's not true. Every Windows version I've seen so far includes an RDP service as well (but you have to explicitly activate it).

What's unfortunately true is that Windows has artificial limitations on the number of sessions that can run in parallel: Only a single one on the "desktop" editions (means you're either logged in locally or via RDP), only two on "server" editions. If you want more, you need a server version and install a feature that requires extra licensing…

Of course, there are ways around that by patching, but don't tell  

(edit: ok, "every Windows version" since RDP was available at all of course. There's no such thing in Win95 and older, hehe)


----------



## Geezer (May 12, 2021)




----------



## zirias@ (May 12, 2021)

Ah great. I never used a "home edition" (for other reasons, you can't even add it to a domain). Didn't know it was crippled regarding RDP as well


----------



## Geezer (May 12, 2021)

I've got a pro edition in bhyve and rdp into it.

The old desktop with the home version does not get much use now, but is useful for the brother printer/scanner.


----------



## kpedersen (May 12, 2021)

Wow, that seems like a bit of a regression. I could have sworn Windows XP and 7 (incl Home Edition) allowed that for one user. That said, I think Windows 7 Pro only allows one user connected at a time so they might have reduced functionality even more for Home.


----------



## zirias@ (May 12, 2021)

kpedersen said:


> Wow, that seems like a bit of a regression. I could have sworn Windows XP and 7 (incl Home Edition) allowed that for one user.


Never used any home edition, so I don't know, but if that's the case – sure, you gotta sell your "professional" editions somehow  Artificial crippling is the way to go…


kpedersen said:


> That said, I think Windows 7 Pro only allows one user connected at a time


See above  Even the server versions have a limitation, but they allow two sessions. For anything else, you're supposed to buy additional licenses…

Thanks for free software, no such issue with e.g. xrdp and samba


----------



## kpedersen (May 12, 2021)

Zirias said:


> Never used any home edition, so I don't know, but if that's the case – sure, you gotta sell your "professional" editions somehow  Artificial crippling is the way to go…


Hah yeah. Rather than add valuable features (involving paying developers, testing, project management, etc), you can just take existing features away and hold them ransome 

I keep forgetting how impossibly sleazy and tacky commercial operating systems / software in general is.


----------



## SirDice (May 13, 2021)

In case anyone is wondering, I removed a bunch of debguy 's drivel from the thread.


----------



## astyle (May 13, 2021)

One thing about this thread surprised me to no end: Xorg long had the capacity to do X11 forwarding. When I was in college back before 2005, I could log into one Linux machine 1, SSH into the machine right next to me (machine 2), and run machine 2's locally installed kwrite on my machine 1, no RDP or anything special required. on Windows, you can use MobaXterm to do the same thing, and it doesn't matter if you have Home edition or not.

I guess it pays to pay attention to the direction of the connections being made - this thread says FROM windows TO freebsd. Most of the posts were focused on doing it the other way around. Sigh.


----------



## kpedersen (May 13, 2021)

astyle said:


> I guess it pays to pay attention to the direction of the connections being made - this thread says FROM windows TO freebsd. Most of the posts were focused on doing it the other way around. Sigh.


Yeah I had to check my solution again but I seem to have gotten it right. 

VcXsrv running on Windows -> SSH -> FreeBSD

I was so hoping Microsoft's WSL layer was going to get a native inbuilt X11 server but they went with some ad-hoc Wayland mess instead (probably to avoid having to play nicely with the rest of the industry).

You could also host a web VNC client on the FreeBSD install to avoid having to install anything on the Windows side. We actually do similar in one of our products.


----------



## zirias@ (May 13, 2021)

astyle said:


> One thing about this thread surprised me to no end: Xorg long had the capacity to do X11 forwarding. When I was in college back before 2005, I could log into one Linux machine 1, SSH into the machine right next to me (machine 2), and run machine 2's locally installed kwrite on my machine 1, no RDP or anything special required. on Windows, you can use MobaXterm to do the same thing, and it doesn't matter if you have Home edition or not.


I still don't see where the actual _surprise_ is? Just the fact that you tunnel X11 through SSH should tell you something … why is it necessary? Of course, because the X11 concept is lacking in terms of authorization! Furthermore, X11 isn't really efficient: it requires quite some bandwidth to work acceptably. It's also lacking any way to switch terminals, you can't direct a running X11 client to a _different_ X11 server without terminating it. Let alone "detaching".

RDP isn't the "holy grail", but it's far more capable than X11. Don't get me wrong, the "network transparency" design of X windows definitely was a good idea. But the implementation is way behind of what you'd expect nowadays. From that point of view, I can even understand how a project like "Wayland" came to be.


----------



## kpedersen (May 13, 2021)

Zirias said:


> Of course, because the X11 concept is lacking in terms of authorization! Furthermore, X11 isn't really efficient: it requires quite some bandwidth to work acceptably.


Yeah I wouldn't like to expose an XDMCP or X server to the internet. There is the xauth magic number stuff which is probably not easy to bypass but you would still be open to DDOS.

In my personal experiments, the bandwidth is not really the issue, it is the constant back and forth between client and server (especially when using poorly network optimized GUI toolkits from 2005 onwards). Latency across a LAN is pretty good (actually for a VM or LAN, I don't think X11 can be matched in terms of performance). But internet you want to at least shovel it through SSH (possibly with the -c compression option).


----------



## zirias@ (May 13, 2021)

Well, my experience is different. Of course, on the LAN, there's no issue. But WAN? For a long time, I had one of these 16MBit DSL lines (asymmetric, with upstream only a fraction of it, probably 1MBit or something like this). X11 wasn't usable. RDP was.

Anyways, the lack of switching terminals is already a showstopper for me with plain X11 over network.


----------



## kpedersen (May 13, 2021)

Zirias said:


> Well, my experience is different. Of course, on the LAN, there's no issue. But WAN? For a long time, I had one of these 16MBit DSL lines (asymmetric, with upstream only a fraction of it, probably 1MBit or something like this). X11 wasn't usable. RDP was.


Yeah X11 isn't appropriate for WAN. It is far too slow, in particular the latency for each request.

RDP is the fastest I have used so far. Which is annoying considering the network is one of UNIX's strengths 

For the multi-terminal switching, there is Xpra but it seems unportable and/or a pain to set up.


----------



## kpedersen (May 14, 2021)

Oh I forgot to add.

If you are stuck with X11 forwarding through SSH over the internet, you can eliminate a number of these round trips by running something like Xephyr and simply forwarding that *one* application. This may sound counter-intuitive in terms of performance but if you consider the latency of these round trips being the issue, you want those to be between software on the same machine (the remote server). Even better, they can use a UNIX domain socket.

Then the image as a whole will be sent to the connecting client rather than an individual trip for many different UI components.


----------



## astyle (May 14, 2021)

Zirias said:


> RDP isn't the "holy grail", but it's far more capable than X11. Don't get me wrong, the "network transparency" design of X windows definitely was a good idea. But the implementation is way behind of what you'd expect nowadays. From that point of view, I can even understand how a project like "Wayland" came to be.


I do vaguely recall X11 allowing concurrent remote sessions (if you set it up properly), unlike RDP. As for Wayland, it's supposed to have addressed at least some of the weaknesses of X11's design.


----------



## kpedersen (May 14, 2021)

astyle said:


> As for Wayland, it's supposed to have addressed at least some of the weaknesses of X11's design.


It by design doesn't specifically address these weaknesses. Instead it simply classes them as "out of scope" and leaves it to the individual Wayland Compositors to implement an ad-hoc solution. One of these common solutions is to use X11 on-top of Wayland which actually solves very little.

It is a bit like saying the UI system on Windows 95 was more secure than X11 because it doesn't listen on a socket. Technically true but very old fashioned and limited.


----------



## zirias@ (May 14, 2021)

Hm, kpedersen, I see nothing wrong with "outscoping" in general, especially having the SRP in mind. Of course this doesn't mean that the problem at hand can just be ignored, it has to be solved somewhere else. So, of course running X11 on top of wayland is bollocks 

But in general: Why should network access (remote GUI) be part of the core GUI infrastructure? Probably makes more sense to separate it indeed.


----------



## kpedersen (May 14, 2021)

Zirias said:


> Hm, kpedersen, I see nothing wrong with "outscoping" in general, especially having the SRP in mind. Of course this doesn't mean that the problem at hand can just be ignored, it has to be solved somewhere else.


In principle, yes. However it means that the Gnome 3 developers are going to have to write a secure remote desktop system... They can't even write a useful desktop environment so how can they ever hope to implement / maintain the equivalent of half of Xorg?

And then KDE, Xfce, (presumably dwm, Fvwm), etc, would all have to implement their own. Its going to be chaos. Or it simply won't happen and we will keep on with a (then) slightly broken and unsupported Xorg layer.

Can we just rename "Xorg" to "WaylandRemoted" and see if we can trick the hipsters so we can get on with our lives?


----------



## zirias@ (May 14, 2021)

What you describe would be a result of having the right idea, but doing it wrong. You could probably just as well have reusable components implementing RDP, VNC, whatever and have them used by any desktop environment. That would clearly make more sense.

I never tried Wayland so far, I can't say how good or bad it is. I just think the initial idea wasn't that bad after all


----------



## astyle (May 14, 2021)

Zirias said:


> So, of course running X11 on top of wayland is bollocks


Gonna be awhile before we can get rid of x11-servers/xwayland and x11-servers/xwayland-devel.  I'd love to see that happen, though. In the meantime, Wayland on FreeBSD is making steady progress.


----------



## kpedersen (May 14, 2021)

Zirias said:


> You could probably just as well have reusable components implementing RDP, VNC, whatever and have them used by any desktop environment. That would clearly make more sense.


I suppose it starts to become how far they have to go before they realize that they could just as easily used XWayland and Xlib. However most compositors will probably just fall back on shoving libvncserver in there. I suppose that won't be too difficult. Not quite the same thing as RDP/XDMCP multi-users though.



Zirias said:


> I never tried Wayland so far, I can't say how good or bad it is. I just think the initial idea wasn't that bad after all


I honestly like the idea of simplification. I just am not entirely sure that this simplification will exist once actually put into practice for typical window managers. Once we have a few more than just Sway/wlroots (which is *not* a simple codebase), we might start seeing some evidence one way or the other.


----------



## kpedersen (May 14, 2021)

astyle said:


> Gonna be awhile before we can get rid of x11-servers/xwayland and x11-servers/xwayland-devel.


My theory is oddly enough that XWayland will outlive Wayland itself. Looking at the code, it is a nice solution that will probably port well to the successor of Wayland.


----------



## zirias@ (May 14, 2021)

astyle said:


> Gonna be awhile before we can get rid of x11-servers/xwayland and x11-servers/xwayland-devel.  I'd love to see that happen, though. In the meantime, Wayland on FreeBSD is making steady progress.


And this makes perfect sense as an _adapter_ to simplify migration. But if the end result is that everyone uses this adapter just because noone implements the required features natively _on_ Wayland, the whole thing would be a failed project, that delivered complication instead of simplification.


----------



## leebrown66 (May 14, 2021)

x2go client/server is a great way to run Xorg -> Xorg and save your bandwidth.
Without it, a video will peg a 100mb/s connection, with it about 1.5mb/s.


----------



## scottro (May 14, 2021)

I use it on my CentOS box. However, x2go only has the client for FreeBSD, not the server part. It really is fast though. I've used it from my workstation at work to the CentOS box at home and it's almost like being at the CentOS box's keyboard.


----------



## ct85711 (May 14, 2021)

From my understanding on Wayland, they ripped out the remote connection so Wayland by it's self doesn't do any of that stuff and depends on VNC or something else to provide the remote desktop functionality.


----------

