public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* How to use X-Server on VM with multiple client displays?
@ 2023-08-22 17:41 Stone, Timothy M
  2023-08-23 20:15 ` Jon Turney
  0 siblings, 1 reply; 3+ messages in thread
From: Stone, Timothy M @ 2023-08-22 17:41 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'

[-- Attachment #1: Type: text/plain, Size: 1566 bytes --]


Hello,

I hope I'm using the right list!

I have an X application that uses the cygwin X Server XWin.  It works fine on Windows:

  *   When I launch the application, XWin launches, then the X app raises it's window.

When I install this application (and cygwin and XWin) on a virtual machine, I have a DISPLAY issue:

  *   If I log into the virtual machine from <machine1>, I can launch and run the app just fine.
  *   However, if I then try to log into the virtual machine from another computer and launch the app...the app launches on the first machine's display...so I have 2 copies of it running on that display now.
  *   Typically, I'd set DISPLAY=<machine1>:0.0 for the first machine, and DISPLAY=<machine2>:0.0 for the second machine
     *   The problem is, the virtual machine is the only machine here, it only has 1 IP address
     *   I don't know how to set multiple DISPLAY when using the same virtual machine with the same IP address from 2 different machines.
     *   I have tried setting the DISPLAY to the IP addresses of the client machines, this does not work (unable to open display).
  *   I have also tried setting DISPLAY=localhost:0.0 for one machine and DISPLAY=localhost:0.1 for the other machine...this also does not work
     *   XWin is unable to open display localhost:0.1

Any help greatly appreciated!

I'm sure it must be possible to launch the X app on the virtual machine from different clients and have the display on their respective displays?  I just can't see how to set the display.

thanks



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to use X-Server on VM with multiple client displays?
  2023-08-22 17:41 How to use X-Server on VM with multiple client displays? Stone, Timothy M
@ 2023-08-23 20:15 ` Jon Turney
  2023-08-23 20:50   ` [EXT] " Stone, Timothy M
  0 siblings, 1 reply; 3+ messages in thread
From: Jon Turney @ 2023-08-23 20:15 UTC (permalink / raw)
  To: Stone, Timothy M, The Cygwin Mailing List

On 22/08/2023 18:41, Stone, Timothy M via Cygwin wrote:
> 
> Hello,
> 
> I hope I'm using the right list!
> 
> I have an X application that uses the cygwin X Server XWin.  It works fine on Windows:
> 
>    *   When I launch the application, XWin launches, then the X app raises it's window.

This seems to be the root problem.

The application shouldn't really be starting the server.  If you start 
it separately then each instance of the application can connect to the 
same or different X server (as controlled by the DISPLAY value)

(But see below for ways that can be made to work)

> 
> When I install this application (and cygwin and XWin) on a virtual machine, I have a DISPLAY issue:
> 
>    *   If I log into the virtual machine from <machine1>, I can launch and run the app just fine.
>    *   However, if I then try to log into the virtual machine from another computer and launch the app...the app launches on the first machine's display...so I have 2 copies of it running on that display now.
>    *   Typically, I'd set DISPLAY=<machine1>:0.0 for the first machine, and DISPLAY=<machine2>:0.0 for the second machine
>       *   The problem is, the virtual machine is the only machine here, it only has 1 IP address
>       *   I don't know how to set multiple DISPLAY when using the same virtual machine with the same IP address from 2 different machines.

You need to give each instance of the X server a different "display number"

See https://x.cygwin.com/docs/faq/cygwin-x-faq.html#display-and-screen

>       *   I have tried setting the DISPLAY to the IP addresses of the client machines, this does not work (unable to open display).
>    *   I have also tried setting DISPLAY=localhost:0.0 for one machine and DISPLAY=localhost:0.1 for the other machine...this also does not work
>       *   XWin is unable to open display localhost:0.1

If you want to connect to separate server instances running on the same 
machine, you should use separate X display, not X screen numbers (e.g. 
localhost:0 and localhost:1)

> Any help greatly appreciated!
> 
> I'm sure it must be possible to launch the X app on the virtual machine from different clients and have the display on their respective displays?  I just can't see how to set the display.
  The exact configuration you are trying to use is still a little 
unclear to me after reading this.

You might want to look at the '-displayfd' and '-silent-dup-error' 
options to XWin. I suspect one of these might be part of the solution to 
your problem.

This page [1] in the documentation seems to be discussing a related 
problem, although maybe doesn't make it explicit.

[1] https://x.cygwin.com/docs/ug/using-terminal-server.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [EXT] Re: How to use X-Server on VM with multiple client displays?
  2023-08-23 20:15 ` Jon Turney
@ 2023-08-23 20:50   ` Stone, Timothy M
  0 siblings, 0 replies; 3+ messages in thread
From: Stone, Timothy M @ 2023-08-23 20:50 UTC (permalink / raw)
  To: 'Jon Turney', The Cygwin Mailing List


Thanks, I was able to get this resolved, much as you suggested.

I am now launching a separate X Server with a different display number for each client, then assigning each client that DISPLAY number.

thanks for the help!


-----Original Message-----
From: Jon Turney <jon.turney@dronecode.org.uk> 
Sent: Wednesday, August 23, 2023 4:16 PM
To: Stone, Timothy M <tstone@ida.org>; The Cygwin Mailing List <cygwin@cygwin.com>
Subject: [EXT] Re: How to use X-Server on VM with multiple client displays?

*** This email originated outside of IDA. Please verify that you recognize the sender and know the content is safe before proceeding. ***


On 22/08/2023 18:41, Stone, Timothy M via Cygwin wrote:
>
> Hello,
>
> I hope I'm using the right list!
>
> I have an X application that uses the cygwin X Server XWin.  It works fine on Windows:
>
>    *   When I launch the application, XWin launches, then the X app raises it's window.

This seems to be the root problem.

The application shouldn't really be starting the server.  If you start it separately then each instance of the application can connect to the same or different X server (as controlled by the DISPLAY value)

(But see below for ways that can be made to work)

>
> When I install this application (and cygwin and XWin) on a virtual machine, I have a DISPLAY issue:
>
>    *   If I log into the virtual machine from <machine1>, I can launch and run the app just fine.
>    *   However, if I then try to log into the virtual machine from another computer and launch the app...the app launches on the first machine's display...so I have 2 copies of it running on that display now.
>    *   Typically, I'd set DISPLAY=<machine1>:0.0 for the first machine, and DISPLAY=<machine2>:0.0 for the second machine
>       *   The problem is, the virtual machine is the only machine here, it only has 1 IP address
>       *   I don't know how to set multiple DISPLAY when using the same virtual machine with the same IP address from 2 different machines.

You need to give each instance of the X server a different "display number"

See https://x.cygwin.com/docs/faq/cygwin-x-faq.html#display-and-screen

>       *   I have tried setting the DISPLAY to the IP addresses of the client machines, this does not work (unable to open display).
>    *   I have also tried setting DISPLAY=localhost:0.0 for one machine and DISPLAY=localhost:0.1 for the other machine...this also does not work
>       *   XWin is unable to open display localhost:0.1

If you want to connect to separate server instances running on the same machine, you should use separate X display, not X screen numbers (e.g.
localhost:0 and localhost:1)

> Any help greatly appreciated!
>
> I'm sure it must be possible to launch the X app on the virtual machine from different clients and have the display on their respective displays?  I just can't see how to set the display.
  The exact configuration you are trying to use is still a little unclear to me after reading this.

You might want to look at the '-displayfd' and '-silent-dup-error'
options to XWin. I suspect one of these might be part of the solution to your problem.

This page [1] in the documentation seems to be discussing a related problem, although maybe doesn't make it explicit.

[1] https://x.cygwin.com/docs/ug/using-terminal-server.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-23 20:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-22 17:41 How to use X-Server on VM with multiple client displays? Stone, Timothy M
2023-08-23 20:15 ` Jon Turney
2023-08-23 20:50   ` [EXT] " Stone, Timothy M

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).