Shift running X window (display environment) on SSH X11 forwarding - ssh

I want to see remotely some running GUI application without kill the current process, I have tried vnc and xrdp, xrdp opens a new blank session, so it is not for me, vnc is good, but not exactly what I need, it uses the screen and devices presents, someone could mess with me moving the mouse or typing on the keyboard.
Therefore I figured out the only way I could do what I need is managing to shift a running X window from one display to another, thus even on a SSH -X (X11 forwarding) I would be able to see it.
I am on this quest for a long time and I didn't found out a conclusive solution, that is the reason I am appealing to you. Could you help me to solve this trouble?
Thanks,

I've never used it myself, but Xpra appears to be the commonly suggested solution; you might also consider xmove. Both of these work by proxying the X client's connection to its server, and keeping track of enough state so that you can switch the proxy's server-side connection among servers and get a sensible result. Without such a proxy, as in "stock" X, it is not possible to disconnect a client from one server and connect it to another, except in the case of a client which is designed specifically to support such behavior.

If you look at the Wikipedia page on the subject there are several apps mentioned.
Xmove
excerpt
xmove is a computer program that allows the movement of X Window
System applications between different displays and the persistence of
X applications across X server restarts.[4] It solves a problem in the
design of X, where an X client (an X application) is tied to the X
server (X display) it was started on for its lifetime. Also, if the X
server is shut down, the client application is forced to stop running.
xmove lets the client disconnect from its current X server, and
connect to a new one, at any time. The transition is completely
transparent to the client. xmove works by acting as a proxy between
the client and server. It is a "pseudoserver" which stores enough
server state so that clients can connect to a new server without being
disrupted.
Xpra
excerpt
xpra or X Persistent Remote Applications is a tool which allows you to
run X clients usually on a remote host and then direct their display
to your local machine without losing any state.1
It differs from standard X forwarding in that it allows disconnection
and reconnection without disrupting the forwarded application. It
differs from VNC and similar remote display technologies in that xpra
is rootless: i.e., applications forwarded by xpra appear on your
desktop as normal windows managed by your window manager, rather than
being all "trapped in a box together". Xpra also uses a custom
protocol that is self-tuning and relatively latency-insensitive, and
thus is usable over worse links than standard X.
Guievict
excerpt
guievict is a computer program which enables the GUI of any
application for XFree86 implementation of X Window to be transparently
migrated to or replicated on another display. Unlike some program
providing similar functionalities, it requires neither prearranging
steps such as re-linking the application program binary nor
re-directing the application process's window system communication
through a proxy like xmove does.
Guievict is based on a small X server extension that enables an
application to retrieve its window state from the X server and a
library of GUI migration functionality that is injected in the
application process at run time. Code injection or runtime
code-patching can be done via the DynInst API. However, guievict
contains its own implementation to avoid requiring users to install
DynInst.
Of the 3 of these, Guievict sounds like what you're looking for, mainly that it can checkpoint the state of X application AppX and migrate it to another X server where it can be restored.
(This answer comes from slm at unix.stackexchange)

Related

Why does my virtual machine stop conducting blueprism automated processes when I minimize or close it?

I automate processes on a remote computer. When I start a process from the control room, that works totally fine. But as soon as I minimize or close the remote computer (I don't shut it down, I just close the window), the remote computer crashes. The log contains entries like that elements cannot be found. The reason is, that the remote computer does not even open the applications.
So, what's the reason for that? The computers state is on desktop, so there is no screensaver or logon screen.
Expected result: The robot should work finely even when the remote desktop session is not on screen, like in production environment.
You haven't specified, but the below answer extrapolates your statements regarding how you've "[minimized] or [closed]" your "remote computer" to assume you're leveraging Microsoft's Remote Desktop Connection utility/protocol.
Blue Prism specifically discourages the use of Remote Desktop to manipulate remote Runtime Resources within a Blue Prism-based environment, as the use of the protocol itself causes the methodologies Blue Prism uses to locate elements in the Windows desktop environment to stop working entirely. This is explicitly spelled out in Blue Prism's official documentation on Remote Access Tools:
The following tools have been deemed to be specifically unsuitable for
providing remote access to Blue Prism environments:
Remote Desktop Connection (RDP)
The way that this Windows tool (and other tools that
use the RDP protocol) handle session management is not compatible with
Blue Prism:
The underlying operating system is aware as a connection is established which can, subject to the automation techniques being
applied, result in the executing automation being interupted.
It requires the remote access credentials to be aligned with the credentials used to authenticate the target system against the network
which presents a potential security risk.
As a user authenticates any previously connected users are locked out.
Each connection creates a separate desktop session.
The connection is not maintained throughout a system reboot.

Online product demo environment for Windows applications

I'm looking for a way to allow potential customers to try my application before they buy it.
The product is a windows forms application that requires an SQL Server database to operate.
Although I have a functional demo that the customer can install on their network, I want to make it easier for them by have them "play" with it at my environment.
I remember Microsoft had (has?) something similar. I was testing Visual Studio a few years ago in a virtual environment where I was connecting to a server at Microsoft.
They setup the environment this way so when a user logs off after using it rollback his actions. Or to explain it better: when a user logins it starts with a new, clean environment.
So any projects I've created testing Visual Studio were lost after I logged off.
Any suggestions?
Thanks.
Some solutions that come to mind:
Provide remote access
You could provide access to a running instance of your application via some sort of remote connection protocol, e.g. via RDP or via VNC.
For example, there is a Java VNC client which can run as a Java applet; you could put that on a webpage and have it connect to a VNC session you host on your servers.
Or use Windows Terminal Server, and allow connection via RDP.
Both solutions of course have the drawback that people need to open the appropriate ports, if they are behind a firewall. There might be ways around that, however (e.g. you can run VNC over HTTP).
VM image
A completely different solution: Provide a ready-to-run VM image (for VMWare, VirtualBox or similar) of your application, including server and everything. You would need a demo version of your app though, plus getting redistribution rights for all the proprietary components (Windows OS, SQL server) might get hairy.
Offer videos
Often people do not really need to actually use the app; they are mainly interested to see how it works. So maybe it is enough to host videos of the app in operation. That allows you to put in some advertising for your features, and lets you show the users what they might miss when testing on their own.

Terminal Services Servers Information

I was wondering if anyone had some good general information on windows terminal services and how it works.
I'm wondering:
If a DLL is loaded into memory is it available for all users or reloaded for each user. (or does it depend on something else)
A specification for an example server and how many concurrent users it supports with general use....
Any issues with them, I used one a while ago and we had sporadic freezes for a few seconds every so often. This could not be tracked down to a network issue someone suggested something to do with remote printers being attached to the system. It really annoyed users seemed to happen often when going to the start menu.
Is 2008 a big upgrade in terms of performance to 2003
Terminal Services is simply like a server with multiple "remote desktop".
DLL is not shared between sessions, just like ordinal process.
You need a special license if you want to use standard Windows server
I suggest removing all the printers when you want to use it (you can also disable them in client side), but that's not a big issue
2008 is far better for performance and security, but you'd also need more recent RDP clients.

What is X Server and Remote Terminal Server?

Can someone explain what is the difference between X server and Remote Terminal servers in simple terms?
For example, Hummingbird Exceed is an X server and Citrix is a Remote Terminal Server. How do these servers work?
A terminal server runs at the "other" machine while you use a remote desktop client to view the other machine's screen.
A X server (of the X11 Window System) runs on your machine while another machine (or several thereof) send their output to your computer.
The most important difference to the end user is probably "culture": With the X Window system you typically work with windows that run on several hosts. (You often sit in front of a quite stripped down workstation, get one application from one computer, another one from another computer.) When working with X things feel very heterogeneous - a special application only runs on a HP workstation while your company is stuffed with suns or linux boxes? No problem, just buy one HP, everone can use that application over the network like as it was local.)
Remote terminal services feel more like another computer sends its complete screen to you, more like you have a 100-Mile-Long monitor and usb cable (with a little lag built in). You typically use a remote desktop client that sends a complete desktop to you.
However in recent times both techniques get close to another - windows remote desktop (which is based on citrix) can send only application windows to your desktop, while a lot of programs based on X11 are theoretically network transparent but practically need to run on the local machine. (Sorry, no 3D shooter over the network - an extreme example).
Which one is better? I don't dare to say. White X11 is a lot more flexible (it was designed with network transparency in mind - it makes absolutely no difference if an application runs local or remote - it is in many aspects more complicated. As long as there was no remote desktop sharing there was a clear advantage, but slowly the gap is closing, for example by terminal services now allowing you to do many things that were available with X11 only in earlier times.)
By the way, the main reason many X11 application still feel a little "snappier" over the network than windows counterparts is the thing that many application programmers on windows still think they always run local and dump a lot of bitmap graphics on the screen - like custom toolbars in ZIP tools. X11 applications did not do this for a long time and chose "ugly but fast" because X11 forces you to think about the network. But as X11 applications get more pretty and Windows programmers more aware about terminal services the difference will dwindle.
Oh and an important point: X11 is deeply ingrained in the Unix way of things, Citrix is mainly used on Windows (in the form of Microsoft's Windows Terminal Services - which originated in Citrix code). So lock a terminal services admin and a X11 operator into a cage and step back watching bloodshed when they figure out who they are locked in with ...
An X server most likely refers to the X11 windowing system, which is the GUI that most unix flavors (including linux) use. It's a client/server setup, and has been around for a very long time
A remote Terminal Server in the case of Citrix is a remote windows instance that can be connected to with a special Citrix client. The Citrix environments I'm familiar with are all MS Windows solutions, ie they work similar to X, but are for Windows Servers only
They both sort of operate in similar fashions, which is serving a remote client a windowing solution. IE, they both let a server run the actual application while the display of that application is sent back over the network to a client PC.
A 'Terminal Server', as it's called, basically allow you to connect to a Windows session remotely. They employ a bit of magic to make the experience snappy over connections with latency. The Windows GUI system isn't network transparent like X, so it took a while longer to get this feature. Windows Server 2008 and Citrix products have the ability to let you use a single application, unlike the traditional Terminal Server.
X is the GUI protocol for Unix/Linux. The X server accepts connections and displays their windows. The clients are actually the programs themselves. These clients can be local or remote, it doesn't matter to X. X just displays them as requested, on the local screen or over a TCP connection. This is lower level stuff than terminal servers, and allows graphical programs to run on one machine and display on another. X11 doesn't compress or encrypt the traffic like RDP does (although SSH can help you out there).
The linux equivalent of RDP is NX. They provide free software to run NX servers/clients. I've used it and it works pretty well.

Best way to simulate a WAN network

Simplified, I have an application where data is intended to flow over the internet between two servers. Ideally, I'd like to test at what point the software ceases to function. At what lowerbound limit (bandwidth, latency, dropped packets) do things stop working to test the reliability of the software.
What I thought I would do was the following:
Setup up 3 machines (VMware instances)
Install the 2 applications on two of the servers.
Setup up the 3rd server to sit between the two machines by doing some sort of magic with Routing and Remote Access on Windows 2003
Install either Traffic Shaper XP or NetLimiter to limit the bandwidth
Run something like TMnetSim Network Simulator to simulate a bad connection.
Does this sound like a good idea or are there easier/better ways of doing this? I'm not that comfortable on Linux and my team mates are even less so.
WANem does exactly this. We have used it both in a virtual machine on the desktop and on a dedicated old pc and it worked great. It can simulate all sorts of broken connectivity.
FreeBSDs ipfw has provisions to simulate links with a given bandwith, latency or error rate. You could use that FreeBSD machine as your machine "in the middle" in your above setup.
You probably can also run at least one of the endpoints on the same machine if you want to reduce the amount of servers involved.
Someone actually packaged up the settings and whatnot necessary for the FreeBSD solution to this problem and they call it DUMMYNET.
It simulates/enforces queue and bandwidth limitations, delays, packet losses, and multipath effects. It also implements a variant of Weighted Fair Queueing called WF2Q+. It can be used on user's workstations, or on FreeBSD machines acting as routers or bridges.
It can simulate exactly what you want, and its free and will boot onto commodity hardware. They even have a canned install of it that is small enough to put on a floppy disk (!) that you can download at that link.
Maybe it is time to learn a bit about Linux because adding a 50ms delay on every outgoing packet can be done in typing just one line:
tc qdisc add dev eth0 root netem delay 50ms
For more see the Linux Traffic Control HOWTO
We had a similar requirement some ten years ago - I'll see if I can recall how we managed it.
If I remember, we wrote a socket proxy program which was controlled by inetd on a UNIX box. This socket would accept connections from a client and open equivalent sessions through to the server. It would then loop, passing messages in both directions.
The way we achieved WAN characteristics was to introduce random delays (with upper and lower limits) in both the connection establishment and the passing of data once the link was up.
It also had the feature to drop the link occasionally as WAN links were less reliable for us than local traffic.
I recall we had to make it threaded to stop the delays from affecting reverse traffic on the link.
There is a very good (and free) Microsoft solution for that, we use it for quite some time and it works great, it can very easily simulate every thing(packet loss, low bandwidth, disconnection, latency....)
This is the best solution i found for a windows environment
More information and a download link can be found here: MARCO blog post
this product has gone some evolution and it is now integrated into visual studio as part of the automation testing, but i found the use of the standalone(that is quite hard to find, so keep a local copy) to work much better. keep in mind that you need at least two computers(or VMs) since you need to pass through a network adapter in order for the application to work its magic.