WhitewaterFoundry / Pengwin

A Linux distro optimized for WSL based on Debian.
Other
1.48k stars 104 forks source link

DISPLAY defaulting to host IP #698

Open akwebb1 opened 3 years ago

akwebb1 commented 3 years ago

I have been using Pengwin with X410 and a firewall rule so that I don't have to set X410 network access to public for quite a while very happily. This has been fine until a recent update. Now Pengwin is using my 192.168.1.x address for the DISPLAY variable instead of the subnet range 172.16.0.0/12 which it used to as well as my other WSL distros breaking my X11 app connectivity. I don't want to add 192.168.1.x to my firewall rules since I might be on someone else's network when mobile. I modified 00-penguin.sh to eliminate this functionality for now but if it is ever updated I will have to keep track of that. Maybe somehow make it optional on which network to set the DISPLAY variable since keeping it on 192.168.1.x is not secure on an unknown network.

crramirez commented 3 years ago

Hello @akwebb1,

Did you change recently the language of your Windows from / to English?

Regards

akwebb1 commented 3 years ago

No, I have not changed anything like that. I did reinstall the Pengwin distro at some point recently but that is about it. I have done that many times without this happening.

crramirez commented 3 years ago

What you are describing is the default behavior of Pengwin. It looks for the IP where you have the internet gateway. Because using this IP, you don't have to open the firewall port for xserver. In general, you don't need to care about it.

I asked about the language because the Windows commands are localized. ipconfig returns different words depending on the localization, so Pengwin, when it doesn't understand the result, goes for the internal IP.

This behavior has not changed in many months. The only recent change there is that now Pengwin checks if the DISPLAY variable is already set to avoid breaking WSLg

We will perform some test to ensure that anything has changed in recently.

Thanks for reporting

akwebb1 commented 3 years ago

Sorry about the false alarm with the IP change. I went to some backups and It looks like I have a script executing that has changed behavior recently. Prior to the change it was resetting the DISPLAY variable without me realizing it and now it doesn't which is what started the problem for me.

I still have the issue with the firewall since all of my other distros use the 172 network. I will either have to keep the Pengwin modification I made to use the 172 range or the other distros to use my host IP. I also have full HYPER-V machines using the firewalled 172 range as well. I have a lot of X11 going on. In the end it is not that big of a deal since Pengwin is my Primary distro and I am not sure how it would be made optional which is what my original post was about. As always, thank you for your time and support.

crramirez commented 3 years ago

It might be a good idea to check for a hidden file that changes the behavior. Probably you are not the only one with this problem.

I will add it to the roadmap.

crramirez commented 3 years ago

And you are very welcome

crramirez commented 1 year ago

Hello @akwebb1,

We released today an update to the pengwin-base package that checks if the file ${HOME}/.config/pengwin/display_ip_from_dns exists. If it does, it will use the IP from /etc/resolv.conf instead of the host one.

We will soon include an option in pengwin-setup for this feature.

Hope it helps.

crramirez commented 1 year ago

We added an option in pengwin-setup to choose between getting the IP from Host or resolv.conf

Wielding commented 1 year ago

Thank you. I have not been using WSL lately since I have been mostly using my new System76 Linux box. I will check it out when I return to doing some development under Windows.