Score:0

Ubuntu 20.04 DISPLAY variable should be set even after logging out to gui login screen

cz flag

I am using DISPLAY env variable to set gsettings for Vino. The connection is through ssh to the server where the gui is working. If i am logged in, the display variable is automatically set to :0. When i log out to logging gui screen, if i check the variable remotely i can't see it set. What i've tried:

  1. I have tried to set DISPLAY variable in .bashrc, but after logging out it unsets - i think that it should be done automatically by os, not manually by user.
  2. x11-server-utils, xorg, openbox, xauth installed.
  3. Setting x11forwarding to yes.
  4. Exporting DISPLAY manually.

The main thing is to have DISPLAY variable set as user where logged in to os, even after logging out.

pa4080 avatar
cn flag
It is not clear what you want to achieve. When there is not a user logged-in to the GUI the display belongs to the display manager gdm/lightdm.
weis_ss avatar
cz flag
I want to have display variable set as if user where logged in using gui. Using this variable i can next configure vino using ssh.
pa4080 avatar
cn flag
Here is how to launch any GUI related application from crontab or ssh: https://askubuntu.com/a/978413/566421
pa4080 avatar
cn flag
I think, you want to connect via VNC while there is not logged-in user. Vino has this problem for a long time. One workaround is to set automatic log-in and then lock the screen (not log-out) in this way the DISPLAY will belong to the user. Probably this answer will be useful for you: https://askubuntu.com/a/1040852/566421 - it shows how to trick the system and log-in a remote user into a desktop session via SSH. Otherwise you need to use some other VNC server or setup RDP.
pa4080 avatar
cn flag
Does this answer your question? [How to type into the lightdm login screen from the command line?](https://askubuntu.com/questions/1020159/how-to-type-into-the-lightdm-login-screen-from-the-command-line)
weis_ss avatar
cz flag
@pa4080 no, it didn't help. x11 works, but cannot see display variable through login screen using ssh
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.