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

Cannot run xpra using Xdummy in parallel with desktop X environment #24652

Closed
calvertvl opened this issue Apr 5, 2017 · 8 comments
Closed

Cannot run xpra using Xdummy in parallel with desktop X environment #24652

calvertvl opened this issue Apr 5, 2017 · 8 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@calvertvl
Copy link
Contributor

Issue description

My use case:
I have a desktop X environment that I am happy with (slim autologin + xmonad). I am also on remote systems (e.g. laptop), and want to be able to share certain program instances between the two at times. For example, a web browser or LibreOffice session, graphical IRC client, etc. - basically anything that does not use 3D acceleration or video playback.

I want to be able to SSH into the server or open a terminal, and do the following:

$ xpra start :10
$ DISPLAY=:10 ${CMD} & disown

This sets up an application that I'm interested in using.

I can then connect to the xpra server to use the applications via one of the following commands:

$ xpra attach ssh:<hostname>:10 # remote access
$ xpra attach :10 # local access

Yes, it would be nice to auto-start some of this, but that's relatively straightforward to implement.

The problem:

  • I can add xpra to environment.systemPackages; this installs fine.
  • If the server command is overridden to use the Xvfb variant provided in the config file, this works.
  • It does not work on NixOS with xpra_Xdummy. The logs indicate that it cannot find the dummy driver.

@offlinehacker mentioned the xpra.nix module in this context on #24644. This functionality is something I hadn't noticed before, but If I'm following correctly, I can't have a machine host both a desktop X environment and xpra while using the Xorg server.

Specifically, xpra is set up as a displayManager, and if I understand correctly, only one displayManager can be enabled on a NixOS system.

There are actually multple use cases for xpra: It is effectively a combination of display manager and window manager, in that it can provide forwarding for entire desktops (display manager case) or for applications (window manager case).

Steps to reproduce

I have services.xserver.displayManager.slim.enable=true in my configuration.nix.

If I add services.xserver.displayManager.xpra.enable=true without disabling slim, I get the following error on rebuild attempts:

error: The unique option `services.xserver.displayManager.job.execCmd' is defined multiple times, in `.../nixpkgs/nixos/modules/services/x11/display-managers/xpra.nix' and `.../nixpkgs/nixos/modules/services/x11/display-managers/slim.nix'.
(use ‘--show-trace’ to show detailed location information)

Disabling slim is not an acceptable solution as I need the desktop X environment...

Technical details

  • System: 17.09.git.6b5e5de (Hummingbird)
  • Nix version: nix-env (Nix) 1.11.8
  • Nixpkgs version: "17.09.git.6b5e5de0ef"
@offlinehacker
Copy link
Contributor

offlinehacker commented Apr 5, 2017 via email

@jb55
Copy link
Contributor

jb55 commented Apr 9, 2017 via email

@calvertvl
Copy link
Contributor Author

I'll try to sort out a service, probably in a similar manner to either the emacs daemon or xinetd.

Here's what I'm thinking right now:

  • xpra needs $DISPLAY for each X server process
  • The most flexible approach is to do this similar to xinetd, specifying a list of values for $DISPLAY and then the appropriate configuration for each (eventually including allowing access to more than one user, as that is a possible use case).
  • It also makes sense to provide a simple "service.xpra.enable" or similar that defaults to DISPLAY=:$UID or something sensible (auto-setup one process per user)

Note that all instances would share the same xpra & xorg derivations: the only real difference are things that are set at runtime through the xpra config.

@offlinehacker
Copy link
Contributor

Btw one unrelated question. What is latency with running applications remotely? I'm running xpra in vms, where I also enabled mmap(so it's zero copy) and still experience some minor latency, that sometimes is annoying if I code fast or want to browse web smoothly.

@ryanorendorff
Copy link
Contributor

Does a service like this assist in this process?

https://github.com/Nekroze/xpra.nix/blob/master/test.nix

I'm pretty new to Nix so I am not quite how to get the service to run.

@totaam
Copy link

totaam commented Jul 20, 2019

I'm running xpra in vms, where I also enabled mmap(so it's zero copy) and still experience some minor latency

mmap is not possible with vms.
Try vsock / ivshmem to speed things up.

Most latency issues should have been resolved since xpra 2.5.x

@mjlbach mjlbach mentioned this issue Apr 28, 2020
6 tasks
@stale
Copy link

stale bot commented Jun 2, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 2, 2020
@samueldr
Copy link
Member

samueldr commented Jun 8, 2020

Closing, as with #87985, it is assumed this issue should be fixed.

If this particular issue is not fixed, feel free to reopen, or ask to reopen. For another problem, open a new issue, and CC the relevant people working on better Xpra support (see #86164).

Thanks!

@samueldr samueldr closed this as completed Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

No branches or pull requests

6 participants