0

Our team often connect to a Windows server through remote desktop (RDP). Inside RDP, we use Putty (a terminal emulator) to connect to a Linux server. Sometimes we launch X-Win32 (an X server for Windows) in RDP and run an X application on Linux to show the GUI to Windows. If only one person does this, he can export DISPLAY=[Windows server]:0 in the Linux Putty window and run the X app. If another person does this, most likely he needs to set DISPLAY to [Windows server]:1, ... The number after the colon is the X display number. We can see it by moving mouse over the X-Win32 icon at the lower right corner of RDP. But I wonder if there's a way to detect that number from Linux.

We probably can manually set an environment variable in Putty (Connection->Data->Environment variables) before we connect to Linux and once connected, the bash shell will have the variable set. Or we can run Process Explorer on the Windows server and check the environment variable DISPLAY in process ime.exe (a process spawned by X-Win32). But these are even more complicated than telling our team members to move mouse over X-Win32 icon to get the display number. Is there an easier way or a way we can automate? If none, that's fine. Thank you!

yong321
  • 125
  • 3
  • Why run the double hop? Also, there is an RDP client for Linux. – Davidw Nov 03 '21 at 16:50
  • I didn't know RDP client for Linux. Thanks for that info. The reason we use the Windows server is that it's guaranteed to be very stable. I personally use tmux (or screen on older Linux) to prevent network disconnect so I always launch X app from Linux that is accessed from my laptop. But my coworkers prefer to use that Windows server to connect to Linux to get a stable connection. (Update: Actually, X app will abort even if it's launched inside tmux. So occasionally I use that Windows server too if the X app will run for a while and my home network is not stable.) – yong321 Nov 03 '21 at 17:10

0 Answers0