Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with wsl2 + win11 #84

Open
Victornovikov opened this issue Apr 19, 2023 · 4 comments
Open

Issues with wsl2 + win11 #84

Victornovikov opened this issue Apr 19, 2023 · 4 comments

Comments

@Victornovikov
Copy link

Victornovikov commented Apr 19, 2023

I am trying to run the following example

from pyvirtualdisplay import Display
with Display() as disp:
    # display is active
    print(disp.is_alive()) # True
# display is stopped
print(disp.is_alive()) # False

This results in

 XStartTimeoutError
No reply from program Xvfb. command:['Xvfb', '-br', '-nolisten', 'tcp', '-screen', '0', '1400x900x24', '-displayfd', '14']
  File "/home/vn/marl-interfere/render_mpe.py", line 134, in main
    virtual_display.start()
  File "/home/vn/marl-interfere/render_mpe.py", line 144, in <module>
    main(sys.argv[1:])
pyvirtualdisplay.abstractdisplay.XStartTimeoutError: No reply from program Xvfb. command:['Xvfb', '-br', '-nolisten', 'tcp', '-screen', '0', '1400x900x24', '-displayfd', '14']

xfvb is running on the wsl2

 xdpyinfo -display :0 >/dev/null 2>&1 && echo "In use" || echo "Free"
In use

I'd appreciate any suggestions.

@ponty
Copy link
Owner

ponty commented Apr 24, 2023

Sorry I have no wsl and I had no feedback of Windows usage.
You can try this environment variable:

PYVIRTUALDISPLAY_DISPLAYFD=0

@VishnuSuresh2000
Copy link

On settings up the above environment variable it is working for me in Ubuntu 20.04 WSL2 + Windows 10

@ponty
Copy link
Owner

ponty commented Sep 16, 2023

So the -displayfd flag has some problem on this config.
Please test it
https://stackoverflow.com/questions/2520704/find-a-free-x11-display-number/

This is my test on Ubuntu 22.04

exec 6>display.log
Xvfb -displayfd 6

other terminal

cat display.log 
1

@GitFogux
Copy link

On my Ubuntu 20.04 WSL 2 + Windows 11
(had the exact same issue and using PYVIRTUALDISPLAY_DISPLAYFD=0 fixed it)

Running :

exec 6>display.log
Xvfb -displayfd 6

creates an empty display.log file
The console in which I run this outputs a bunch of lines, the last of which read :

_XSERVTransOpen: transport open failed for unix/URANUS:59531
_XSERVTransMakeAllCOTSServerListeners: failed to open listener for unix
_XSERVTransSocketOpenCOTSServer: Unable to open socket for unix
_XSERVTransOpen: transport open failed for unix/URANUS:59532
_XSERVTransMakeAllCOTSServerListeners: failed to open listener for unix
_XSERVTransSocketOpenCOTSServer: Unable to open socket for unix
_XSERVTransOpen: transport open failed for unix/URANUS:59533
_XSERVTransMakeAllCOTSServerListeners: failed to open listener for unix
_XSERVTransSocketOpenCOTSServer: Unable to open socket for unix
_XSERVTransOpen: transport open failed for unix/URANUS:59534
_XSERVTransMakeAllCOTSServerListeners: failed to open listener for unix
_XSERVTransSocketOpenCOTSServer: Unable to open socket for unix
_XSERVTransOpen: transport open failed for unix/URANUS:59535
_XSERVTransMakeAllCOTSServerListeners: failed to open listener for unix
(EE)
Fatal server error:
(EE) Failed to find a socket to listen on(EE)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants