Score:0

x0vncserver unable to open display :0

et flag

I am attempting to use x0vncserver from the package tigervnc-scraping-server to run a VNC server using my local desktop session. Many guides such as this recommend starting the server with

x0vncserver -passwordfile ~/.vnc/passwd -display :0

or

x0vncserver -display :0

For me, both result in

No protocol specified
x0vncserver: unable to open display ":0"

How can I fix this? I have seen similar issues where the desktop session is owned by a different user, but I am the only user in this situation.

hr flag
So are you actually running an X server on :0? what does `pgrep -a Xorg` return for example?
interoception avatar
et flag
I believe so? I am running Gnome. I thought the idea was that `x0vncserver` uses your active desktop session. The output of the command you gave is: ```1454 /usr/lib/xorg/Xorg vt1 -displayfd 3 -auth /run/user/125/gdm/Xauthority -background none -noreset -keeptty -verbose 3 2440 /usr/lib/xorg/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -background none -noreset -keeptty -verbose 3```
hr flag
Apologies - that command wasn't as helpful as I'd hoped, since apparently newer Xorg sessions don't show the display number directly on the command line any more. If you open a terminal emulator in your local desktop session does `echo $DISPLAY` return `:0` or something else? Sometimes the primary display is :1
interoception avatar
et flag
No problem -- thank *you* for your help! `echo $DISPLAY` returns nothing. Extra context if relevant: I am SSHing into my machine which is powered on at home and connected to a monitor, presumably with a locked screen.
hr flag
Ah that's unfortunate - that's why I specifically mentioned *"a terminal emulator in your local desktop session"*. If you're trying to get the information via SSH then it is more complicated - see for example [How to find out the current (active) XServer DISPLAY number?](https://unix.stackexchange.com/a/204498/65304)
hr flag
... actually `xauth list` might be helpful
interoception avatar
et flag
`xauth list` returns: `redacted.local:2 MIT-MAGIC-COOKIE-1 redacted_alphanumeric_string`\n `redacted/unix:2 MIT-MAGIC-COOKIE-1 redacted_alphanumeric_string`\n `redacted.local:3 MIT-MAGIC-COOKIE-1 redacted_alphanumeric_string`\n `redacted/unix:3 MIT-MAGIC-COOKIE-1 redacted_alphanumeric_string`
hr flag
OK so it looks like X servers are / have been running on displays :2 and :3
interoception avatar
et flag
Ah, these are from my normal tigervnc sessions. I am also trying to use x0vncserver so I can run a vnc session with my local desktop rather than creating a new desktop environment like tigervnc does.
interoception avatar
et flag
Interestingly, those vnc servers were killed prior to me running `xauth list`...
hr flag
That's normal - that's why I said `/ have been`. I still have xauth entries on my box for a server that's been offline since before the pandemic ... . Are you sure your local desktop is actually an X session (not a Wayland session for example)? Apologies if I asked that before, I don't remember what we already covered
interoception avatar
et flag
Ah -- no I am not sure. I am running Ubuntu 20.04 on GNOME. Sorry, I'm coming over from being a Mac guy. I just assumed all the GUI stuff was X.
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.