mirror of
				https://github.com/mintty/wsltty.git
				synced 2025-11-04 00:51:52 +00:00 
			
		
		
		
	Compare commits
	
		
			16 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					be4e7fef44 | ||
| 
						 | 
					a2df28017b | ||
| 
						 | 
					09972471b9 | ||
| 
						 | 
					c13340b328 | ||
| 
						 | 
					8d7ffa75bb | ||
| 
						 | 
					305fd0f273 | ||
| 
						 | 
					fb1bf601e9 | ||
| 
						 | 
					adc7036609 | ||
| 
						 | 
					fef944e1bb | ||
| 
						 | 
					d40e5919af | ||
| 
						 | 
					a141e760f4 | ||
| 
						 | 
					14f6d1e631 | ||
| 
						 | 
					e189d87a2c | ||
| 
						 | 
					399dff4226 | ||
| 
						 | 
					8fbee63214 | ||
| 
						 | 
					effb0ce46a | 
							
								
								
									
										40
									
								
								0012-get-vmid-from-registry.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								0012-get-vmid-from-registry.patch
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,40 @@
 | 
			
		||||
--- wslbridge2/src/wslbridge2.cpp	2024-10-10 20:20:21.931891800 +0000
 | 
			
		||||
+++ wslbridge2-0.12/src/wslbridge2.cpp	2024-10-08 09:31:35.954145800 +0000
 | 
			
		||||
@@ -228,6 +228,26 @@ static void start_dummy(std::wstring wsl
 | 
			
		||||
     CloseHandle(pi.hThread);
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
+bool GetIdFromRegistry(GUID *guid) {
 | 
			
		||||
+    HKEY hKeyRoot = HKEY_LOCAL_MACHINE;
 | 
			
		||||
+    std::wstring subKey = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\HostComputeService\\VolatileStore\\ComputeSystem";
 | 
			
		||||
+    HKEY hKey;
 | 
			
		||||
+    if (RegOpenKeyEx(hKeyRoot, subKey.c_str(), 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
 | 
			
		||||
+        DWORD index = 0;
 | 
			
		||||
+        WCHAR keyName[256];
 | 
			
		||||
+        DWORD keyNameSize = sizeof(keyName) / sizeof(keyName[0]);
 | 
			
		||||
+
 | 
			
		||||
+        while (RegEnumKeyEx(hKey, index, keyName, &keyNameSize, nullptr, nullptr, nullptr, nullptr) == ERROR_SUCCESS) {
 | 
			
		||||
+            RegCloseKey(hKey);
 | 
			
		||||
+            std::wstring id = L"{" + std::wstring(keyName) + L"}";
 | 
			
		||||
+            return IIDFromString(id.c_str(), guid) == S_OK;
 | 
			
		||||
+        }
 | 
			
		||||
+        RegCloseKey(hKey);
 | 
			
		||||
+    }
 | 
			
		||||
+    return false;
 | 
			
		||||
+}
 | 
			
		||||
+
 | 
			
		||||
+
 | 
			
		||||
 int main(int argc, char *argv[])
 | 
			
		||||
 {
 | 
			
		||||
     /* Minimum requirement Windows 10 build 17763 aka. version 1809 */
 | 
			
		||||
@@ -387,8 +407,8 @@ int main(int argc, char *argv[])
 | 
			
		||||
         if (LiftedWSLVersion)
 | 
			
		||||
             start_dummy(wslPath, wslCmdLine, distroName, debugMode);
 | 
			
		||||
 
 | 
			
		||||
-        const HRESULT hRes = GetVmId(&DistroId, &VmId, LiftedWSLVersion);
 | 
			
		||||
-        if (hRes != 0)
 | 
			
		||||
+        const bool hRes = GetIdFromRegistry(&VmId);
 | 
			
		||||
+        if (!hRes)
 | 
			
		||||
             fatal("GetVmId: %s\n", GetErrorMessage(hRes).c_str());
 | 
			
		||||
 
 | 
			
		||||
         inputSock = win_vsock_create();
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
mintty is copyright 2008-22 Andy Koppe, 2015-22 Thomas Wolff.
 | 
			
		||||
mintty is copyright 2008-23 Andy Koppe, 2015-23 Thomas Wolff.
 | 
			
		||||
 | 
			
		||||
Licensed under the terms of the GNU General Public License version 3 or later,
 | 
			
		||||
amended with the bundling clause to clarify ambiguous interpretation.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										28
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								README.md
									
									
									
									
									
								
							@@ -18,7 +18,14 @@ WSLtty components
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
### Requirement ###
 | 
			
		||||
### Requirements ###
 | 
			
		||||
 | 
			
		||||
Wsltty does not seem to work with WSL V2 mode since release 2.0.0 (#343).
 | 
			
		||||
As a workaround until a solution in the wslbridge gateway, it is suggested 
 | 
			
		||||
to install [release 1.3.17](https://github.com/microsoft/WSL/releases/tag/1.3.17); 
 | 
			
		||||
maybe uninstall WSL first, see [issue 343 comment](https://github.com/mintty/wsltty/issues/343#issuecomment-1818367512).
 | 
			
		||||
Another remedy could be to configure your WSL distributions to run in WSL V1 mode, for example:
 | 
			
		||||
`wsl --set-version Ubuntu 1`.
 | 
			
		||||
 | 
			
		||||
Since release 3.0.5, WSLtty requires Windows version 1809 (the November 2018 release).
 | 
			
		||||
 | 
			
		||||
@@ -28,8 +35,10 @@ Since release 3.0.5, WSLtty requires Windows version 1809 (the November 2018 rel
 | 
			
		||||
 | 
			
		||||
#### WSLtty installer ([Download](https://github.com/mintty/wsltty/releases) standalone installation) ####
 | 
			
		||||
 | 
			
		||||
Run the [installer](https://github.com/mintty/wsltty/releases) to install 
 | 
			
		||||
the components listed above.
 | 
			
		||||
From the [release downloads](https://github.com/mintty/wsltty/releases), 
 | 
			
		||||
run the wsltty-VERSION-x86_64-install.exe installer to install 
 | 
			
		||||
the components listed above. Make sure to select a 64-bit installer 
 | 
			
		||||
on a 64-bit system.
 | 
			
		||||
If Windows complains with a “Windows protected your PC” popup, 
 | 
			
		||||
you may need to click “Run anyway” to proceed with the installation.
 | 
			
		||||
You may need to open the Properties of the installer first, tab “General” 
 | 
			
		||||
@@ -54,6 +63,11 @@ release also contains a `.cab` file. Download it, open it, extract its files
 | 
			
		||||
to some temporary deployment directory, and invoke `install.bat` from there, 
 | 
			
		||||
or `install-portable.bat` for a portable installation.
 | 
			
		||||
 | 
			
		||||
#### Quiet installer ####
 | 
			
		||||
 | 
			
		||||
The wsltty-VERSION-x86_64-install-quiet.exe installer is intended for 
 | 
			
		||||
integration in another installation framework.
 | 
			
		||||
 | 
			
		||||
#### Installation from source repository ####
 | 
			
		||||
 | 
			
		||||
Checkout the wsltty repository, or download the source archive, unpack and rename the directory to `wsltty`.
 | 
			
		||||
@@ -66,6 +80,12 @@ environment for this purpose would be installed with the
 | 
			
		||||
from [cygwin.com](https://cygwin.com/), 
 | 
			
		||||
with additional packages `make`, `gcc-g++`, `unzip`, `zoo`, `patch`, (`lcab`).
 | 
			
		||||
 | 
			
		||||
#### Build installers ####
 | 
			
		||||
 | 
			
		||||
Install a minimal Cygwin environment plus the additional packages as 
 | 
			
		||||
listed for «Installation from source repository».
 | 
			
		||||
Invoke `make pkg` or just `make`.
 | 
			
		||||
 | 
			
		||||
#### Installation to non-default locations ####
 | 
			
		||||
 | 
			
		||||
(For experts)
 | 
			
		||||
@@ -214,7 +234,7 @@ Start Menu subfolder `WSLtty`:
 | 
			
		||||
 | 
			
		||||
Wsltty installation and the mintty terminal try to use the icon of the 
 | 
			
		||||
respective WSL distribution. If it cannot be determined, a penguin icon 
 | 
			
		||||
is used as a default. You can replace it with your preferred fallback icon 
 | 
			
		||||
is used as a fallback. You can replace it with your preferred default icon 
 | 
			
		||||
by replacing the icon file `%LOCALAPPDATA%\wsltty\wsl.ico`.
 | 
			
		||||
 | 
			
		||||
#### Mintty settings ####
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										33
									
								
								makefile
									
									
									
									
									
								
							
							
						
						
									
										33
									
								
								makefile
									
									
									
									
									
								
							@@ -10,16 +10,16 @@
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# wsltty release
 | 
			
		||||
ver=3.7.0
 | 
			
		||||
ver=3.7.6
 | 
			
		||||
 | 
			
		||||
# wsltty appx release - must have 4 parts!
 | 
			
		||||
verx=3.7.0.1
 | 
			
		||||
verx=3.7.6.1
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
##############################
 | 
			
		||||
# mintty release version
 | 
			
		||||
 | 
			
		||||
minttyver=3.7.0
 | 
			
		||||
minttyver=3.7.6
 | 
			
		||||
 | 
			
		||||
##############################
 | 
			
		||||
 | 
			
		||||
@@ -27,7 +27,7 @@ minttyver=3.7.0
 | 
			
		||||
repo=Biswa96/wslbridge2
 | 
			
		||||
 | 
			
		||||
# wslbridge2 master release version
 | 
			
		||||
wslbridgever=0.11
 | 
			
		||||
wslbridgever=0.12
 | 
			
		||||
 | 
			
		||||
# wslbridge2 latest version
 | 
			
		||||
#archive=master
 | 
			
		||||
@@ -56,7 +56,7 @@ wslbridgedir=wslbridge2-$(wslbridgever)
 | 
			
		||||
#minttyver=master
 | 
			
		||||
 | 
			
		||||
# wslbridge branch or commit to build from source;
 | 
			
		||||
wslbridge=wslbridge-frontend wslbridge-backend
 | 
			
		||||
wslbridge=wslbridge-source wslbridge-frontend wslbridge-backend
 | 
			
		||||
 | 
			
		||||
##############################
 | 
			
		||||
# build backend on a musl-libc-based distribution
 | 
			
		||||
@@ -73,10 +73,15 @@ WINSDKVER=`regtool list '$(WINSDKKEY)' | sed -e '$$ q' -e d`
 | 
			
		||||
 | 
			
		||||
all:	all-$(notdir $(CURDIR))
 | 
			
		||||
 | 
			
		||||
all-wsltty:	check pkg
 | 
			
		||||
# targets and version checking
 | 
			
		||||
 | 
			
		||||
all-wsltty:	check committed pkg
 | 
			
		||||
 | 
			
		||||
all-wsltty.appx:	appx
 | 
			
		||||
 | 
			
		||||
committed:
 | 
			
		||||
	if git status -suno | sed -e "s,^..,," | grep .; then false; fi
 | 
			
		||||
 | 
			
		||||
#############################################################################
 | 
			
		||||
# target checking and some defs
 | 
			
		||||
 | 
			
		||||
@@ -154,8 +159,10 @@ wslbridge-source:	$(wslbridgedir).zip
 | 
			
		||||
	#cd $(wslbridgedir); patch -p1 < ../0001-notify-size-change-inband.patch
 | 
			
		||||
	# patch to https://github.com/Biswa96/wslbridge2/commit/41575379b416703c49e2687e957440239a4cdfb7
 | 
			
		||||
	#cd $(wslbridgedir); patch -p0 < ../0002-add-com-for-lifted-wsl.patch
 | 
			
		||||
	# patch to fix WSL 2 launching, again
 | 
			
		||||
	cd $(wslbridgedir); patch -p1 < ../0012-get-vmid-from-registry.patch
 | 
			
		||||
 | 
			
		||||
wslbridge-frontend:	wslbridge-source
 | 
			
		||||
wslbridge-frontend:
 | 
			
		||||
	echo ------------- Compiling wslbridge2 frontend
 | 
			
		||||
	mkdir -p bin
 | 
			
		||||
	# frontend build
 | 
			
		||||
@@ -165,7 +172,7 @@ wslbridge-frontend:	wslbridge-source
 | 
			
		||||
 | 
			
		||||
windir=$(shell cd "${WINDIR}"; pwd)
 | 
			
		||||
 | 
			
		||||
wslbridge-backend:	wslbridge-source
 | 
			
		||||
wslbridge-backend:
 | 
			
		||||
	echo ------------- Compiling wslbridge2 backend
 | 
			
		||||
	#uname -m | grep x86_64
 | 
			
		||||
	mkdir -p bin
 | 
			
		||||
@@ -176,10 +183,16 @@ wslbridge-backend:	wslbridge-source
 | 
			
		||||
	# extract binaries
 | 
			
		||||
	cp $(wslbridgedir)/bin/wslbridge2-backend bin/
 | 
			
		||||
 | 
			
		||||
mintty-get:
 | 
			
		||||
mintty-get:	mintty-git	# mintty-download or mintty-git
 | 
			
		||||
	cp mintty-$(minttyver)/icon/terminal.ico mintty.ico
 | 
			
		||||
 | 
			
		||||
mintty-download:
 | 
			
		||||
	$(wgeto) https://github.com/mintty/mintty/archive/$(minttyver).zip -o mintty-$(minttyver).zip
 | 
			
		||||
	unzip -o mintty-$(minttyver).zip
 | 
			
		||||
	cp mintty-$(minttyver)/icon/terminal.ico mintty.ico
 | 
			
		||||
 | 
			
		||||
mintty-git:
 | 
			
		||||
	test -d mintty-$(minttyver) || git clone --depth 111 https://github.com/mintty/mintty.git mintty-$(minttyver)
 | 
			
		||||
	cd mintty-$(minttyver); git checkout $(minttyver)
 | 
			
		||||
 | 
			
		||||
wslbuild=LDFLAGS="-static -static-libgcc -s"
 | 
			
		||||
appxbuild=$(wslbuild) CCOPT=-DWSLTTY_APPX
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user