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!
0 Answers