mintty / wsltty

Mintty as a terminal for Bash on Ubuntu on Windows / WSL
Other
3.11k stars 104 forks source link

WSL: wsltty starts but then immediate closes #352

Open tig opened 4 months ago

tig commented 4 months ago

10AMbbe 1

System type 64-bit operating system, ARM-based processor
Edition Windows 11 Enterprise
Version 24H2
Installed on    ‎6/‎20/‎2024
OS build    26120.1252
Experience  Windows Feature Experience Pack 1000.26100.11.0
Processor   Snapdragon(R) X 12-core X1E80100 @ 3.40 GHz   3.42 GHz

How can I diagnose this?

Biswa96 commented 4 months ago

The program has not been tested in ARM64 environment.

tig commented 4 months ago

The program has not been tested in ARM64 environment.

Can I help?

mintty commented 4 months ago

It seems that the wsltty terminal runs fine and your Ubuntu.bat crashes. Which is not really related to wsltty. To help you anyway, some more information might help. What's the contents of Ubuntu.bat and what happens if you invoke its command step by step?

mintty commented 4 months ago

And what does this environment look like in the first place? Is the WSL backend some Intel emulation like apparently the wsltty runtime, or is it a native ARM WSL? In the latter case, it is quite clear this cannot work as there is no wslbridge backend for ARM.

tig commented 4 months ago

And what does this environment look like in the first place? Is the WSL backend some Intel emulation like apparently the wsltty runtime, or is it a native ARM WSL? In the latter case, it is quite clear this cannot work as there is no wslbridge backend for ARM.

WSL is natively ARM on Windows on ARM. Ubuntu is the ARM version.

Here's the Ubuntu.bat that was created by the wslttty installer (winget wsltty):

@echo off
rem Start mintty terminal for WSL package Ubuntu in current directory
%LOCALAPPDATA%\wsltty\bin\mintty.exe -i "C:\Program Files/WindowsApps/CanonicalGroupLimited.Ubuntu_2204.3.49.0_arm64__79rhkp1fndgsc/ubuntu.exe" --WSL="Ubuntu" --configdir="%APPDATA%\wsltty"  - %*
mintty commented 4 months ago

WSL is natively ARM on Windows on ARM. Ubuntu is the ARM version.

OK, so we'd need an ARM build of the wslbridge backend. Maybe you can give it a try. Install a wsltty build environment (https://github.com/mintty/wsltty#installation-from-source-repository), download/git-clone wsltty and make it.

Biswa96 commented 4 months ago

OK, so we'd need an ARM build of the wslbridge backend.

cygwin environment neither support aarch64 nor arm64ec targets.

mintty commented 4 months ago

Emulation seems to be supporting cygwin on ARM. An ARM wsltty build was discussed before (#209). The only missing part is the backend, which builds in the WSL environment anyway. I don't have the full picture but I think it could work.

tig commented 4 months ago

For what it's worth, if I run .\bin\mintty.exe from a cmd prompt with Admin rights, I get this:

image

tig commented 4 months ago

FWIW, all new Surface laptops are ARM based and make pretty great dev machines. Faster than snot with great battery life compared to the older x64 units. Thus this will be a likely growing platform for y'all.

Biswa96 commented 4 months ago

You could clone https://github.com/Biswa96/wslbridge2/ repository and build the backend in ARM64 WSL distribution with make command. The project requires g++, make and Linux headers. Then move the wslbridge2-backend in %LocalAppData%\wsltty\bin directory.

mintty commented 4 months ago

.\bin\mintty.exe from a cmd prompt

That's not a supposed mode of using wsltty-embedded mintty. Its default shell is bash which is not installed in that deployment. You can however, run this mintty with an explicit shell. /bin/dash will work (but not help you much as the usual POSIX tools are not installed). You can also run it with cmd or powershell.

mintty commented 4 months ago

Surface laptops are ARM based and make pretty great dev machines ...

If someone donates one of them to me or Biswa, I guess we'll do our best to make this work :) But I think with our previous comments, you should be able to achieve it yourself. Once it runs, I'll see how we can integrate it into the project (maybe there's an ARM CI build that can be used).