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

WSL2 cannot connect X server (VcXSrv) to bash console like I've always done in wsl1 #7573

Closed
1 of 2 tasks
ldonofriopq opened this issue Oct 19, 2021 · 3 comments
Closed
1 of 2 tasks

Comments

@ldonofriopq
Copy link

Version

19042.1237

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.16

Distro Version

ubuntu 20.04

Other Software

VcXsrv version 1.20.9.0

Repro Steps

https://www.tinyurl.com/donofrioworkremmina2020 is the repo steps for staging a wsl1 ubuntu 18.04 I removed screen/ubunutu desktop/snapd then do-release-upgrade, convert from wsl1 to wsl2 then your unable to connect to x server (yes I've opened up defender still no difference, yes I've followed https://gist.github.com/alextsil/f8d861b8a2fc766c06aefc0c35c083ee and still no joy.

Expected Behavior

would expect this to work as it did in wsl1

Actual Behavior

ldonofri@FXR32R2:~$ sudo service cron start && sudo service cups start && sudo service dbus start && startxfce4
[sudo] password for ldonofri:

  • Starting periodic command scheduler cron [ OK ]
  • Starting Common Unix Printing System cupsd [ OK ]
  • system message bus already started; not starting.
    /usr/bin/startxfce4: X server already running on display localhost:0.0
    xrdb: Connection refused
    xrdb: Can't open display 'localhost:0.0'
    dbus-daemon[4489]: [session uid=1000 pid=4489] Activating service name='org.freedesktop.systemd1' requested by ':1.0' (uid=1000 pid=4553 comm="systemctl --user list-jobs ")
    dbus-daemon[4489]: [session uid=1000 pid=4489] Activated service 'org.freedesktop.systemd1' failed: Process org.freedesktop.systemd1 exited with status 1
    Unable to init server: Could not connect: Connection refused
    xfce4-session: Cannot open display: .
    Type 'xfce4-session --help' for usage.

Diagnostic Logs

No response

@craigloewen-msft
Copy link
Member

I see that you're using localhost here, and you're using a WSL 2 distro. To access a Windows server from Linux you'll need to use the /etc/resolv.conf nameserver value.

Full details here on our docs: https://docs.microsoft.com/en-us/windows/wsl/networking#accessing-windows-networking-apps-from-linux-host-ip

And sample community instructions on how to set up your XServer for WSL 2 here: https://medium.com/javarevisited/using-wsl-2-with-x-server-linux-on-windows-a372263533c3

This should resolve you! If it doesn't please mention me in this thread so I can reopen it. :)

@ldonofriopq
Copy link
Author

@craigloewen-msft - no difference, it seems resolv.conf is always messed up. regardless of that there is no change in results from this 2020 guide. I am not"trying to access windows server from linux" in this writeup I used that to show you the steps to reproduce this issue. I am trying to get a windows 10 workstation with wsl 2 and ubuntu 20.04 installed to allow/use a x server (in this case it its VcXsrv) that used to work great for four years with wsl1 this is a wsl2 issue and I would like advice not just lmgtfy replies. thank you for your time and assistance with this issue.

@ldonofriopq
Copy link
Author

still unable to connect to VcXsrv, even with firewall rule in place, any other suggestions?

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

2 participants