warpdotdev / Warp

Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.
https://warp.dev
Other
20.94k stars 358 forks source link

Support Warp for Linux on WSL (Windows Subsystem for Linux) #4240

Open dannyneira opened 6 months ago

dannyneira commented 6 months ago

The issue for users to track and show support for running Warp for Linux on WSL.

To be clear, we are still working on making a native Warp for Windows (exe), which we will post about on #204 later this year so stay tuned!

We have a list of workarounds to issues running Linux here. If none of the workarounds help, please open a new GitHub issue and include logs along with your Linux distro, installation (WSL, Baremetal or VM, x86 or ARM), and the issue you had.

How important is this feature to you?

Please add a 👍 to the original post at the top to signal that you want this feature, and subscribe if you'd like to be notified. We'll be posting updates on this thread (if/when this is being worked on).

Please avoid comments with spam-like "+1" or 👍 .

rgaduput commented 5 months ago

WARP_ENABLE_WAYLAND=1 MESA_D3D12_DEFAULT_ADAPTER_NAME=NVIDIA warp-terminal

Though the browser opens for login works its not working when clicked on "Take Me to Warp" nothing happens. Also i do not get an option to use Auth token in Warp only Sign up and Sign in are available. Any ideas how to make the sign in works or paste the Auth token.

nunix commented 5 months ago

I can copy and paste within the warp window, but can't copy/paste between warp and native Windows apps (both directions).

Same, pretty annoying. The rest works fine though

I'm able to copy and paste by hot keys and by contenxt menu as well. For copy use Ctrl + C and for pasting you should use Ctrl + Shift + V.

This seems to be a fix with the newest release v0.2024.04.02.08.02.stable_01. Just updated Warp and now copy/paste works fine.

nunix commented 5 months ago

@warpdotdev-dx I went through some testing and I do have one tweak for the HIDPI screens. Is there a preferred place to put it, or here is OK?

Please note this is not something you can fix yourself, so it's really more about docs.

Here's a comparison:

Default: image

HIDPI configuration applied: image

noahzweben commented 5 months ago

Hi all! We’ve begun to scope out our Warp on Windows build. We’re looking for some community feedback on what shells to support. Please check out this form (only 5 questions!) here

golu7679 commented 4 months ago

` 09:40:11 [INFO] Failed to forward startup args: unknown dbus error 09:40:11 [INFO] Spawning terminal server process... 09:40:11 [INFO] Running app with windowing system: Wayland 09:40:11 [WARN] Tried to initialize the wayland data control protocol clipboard, but failed. Falling back to the X11 clipboard protocol. The error was: Unknown error while interacting with the clipboard: A required Wayland protocol (zwlr_data_control_manager_v1 version 1) is not supported by the compositor 09:40:11 [INFO] Running terminal server... 09:40:11 [WARN] Unable to fetch system color scheme: InputOutput( Os { code: 2, kind: NotFound, message: "No such file or directory", }, ) 09:40:11 [ERROR] Failed to acquire default Secret Service collection: unknown error 09:40:11 [INFO] Failed to read User from secure storage NotFound 09:40:11 [INFO] Initializing crash reporting Some("linux_stable_release") with tag "v0.2024.04.16.08.02.stable_00"... 09:40:11 [INFO] Starting warp with channel state ChannelState { channel: Stable, app_id: AppId { qualifier: "dev", organization: "warp", application_name: "Warp" }, additional_features: {}, firebase_api_key: "AIzaSyBdy3O3S9hrdayLJxJ7mriBR4qgUaUygAs", server_root_url: "https://app.warp.dev", ws_server_url: "wss://rtc.app.warp.dev/graphql", session_sharing_server_url: Some("wss://session-sharing-server-o3mgmiurkq-uk.a.run.app"), segment_write_key: "sTT9ZajzIaQ0phzLFOnqZ6VOqplJTlaJ", segment_root_url: "https://api.segment.io", releases_base_url: "https://releases.warp.dev", sentry_url: "https://0195a81da0714f55a93ee4624825f9ec@o540343.ingest.sentry.io/5658526", logfile_name: "warp.log", show_autoupdate_menu_items: true, skip_login: false } and version Some("v0.2024.04.16.08.02.stable_00") 09:40:11 [INFO] Performance metrics collector started 09:40:11 [INFO] Start to flush telemetry events to Segment 09:40:11 [INFO] Initializing app services 09:40:11 [ERROR] Failed to initialize org.freedesktop.Application D-Bus service: I/O error: No such file or directory (os error 2): No such file or directory (os error 2) libEGL warning: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)

09:40:11 [INFO] Connecting to SQLite database 09:40:11 [INFO] Checking for update on channel stable_release. Update id is vb81oFm 09:40:11 [INFO] fetching team tester status 09:40:11 [INFO] Fetching channel versions (without changelogs) from Warp server 09:40:11 [INFO] dispatching global action for root_view:open_from_restored 09:40:11 [INFO] dispatching global action for root_view:open_new 09:40:11 [WARN] error getting team tester status: Failed to get access token for GraphQL request. Falling back to in-memory state. 09:40:11 [WARN] Encountered error while watching for desktop settings change events: I/O error: No such file or directory (os error 2) 09:40:11 [ERROR] XDG Settings Portal did not return response in time: timeout: 100ms, key: color-scheme libEGL warning: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)

09:40:11 [INFO] Enabled wgpu backends: Backends(VULKAN | GL | METAL | DX12 | DX11 | BROWSER_WEBGPU) 09:40:11 [INFO] Available wgpu adapters (in priority order): 09:40:11 [ERROR] Failed to open window: No usable wgpu adapter was found 09:40:11 [INFO] application will terminate 09:40:11 [INFO] Shutting down SQLite writer thread 09:40:11 [INFO] Shut down SQLite writer in 487.087µs 09:40:11 [INFO] Writing queued events to disk because telemetry is enabled. 09:40:11 [INFO] Successfully wrote telemetry events to disk 09:40:11 [INFO] Tearing down app services... 09:40:11 [INFO] Uninitializing crash reporting... 09:40:12 [INFO] Received channel versions from Warp server: dev: ChannelVersion { version_info: VersionInfo { version: "v0.2024.04.23.08.01.dev_00", update_by: None, soft_cutoff: Some("v0.2023.05.12.08.03.dev_00") }, overrides: [] }; preview: ChannelVersion { version_info: VersionInfo { version: "v0.2024.04.23.08.01.preview_00", update_by: None, soft_cutoff: None }, overrides: [] }; canary: ChannelVersion { version_info: VersionInfo { version: "v0.2022.09.29.08.08.canary_00", update_by: None, soft_cutoff: None }, overrides: [] }; beta: ChannelVersion { version_info: VersionInfo { version: "v0.2024.04.23.08.01.beta_00", update_by: None, soft_cutoff: None }, overrides: [] }; stable: ChannelVersion { version_info: VersionInfo { version: "v0.2024.04.16.08.02.stable_00", update_by: None, soft_cutoff: Some("v0.2024.02.27.08.01.stable_03") }, overrides: [VersionOverride { predicate: TargetOS(Linux), version_info: VersionInfo { version: "v0.2024.04.16.08.02.stable_03", update_by: None, soft_cutoff: None } }] } `

I am getting this error when I run wrap, how can I resolve this issue?

vorporeal commented 4 months ago

Hi @golu7679 - did you install Warp using a package manager or are you running the AppImage? Seems like you're lacking graphics drivers. What Linux distribution are you running within WSL?

Rayhand117 commented 4 months ago

if you guys facing this error: libEGL warning: MESA-LOADER: failed to open swrast: /usr/lib64/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib64/dri, suffix _dri) install this package: rpm: sudo dnf install -y mesa-dri-drivers

deb: sudo apt install -y libgl1-mesa-dri

mesa-loader

i manage to run warp on almalinux and kali-linux. Good Luck!

@golu7679

golu7679 commented 4 months ago

if you guys facing this error: libEGL warning: MESA-LOADER: failed to open swrast: /usr/lib64/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib64/dri, suffix _dri) install this package: rpm: sudo dnf install -y mesa-dri-drivers deb: sudo apt install -y libgl1-mesa-dri mesa-loader i manage to run warp on almalinux and kali-linux. Good Luck!

@golu7679

Thank you now its working

rgaduput commented 4 months ago

Hi, When installed on WSL Ubuntu, I see that even though I have Google chrome installed in WSL and variable set to export BROWSER=google-chrome. warp still opening the Signin in the Desktop browser and not the Ubuntu WSL browser. I think because of that "Take me to wrap" does not work after successful login, so unable to login. Any suggestions on how to login with the WSL browser (Other tools like aws for SSO login is able to open the browser without any issues).

nmofonseca commented 4 months ago

I am one up for having this in WSL Linux :)

SubhamSubhasisPatra commented 4 months ago

Works decently on wsl2, but I can't resize or move the window at all besides clicking the fullscreen button, and once I fullscreen the window, I can't change it back to windowed again.

Actully you can resize the window , the resize is not woking on all the side but it woks in the extime edge of the screen ( look at the attacked video ) this way u can resize it and also you can increase the font size so it's workable.

https://github.com/warpdotdev/Warp/assets/43811917/b13684f8-af90-42b0-8d87-117661b57127

matifali commented 4 months ago

Getting the following issue when running on WSL2 with Ubuntu 24.04 and Windows 11.

RUST_BACKTRACE=full warp-terminal
14:03:27 [INFO] Spawning terminal server process...
thread 'main' panicked at /home/runner/work/warp-internal/warp-internal/ui/src/windowing/winit/app.rs:156:14:
should be able to create event loop: Os(OsError { line: 80, file: "/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.15/src/platform_impl/linux/wayland/event_loop/mod.rs", error: WaylandError(Connection(NoCompositor)) })
stack backtrace:
   0:     0x564a4b572cbb - <unknown>
   1:     0x564a4ad75d20 - <unknown>
   2:     0x564a4b56e243 - <unknown>
   3:     0x564a4b572a54 - <unknown>
   4:     0x564a4b574fd0 - <unknown>
   5:     0x564a4b574cef - <unknown>
   6:     0x564a4b5754ee - <unknown>
   7:     0x564a4b5753f2 - <unknown>
   8:     0x564a4b5731b6 - <unknown>
   9:     0x564a4b575160 - <unknown>
  10:     0x564a4aa2b265 - <unknown>
  11:     0x564a4aa2b7b3 - <unknown>
  12:     0x564a4c6da704 - <unknown>
  13:     0x564a4c43033f - <unknown>
  14:     0x564a4c42efb3 - <unknown>
  15:     0x564a4b545da3 - <unknown>
  16:     0x564a4b545dbd - <unknown>
  17:     0x564a4b564a05 - <unknown>
  18:     0x564a4b54632c - <unknown>
  19:     0x7f8eedc6c1ca - <unknown>
  20:     0x7f8eedc6c28b - __libc_start_main
  21:     0x564a4ab73c3e - <unknown>
  22:                0x0 - <unknown>
14:03:27 [INFO] Received empty message; assuming the connection has been closed.
SubhamSubhasisPatra commented 4 months ago

Getting the following issue when running on WSL2 with Ubuntu 24.04 and Windows 11.

RUST_BACKTRACE=full warp-terminal
14:03:27 [INFO] Spawning terminal server process...
thread 'main' panicked at /home/runner/work/warp-internal/warp-internal/ui/src/windowing/winit/app.rs:156:14:
should be able to create event loop: Os(OsError { line: 80, file: "/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.15/src/platform_impl/linux/wayland/event_loop/mod.rs", error: WaylandError(Connection(NoCompositor)) })
stack backtrace:
   0:     0x564a4b572cbb - <unknown>
   1:     0x564a4ad75d20 - <unknown>
   2:     0x564a4b56e243 - <unknown>
   3:     0x564a4b572a54 - <unknown>
   4:     0x564a4b574fd0 - <unknown>
   5:     0x564a4b574cef - <unknown>
   6:     0x564a4b5754ee - <unknown>
   7:     0x564a4b5753f2 - <unknown>
   8:     0x564a4b5731b6 - <unknown>
   9:     0x564a4b575160 - <unknown>
  10:     0x564a4aa2b265 - <unknown>
  11:     0x564a4aa2b7b3 - <unknown>
  12:     0x564a4c6da704 - <unknown>
  13:     0x564a4c43033f - <unknown>
  14:     0x564a4c42efb3 - <unknown>
  15:     0x564a4b545da3 - <unknown>
  16:     0x564a4b545dbd - <unknown>
  17:     0x564a4b564a05 - <unknown>
  18:     0x564a4b54632c - <unknown>
  19:     0x7f8eedc6c1ca - <unknown>
  20:     0x7f8eedc6c28b - __libc_start_main
  21:     0x564a4ab73c3e - <unknown>
  22:                0x0 - <unknown>
14:03:27 [INFO] Received empty message; assuming the connection has been closed.

@matifali Try to run this command and run the application , might fix your issue

sudo apt update && sudo apt install -y fontconfig libegl1 libwayland-egl1 libxcursor1 libxkbcommon-x11-0

vorporeal commented 4 months ago

@matifali if you try installing the packages in the above comment, mind doing so one at a time and letting me know which package fixed the issue (if any)?

matifali commented 4 months ago

@SubhamSubhasisPatra @vorporeal Looks like all packages are already installed.

sudo apt update && sudo apt install -y fontconfig libegl1 libwayland-egl1 libxcursor1 libxkbcommon-x11-0
Hit:1 http://security.ubuntu.com/ubuntu noble-security InRelease
Ign:2 https://releases.warp.dev/linux/deb stable InRelease
Hit:3 http://archive.ubuntu.com/ubuntu noble InRelease
Hit:4 http://archive.ubuntu.com/ubuntu noble-updates InRelease
Hit:5 https://releases.warp.dev/linux/deb stable Release
Hit:7 http://archive.ubuntu.com/ubuntu noble-backports InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
8 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
fontconfig is already the newest version (2.15.0-1.1ubuntu2).
libegl1 is already the newest version (1.7.0-1build1).
libegl1 set to manually installed.
libwayland-egl1 is already the newest version (1.22.0-2.1build1).
libxcursor1 is already the newest version (1:1.2.1-1build1).
libxkbcommon-x11-0 is already the newest version (1.6.0-1build1).
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.

warp-terminal
08:24:28 [INFO] Spawning terminal server process...
thread 'main' panicked at /home/runner/work/warp-internal/warp-internal/ui/src/windowing/winit/app.rs:156:14:
should be able to create event loop: Os(OsError { line: 80, file: "/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.15/src/platform_impl/linux/wayland/event_loop/mod.rs", error: WaylandError(Connection(NoCompositor)) })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
08:24:28 [INFO] Received empty message; assuming the connection has been closed.
vorporeal commented 4 months ago

Hm. Make sure you have wslg installed: https://github.com/microsoft/wslg

It provided the components necessary to run graphical applications within WSL.

matifali commented 4 months ago

@vorporeal it is. I can launch other GUI apps like gedit and nautilus just fine.the problem is with only warp-terminal

vorporeal commented 4 months ago

@matifali what's the value of the WAYLAND_DISPLAY environment variable?

matifali commented 4 months ago

@matifali what's the value of the WAYLAND_DISPLAY environment variable?

@vorporeal

echo $WAYLAND_DISPLAY
wayland-0
vlisovych commented 4 months ago

Hey @matifali, I'm getting the same error on wsl2, ubuntu 24.04, win 11. However, warp works with sudo: sudo warp-terminal

matifali commented 4 months ago

@vlisovych Wow. Yes, it's working with sudo; why, though?

vorporeal commented 4 months ago

@matifali @vlisovych What's the output of running find /run /mnt/wslg -name "wayland-0" 2>/dev/null | xargs ls -la? I'm guessing that there's some sort of permission issue with the Wayland socket file, which is preventing Warp from accessing it unless you run Warp as root.

A couple issues on the WSL side that might be relevant:

matifali commented 4 months ago

@vorporeal

find /run /mnt/wslg -name "wayland-0" 2>/dev/null | xargs ls -la
srwxrwxrwx 1 atif atif 0 May  9 21:02 /mnt/wslg/runtime-dir/wayland-0
Stelminator commented 4 months ago

@matifali @vorporeal I think this might be with the permissions on /mnt/wslg/runtime-dir/, I got different results on my 23.10 install vs. 24.04. 23.10 had my user/group as owner, and 24.04 had ubuntu/lxd, which might be hiding it from my user on 24.04, even if the socket itself has the right permissions.

ls -lad /mnt/wslg/runtime-dir/
vorporeal commented 4 months ago

@Stelminator yeah that seems plausible. Is your user a member of the lxd group? If not, try adding that group membership and see if that fixes the issue. (Note: you might need to shut down wsl and start it again for the group membership change to take effect)

vorporeal commented 4 months ago

Yeah I think this is the relevant issue on the WSL side: https://github.com/microsoft/WSL/issues/11542

matifali commented 4 months ago

For me this gives,

ls -lad /mnt/wslg/runtime-dir/
drwx------ 4 atif atif 120 May  9 21:02 /mnt/wslg/runtime-dir/

Looks like permissions are correct.

jo-pillar commented 4 months ago

Hi, When installed on WSL Ubuntu, I see that even though I have Google chrome installed in WSL and variable set to export BROWSER=google-chrome. warp still opening the Signin in the Desktop browser and not the Ubuntu WSL browser. I think because of that "Take me to wrap" does not work after successful login, so unable to login. Any suggestions on how to login with the WSL browser (Other tools like aws for SSO login is able to open the browser without any issues).

I met the same problem in #4910 and another guy also met the same problem on comment under #4903

volkancakil commented 3 months ago

This is linux support not WSL support, headline pretty misleding Btw you can use any linux GUI apps in WSL already if you have WSLg and supported X server (wayland etc) installed. So i didnt get what kind of support you providing for WSL side

nunix commented 2 months ago

This is linux support not WSL support, headline pretty misleding Btw you can use any linux GUI apps in WSL already if you have WSLg and supported X server (wayland etc) installed. So i didnt get what kind of support you providing for WSL side

hmm, not that simple. As the WSL distros are mainly based on "server" rootfs, you lack a ton of libraries and other settings (cgroup2 is still a "hack", in case your app relies on it --> containerd/docker/others)

So providing "support on WSL2" is ensuring the app fully runs as intended (there is/was some copy/paste issues, resizing the window not supported, etc...)

I do not work for Warp, just a WSL afficionado that has experienced the same recurring issues in other apps.

east4ming commented 2 months ago

@vlisovych Wow. Yes, it's working with sudo; why, though?

The problem may be caused by Ubuntu 24.04 + WSL2. WSL2's wslg is bound to user id 1000 by default, in previous versions of Ubuntu, 1000 was the user we created, but in ubuntu 24.04, id=1000 is the user ubuntu. The user we created could be 1002...

This is the default result of my ubuntu 24.04 installation via the MS Store:

❯ ls -lad /mnt/wslg/runtime-dir/
Permissions Size User   Date Modified Name
drwx------     - ubuntu 13 Jul 19:14   /mnt/wslg/runtime-dir

❯ cat /etc/passwd
ubuntu:x:1000:1001:Ubuntu:/home/ubuntu:/bin/bash
casey:x:1002:1002:Casey TSui:/home/casey:/usr/bin/zsh

The solution, I think, can be found here. https://canonical-ubuntu-wsl.readthedocs-hosted.com/en/latest/tutorials/cloud-init/ . In short, set your userid to 1000.

isaiah2004 commented 1 month ago

if anyone is wondering the ubuntu LTS(22.04.3) wsl version lags a bit but works flawlessly otherwise.

tm65 commented 1 month ago

Works on WSL2, Ubuntu 22.04.3 LTS on Win11 after

sudo apt install -y firefox wslu

without that step it was stuck of the telemetry step. I think it's probably just the WSL utilities needed, which provided the UI components necessary to launch the sign up/sign in popup. It was Edge (default on my machine) that was launched to sign in. After signing in to Github, Take me back to Warp didn't complete the loop. Look for the tiny 'copy' link on that icon to get the auth code, it is NOT found in the Authorized apps page for Warp in your github profile, go figure.

rwaltenberg commented 1 month ago

I have it working here but the keyboard layout seems messed around. My layout is BR ABNT2 and I have it set with setxkbmap -model abnt2 -layout br -variant abnt2. My Gitkraken is working through WSL2 with the correct layout but Warp seems to think I'm using a US keyboard.

da-moon commented 3 weeks ago

I was able to get it to work on my arch install. The issue might have been due to a problem with mesa . Follow the instructions here to rebuild mesa from source

After fixing that, I was able to launch warp terminal with WGPU_BACKEND=vulkan warp-terminal command

sudo sed -i.bak -e 's/^Exec=warp-terminal %U$/Exec=env WGPU_BACKEND=vulkan warp-terminal %U/' "/usr/share/applications/dev.warp.Warp.desktop"
 λ cat /mnt/wslg/versions.txt
WSLg ( x86_64 ): 1.0.61+Branch.main.Sha.54f177d201aecda01347f952e01777c75480fc74
Built at: Tue Apr 2 20:52:28 UTC 2024
Mariner: VERSION="2.0.20240112"
DirectX-Headers:
mesa:
pulseaudio: 6f045ff0dca233a939a2aba815f84d177e294122
FreeRDP: c4030980b29322a9cb2190711a5fadeeeb8b6a33
weston: f227edd681479ec3cb2290a25d84d2d3462aebfa
❯ wsl --version
WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.26120.1350
❯ Get-ComputerInfo | Select-Object OsName, OsVersion, WindowsVersion, OsBuildNumber

OsName                   OsVersion  WindowsVersion OsBuildNumber
------                   ---------  -------------- -------------
Microsoft Windows 11 Pro 10.0.26120 2009           26120