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

Integrate WSL into display #997

Merged
merged 4 commits into from
Jun 18, 2021
Merged

Integrate WSL into display #997

merged 4 commits into from
Jun 18, 2021

Conversation

tomeichlersmith
Copy link
Member

@tomeichlersmith tomeichlersmith commented Jun 10, 2021

https://wiki.ubuntu.com/WSL#Running_Graphical_Applications for the details.

Essentially, we are assuming that an X server is running somewhere and we point our container directly to the IP of that server. On linux systems, the X server (probably) requires no setup while on Windoze, the user will need to install some X server for WSL to connect to. We didn't have this problem before because the DISPLAY variable on Linux systems is set to :0 and some other nonsense can automagically connect to the X server. WSL can't do that.

I am updating ldmx-sw, here are the details.

What are the issues that this addresses?

This resolves #996 by pointing our container directly to the X server that is running.

Check List

  • I successfully compiled ldmx-sw with my developments
  • I ran my developments and the following shows that they are successful. @D-Covey09
  • I attached any sub-module related changes to this PR. NA

https://wiki.ubuntu.com/WSL#Running_Graphical_Applications for the details. Essentially, we are assuming that an X server is running somewhere and we point our container directly to the IP of that server. On linux systems, the X server (probably) requires no setup while on Windoze, the user will need to install some X server for WSL to connect to.
@D-Covey09 D-Covey09 marked this pull request as ready for review June 10, 2021 15:38
Copy link

@D-Covey09 D-Covey09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Launching WSL2 and navigating to my LDMX folder where all my ldmx installs are, I ran

source ldmx-sw/scripts/ldmx-env.sh
ldmx rootbrowse uva-ldmx/neutronanalysis.root

ldmx now properly finds my X display and gives me an interactive gui. I use Xming on Windows for my X11 server.
image

@tomeichlersmith
Copy link
Member Author

This update does not wok on Ubuntu.

[ldmx] tom@zuko:~/ldmx/ldmx-sw$ ldmx config
LDMX base directory: /home/tom/ldmx
Display Port (empty means your OS not supported): 127.0.0.53
Container Mounts: /home/tom/ldmx
Docker Version: Docker version 20.10.3, build 48d30b5
Docker Tag: ldmx/dev:latest
  SHA: ldmx/dev@sha256:9846dca352b485aeb647afdc76eecddd46cbc96888f031b39a46a0f2c5244dc7
[ldmx] tom@zuko:~/ldmx/ldmx-sw$ ldmx rootbrowse
Error in <TGClient::TGClient>: can't open display "127.0.0.53:0", switching to batch mode...
 In case you run from a remote ssh session, reconnect with ssh -Y
Press enter to exit.

I need to look up how to detect if a user is within WSL.

@tomeichlersmith tomeichlersmith added this to the v3.0.0 milestone Jun 18, 2021
@tomeichlersmith
Copy link
Member Author

Alright, @D-Covey09 and I were able to separate out WSL from real Linux by checking the output of uname -a.

Long story short, Microsoft uses its own version of Linux for within WSL and it included microsoft in that name. This means we can detect when we are inside WSL versus when we are on a real Linux machine.

Print out the variables used to deduce the display port for help debugging.
@tomeichlersmith tomeichlersmith merged commit a58d44b into trunk Jun 18, 2021
@tomeichlersmith tomeichlersmith deleted the iss996-wsl-display branch June 18, 2021 14:01
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

Successfully merging this pull request may close these issues.

Failure to Launch Display-Connected Programs in WSL
2 participants