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 X #68

Closed
RyanHakurei opened this issue Jan 2, 2019 · 12 comments
Closed

Issues with X #68

RyanHakurei opened this issue Jan 2, 2019 · 12 comments

Comments

@RyanHakurei
Copy link

RyanHakurei commented Jan 2, 2019

IMPORTANT
Please read README and Known issues before creating the issue.

Please fill out the below information:
Describe the issue

Any attempt to use X Forwarding fails (any attempt to run any software with a GUI complains about not being able to connect to a display), but if Ubuntu WSL is running and connected to a remote server, ArchWSL can use X-Forwarding just fine. Another thing I have noticed that even though I have the display variable in .bashrc, local software with a GUI will refuse to run until I manually export the display variable regardless if another WSL distro is running.

To Reproduce
Set up the prerequisites for using X on WSL (install an X server, make sure display variable is set, etc etc) then attempt to use anything that requires X (Geany for example).

Expected behavior
X to work.

Screenshots
Here is a video of the issue

Enviroment:

  • Windows build number: 10.0.18305.1003]
  • ArchWSL version 19010200
  • Launcher version 18122700

Additional context
As mentioned before I have all the requisites for X Forwarding to work via WSL. X Server (Vcxsrv), the relevant variable exported, the relevant configs in /etc/ssh/ssh_config, etc etc.

@elswerky
Copy link

elswerky commented Jan 4, 2019

type in terminal or ~/.bashrc
export DISPLAY=:0

@yuk7
Copy link
Owner

yuk7 commented Jan 4, 2019

Yes, in my environment it works correctly by adding it to bashrc.

@RyanHakurei
Copy link
Author

RyanHakurei commented Jan 4, 2019

It's in my bashrc. It's setup exactly how I have my Ubuntu WSL setup. Yet it doesn't work unless I have my Ubuntu WSL connected to the remote machine (as shown in my video).

@elswerky
Copy link

elswerky commented Jan 5, 2019

@yuk7 do you have a telegram account ??

@yuk7
Copy link
Owner

yuk7 commented Jan 5, 2019

@elswerky
I don't have telegram...

@elswerky
Copy link

elswerky commented Jan 5, 2019

@elswerky
I don't have telegram...

thx for reply ,, i thought it would be a rapid and easy way to talk to you

@ChrisTX
Copy link

ChrisTX commented Jan 10, 2019

Are you sure that you're running a login shell for Arch? If not, .bashrc might not get parsed. This is definitely an issue of DISPLAY not being set, and that's a problem with your configuration.

@KeAWang
Copy link

KeAWang commented Feb 26, 2020

I'm having the same issue. I have DISPLAY=:0 and installed xorg-apps and xorg-server as instructed on the Arch wiki. I also have xming set up which works fine with ubuntu. However, I cannot forward anything with the Arch WSL to xming

@PhilDim1
Copy link

I needed to specify my ip address in the DISPLAY (ie. DISPLAY=192.168.xx.xx:0). I actually needed to do this with Ubuntu as well. I've never gotten it to work with just =:0

@KeAWang
Copy link

KeAWang commented Mar 2, 2020

It still doesn't work for me unfortunately. I tried with DISPLAY=$(hostname -i):0 without any luck

@snowman
Copy link

snowman commented Jul 30, 2021

Follow steps to fix WSL2 with X11-server Xming issue:

  1. Run "XLaunch.exe" with Display number: 0, and checks ON No Access Control
    (The No Acess Control MUST TURN ON, otherwise it would NOT work)
  2. Make sure you are running WSL 2 version:
   $ wsl -l -v
   NAME      STATE           VERSION
 * Ubuntu    Stopped         2
   Arch      Stopped         2

If not, run:

   $ wsl --set-version Arch 2
  1. Open Arch WSL with arch, then run following command:
   $ cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }'
   172.24.240.1
   $ export DISPLAY=172.24.240.1:0
  1. Test GUI
   ## Install xeyes
   ## $ yes | pacman -S xorg-xeyes
   $ xeyes
  1. tada!! volia~ You should see eyes appear on your screen.

You can also add the script into your ".bashrc" file by running command:

$ cat <<EOF >> ~/.bashrc
export HOST_IP="\$(cat /etc/resolv.conf | grep nameserver | awk '{ print \$2 }')"
export DISPLAY="\$HOST_IP:0"
EOF

@snowman
Copy link

snowman commented Jul 30, 2021

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

No branches or pull requests

7 participants