Web lists-archives.com

Re: Cygwin alongside WSL




On 2017-10-25 15:18, Thomas Wolff wrote:
> Am 25.10.2017 um 20:30 schrieb Brian Inglis:
>> On 2017-10-25 11:27, Brian Inglis wrote:
>>> On 2017-10-25 00:29, Thomas Wolff wrote:
>>>> Am 25.10.2017 um 00:19 schrieb Angelo Graziosi:
>>>>> Thomas Wolff wrote:
>>>>>> Mintty 2.8.0 simplifies WSL integration a lot.
>>>>>> In Cygwin, you can simply start e.g. mintty --WSL=Ubuntu (add -~ to start in
>>>>>> the WSL home).
>>>>> Does it mean that 2.8.0 does not need wslbridge [*] any more?
>>>> No, sorry, I forgot to mention that wslbridge would have to be installed
>>>> in /bin to make this work.
>>> As it is not a Cygwin package, I have installed wslbridge in /usr/local/bin/,
>>> which is in the system Path in Windows format, so also in the Cygwin path in
>>> Unix format - will this work?
>> Would a symlink, winsymlink, or .lnk as /bin/wslbridge to /usr/local/bin/?
> Why don't you just try it? Both wslbridge and wslbridge-backend must reside in
> /bin, hard links will work of course.

It looks like without the Fall Update --WSL= does not work with either
no/default distribution found, and the same result with a variety of obvious names:

	$ mintty --WSL
	Option '--WSL' requires an argument
	$ mintty --WSL=
	WSL distribution '' not found
	Try '--help' for more information
	$ mintty --version
	mintty 2.8.0 (x86_64-pc-cygwin)
	© 2013/2017 Andy Koppe / Thomas Wolff
	License GPLv3+: GNU GPL version 3 or later
	There is no warranty, to the extent permitted by law.
	$ uname -srvmo
	CYGWIN_NT-10.0 2.9.0(0.318/5/3) 2017-09-12 10:18 x86_64 Cygwin

but --help does not even mention --WSL=, and the man page mentions wslconfig
which is not installed on the system.

On a legacy install, the only reg values available are:

$ ls -FR
/proc/registry/HKEY_CURRENT_USER/SOFTWARE/Microsoft/Windows/CurrentVersion/Lxss/
/proc/registry/HKEY_CURRENT_USER/SOFTWARE/Microsoft/Windows/CurrentVersion/Lxss/:
DefaultGid  DefaultUid  DefaultUsername  State

$ regtool -lpv list \\HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Lxss
DefaultUsername (REG_SZ) = "..."
DefaultUid (REG_DWORD) = 0x000003e8 (1000)
DefaultGid (REG_DWORD) = 0x000003e8 (1000)
State (REG_DWORD) = 0x00000001 (1)

It would be nice if --WSL did the right thing for legacy installs also.

The problem seems to be in winmain.c on a legacy install, there is no guid, and
no BasePath, so you return false.

If the distro name wslname is null or empty, or no DefaultDistribution,
distribution subkeys, guid, BasePath, or PackageFamilyName, you should take the
else legacy path, and fake the guid, fake the BasePath variable bp to
W("%LOCALAPPDATA%\\lxss") and PackageFamilyName variable pn to Bash, and maybe
also the distro and wslname to Bash.

Also for longopts --WSL should allow an optional_argument, as there should be no
distinction between --WSL and --WSL=, they should be parsed as if they were
--WSL[[ =][distro]], and optional arguments omitted either way, with following
options also terminating the argument scan.

I can raise these as issues on github if you prefer to track there?

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple