Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When trying to run xterm: No Xauth Cookie found :( #150

Open
KernelDeimos opened this issue Oct 7, 2024 · 1 comment
Open

When trying to run xterm: No Xauth Cookie found :( #150

KernelDeimos opened this issue Oct 7, 2024 · 1 comment

Comments

@KernelDeimos
Copy link

Hello, thanks for the help on issue #149, I've been following through the documentation and at this point I've gotten to an error that I'm having trouble getting past. I'm running compositor-shell and compositor-proxy-cli on the same host, and trying to run xterm. I see the following error: No Xauth Cookie found :(.

I'm not sure where the Xauth cookie comes from so it's difficult for me to find the source of the problem. I did try creating an "empty" auth cookie based on a default value I saw in auth.ts:

diff --git a/libs/xtsb/src/auth.ts b/libs/xtsb/src/auth.ts
index efedda8..7c17e2c 100644
--- a/libs/xtsb/src/auth.ts
+++ b/libs/xtsb/src/auth.ts
@@ -58,8 +58,14 @@ async function writeClientHello(
   socketFamily: 'IPv4' | 'IPv6' | undefined,
   cookie?: { authName: string; authData: string },
 ): Promise<void> {
-  if (!cookie || paddedString(cookie.authData).length === 0 || paddedString(cookie.authName).length === 0) {
-    throw new Error('No Xauth Cookie found :(')
+  // if (!cookie || paddedString(cookie.authData).length === 0 || paddedString(cookie.authName).length === 0) {
+  //   throw new Error('No Xauth Cookie found :(')
+  // }
+  if (!cookie) {
+    cookie = {
+      authName: '',
+      authData: '',
+    }
   }
 
   const byteOrder = getByteOrder()

After trying this I quickly realized this approach wouldn't get me very far, because I got an error on the next piece of code that seems to expect this cookie not to have empty string values:

RangeError: Invalid format string: <BxHHHHxx0s0s

I'm not sure what else I can try next so any help is appreciated. If I can get just enough information to figure the rest out on my own, I'll return the favor by adding any applicable documentation.

@Zubnix
Copy link
Collaborator

Zubnix commented Oct 7, 2024

I believe you need to add it using these xauth commands (I’ll update the docs with more details).

XAUTHORITY: /tmp/.X11-unix/Xauthority

touch "$XAUTHORITY"

xauth add "${HOST}":1 . "$(xxd -l 16 -p /dev/urandom)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants