I want to solve a problem with Zoom's screen sharing (it conflicts with wayland and suggests using X). I can get Zoom to work, but the problem is that most but not all applications in the X session are opened on the wrong display.
Here's what I'm doing:
I open a virtual console and start an X session with startx -- :1.
The output of who is
user tty2 2020-04-15 06:44 (tty2)
user tty3 2020-04-15 07:26
user pts/4 2020-04-15 07:27 (:1)
$DISPLAY is :0 on tty2
I can now open certain applications (like xterm, Firefox, Zoom (screen sharing works!)) on :1 (either with DISPLAY=:1; firefox from :0 or directly from :1).
The problem is that most applications (like terminator, gedit) are opened automatically on tty2 with no error message. How can I fix this?
For the record:
I am using GNOME on Debian 10.
I ran DISPLAY=:1; xhost + but that didn't change anything.
I am using the ~/.xinitrc file from here (using gnome-session instead of x-window-manager did not make a difference)
Maybe relevant:
There is a default /etc/X11/xinit/xinitrc which only calls /etc/X11/Xsession. Xsession itself doesn't seem to start a window manager. So without my ~/.xinitrc, startx jumps right back to the console.
EDIT:
Choosing "GNOME on Xorg" from gdm3's login screen remedies the situation. Thanks mosvy for the suggestion.
I also tried the suggestions from here. Running
export $(dbus-launch)
gnome-terminal
did not change anything, but
#! /bin/bash
ID=foo.bar$RANDOM
GDK_BACKEND=x11 /usr/libexec/gnome-terminal-server --app-id "$ID" &
sleep .4 # yuck
gnome-terminal --app-id "$ID"
wait
worked (gnome-terminal is opened on display :1), but I guess this solution cannot be applied to other apps.
xhost +turns of security, nothing more. You should avoid its use. – ctrl-alt-delor Apr 15 '20 at 09:55export $(dbus-launch)in your xterm, thengeditand other gnome-stuff should work. – Apr 15 '20 at 10:05export $(dbus-launch)did not work; see my edit in the question. – ga325 Apr 15 '20 at 21:48export DISPLAY=:1; export $(env - "LANG=$LANG" "DISPLAY=$DISPLAY" dbus-launch)before launchinggeditorgnome-terminal. If that works, try withexport DISPLAY=:1; export $(env -u XDG_RUNTIME_DIR dbus-launch)too. – Apr 16 '20 at 01:27