Hacker News new | past | comments | ask | show | jobs | submit login

Here is a technet thread where Microsoft's brightest (including yours truly) discuss how to do this using a vxserver. https://techcommunity.microsoft.com/t5/windows-dev-appconsul...



That's how I do it- mostly to run urxvt.

Off-Topic: I'm setting up a new machine, and wondering whether I should use WSL 1 or 2 (or both?). Is there a clear path forward for these systems? WSL 1 has served me pretty well. Most of the inter-filesystem interaction amounts to using rsync to back up directories. Otherwise it's just sshing into servers. I use virtualbox for off-line development.


> That's how I do it- mostly to run urxvt.

> Off-Topic: I'm setting up a new machine, and wondering whether I should use WSL 1 or 2 (or both?). Is there a clear path forward for these systems? WSL 1 has served me pretty well. Most of the inter-filesystem interaction amounts to using rsync to back up directories. Otherwise it's just sshing into servers. I use virtualbox for off-line development.

I would recommend wsl2 for sure.


Well, except for the timekeeping problem (there are workarounds but they're annoying) and the significant networking issues (no bidirectional port forwarding so "localhost:8080" doesn't work with server in WSL and DISPLAY=:0.0 doesn't work with server on Windows).


Also if you connect to a VPN (like your corporate VPN using Cisco Anyconnect), you lose connectivity within WSL2...

WSL is nice to have and a million times better than DOS/Powershell but it's not at Linux/Mac terminal level yet.


Having used UNIX since Xenix was introduced to me in 1993, I rather keep using Powershell, thanks.


Depends on the nature of the VPN. I can connect fine through my work OpenVPN, but it's not a full tunnel, just pushes a couple routes and split DNS, both of which are accessible on the WSL2 VM.


I don’t have that problem with WSL2 and Cisco AnyConnect. Maybe something’s up with your company’s configuration?


Maybe I did something wrong, but for me getting a local X-server running, with X-forwarding from WSL1 was dead easy and something I used on a day to day basis.

Getting the same working with WSL2 was a pain in the ass, and I eventually gave up.

So if you like X-forwarding... I personally would recommend sticking to WSL1, unless that gives you other issues.


> Getting the same working with WSL2 was a pain in the ass, and I eventually gave up.

Overall it works the same as WSL 1, you just need to change DISPLAY=:0 to DISPLAY="$(/sbin/ip route | awk '/default/ { print $3 }'):0"

Here's a snippet from my bashrc that handles both WSL 1 and WSL 2: https://github.com/nickjj/dotfiles/blob/385007837ab787a2be2e...


You can also read the IP from etc/resolv conf.


Thanks for that.


Is "X-forwarding" being able to see and interact with linux GUI apps running inside WSL on Windows? I do this to run Cypress interactively within WSL2.

I have no idea what I did (i just blindly follow some guide on a no-name blog), but I got it all working fairly effortlessly. The only slightly annoying thing is having to start the server on windows if i restart my pc, but otherwise it was pretty easy.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: