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

Connection refused from local tty, works over remote ssh #3508

Closed
jrichardson97 opened this issue Mar 30, 2022 · 5 comments
Closed

Connection refused from local tty, works over remote ssh #3508

jrichardson97 opened this issue Mar 30, 2022 · 5 comments
Labels
bug Something isn't working question Further information is requested

Comments

@jrichardson97
Copy link

jrichardson97 commented Mar 30, 2022

I've been trying to setup xpra for remoting into a work computer. My idea was to setup my .xinitrc to launch i3wm as an xpra session and be able to connect from tty locally or over ssh with a Windows 10 laptop remotely.

I launched the xpra session with xpra start-desktop :20 start=i3 resize-display=1920x1080 and am able to connect from my laptop with Xpra_cmd.exe attach ssh://user@ip/20 which works fine. When I try to login from a different tty on my work computer though I get the following error:

Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
failed to initialize Gtk, no display?

Does this have something to do with xorg.conf? My laptop only has a single monitor but I have a custom xorg.conf from my work monitors (3 monitors configured with NVIDIA). Not sure how to debug this otherwise. Ideally, I'd be able to adapt the display based on which computer is connected too (ie, only have one i3wm workspace when connected with laptop but have 3 when connected with desktop).

@jrichardson97 jrichardson97 added the bug Something isn't working label Mar 30, 2022
@totaam
Copy link
Collaborator

totaam commented Mar 30, 2022

Please specify more precisely which commands you run and where.
See also https://github.com/Xpra-org/xpra/wiki/Reporting-Bugs

The tty should be irrelevant in almost all cases if things are installed correctly.

@totaam totaam added the question Further information is requested label Mar 30, 2022
@jrichardson97
Copy link
Author

jrichardson97 commented Mar 30, 2022

Sorry - I see now. I've reformatted my post below and edited to add server logs.

Workstation: Ubuntu 20.04, i3wm, no display manager, gnome polkit, xpra 4.3.2-r0, 3 monitors
Laptop: Windows 10, xpra 4.3.2-r0, single monitor

Goal: Run window manager (i3wm with some extras) with xpra start-desktop on Workstation. Attach to xpra session locally from Workstation and display 3 i3wm workspaces (one on each monitor). Attach to xpra session from Laptop via ssh and display 1 i3wm workspace (on single laptop monitor). Ultimately just trying to setup the ability to work remotely and be able to attach to the same xpra session either from Workstation or Laptop.

Commands run:

  1. On Workstation (additional config shown below): "xpra start-desktop :20"
  2. Attach from Laptop: "Xpra_cmd.exe attach ssh://user@host/20"
  3. Attach from Workstation: "xpra attach :20"

Issue:
Commands 1 and 2 work well and I can see the i3wm workspace running on Workstation from Laptop. I then get this error when trying to attach from Workstation shell after login on tty:
"
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
failed to initialize Gtk, no display?
"
Command 3 works however when I use startx with ~/.xinitrc just containing "exec i3" from tty then attach from xterm once the x server loads up. So I guess my main issue is how do you configure an xpra desktop session with a windows manager so it can be attached to locally and displayed on the monitors connected to Workstation as well as attached remotely from Laptop?

Additional files:

  • xpra info output: xpra_info.txt
  • xpra showconfig output: xpra_showconfig.txt
  • xpra server log when connecting from Laptop (working): server.log
  • xpra server log when connecting from Workstation xterm within i3 (working but only single workspace on one monitor): server.log
  • xpra server log when connecting from Workstation tty (not working): server.log

@totaam
Copy link
Collaborator

totaam commented Mar 31, 2022

Goal: Run window manager (i3wm with some extras) with xpra start-desktop on Workstation.
Attach to xpra session locally from Workstation and display 3 i3wm workspaces (one on each monitor)

Each xpra start-desktop session will have a single virtual display, so you may not be able to map this to your 3 displays.

Attach to xpra session from Laptop via ssh and display 1 i3wm workspace (on single laptop monitor)

Unless this i3wm workspace lives in a window, you won't be able to separate it from the other 2 living in the same xpra virtual display.

I then get this error when trying to attach from Workstation shell after login on tty

Are you trying to run xpra attach from a plain tty?
xpra needs to access a display to show the windows it forwards. You need to be running an X11 server (or wayland).

So I guess my main issue is how do you configure an xpra desktop session with a windows manager so it can be attached to locally and displayed on the monitors connected to Workstation as well as attached remotely from Laptop?

My guess is that you would be better off running the workstation as you normally would, then just shadow one display from the laptop:
#3320
(shadow is not as fast as desktop mode, but it should be usable)

@jrichardson97
Copy link
Author

Hmm I will do some more testing with shadow to see if it works well enough for me. I tried it initially but had issues configuring it.

From #3320, how would the options such as xpra shadow :1,multi-window=no be added when connecting over ssh xpra shadow ssh://HOST/DISPLAY?

Also, are there recommended settings for optimizing performance over a VPN? I have full admin access so I can bind to TCP or anything else like that.

@totaam
Copy link
Collaborator

totaam commented Apr 1, 2022

Only use shadow for the laptop, not from the workstation itself which can run a native X11 desktop.

xpra shadow ssh://HOST/:1,multi-window=no

Also, are there recommended settings for optimizing performance over a VPN?

TCP mode may work better as the VPN may be able to detect TCP flush / cork - depending on how well it is integrated with the OS.
It may also help to set the forwarded port to low latency, but not always: if bandwidth is scarce then this will be counterproductive.

@totaam totaam closed this as completed Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants