Keep an X Session alive after VNC close?

New to Debian (Or Linux in general)? Ask your questions here!

Keep an X Session alive after VNC close?

Postby SnakeFighter » 2020-06-14 10:49

Hi everyone

New to Debian, though I've played with Raspbian and Ubuntu before. If anyone could help me, I'd be very grateful.

I've set up a server with a VPS service (Hetzner) with a Debian Buster installation. I would like to have a desktop session running unattended, and to log in with VNC from time-to-time to see how it's going.

So far, I have set up xfce4, and XVNC11, and I can log in to my desktop via lightdm with VNC. The snag I'm having at the moment is that when I close my VNC client, the user session seems to be destroyed, which isn't the idea. I want my desktop and graphical applications to continue running.

Any advice appreciated.

Here's my /etc/systemd/system/x11vnc.service:
Code: Select all
# Description: Custom Service Unit file
# File: /etc/systemd/system/x11vnc.service
[Unit]
Description="x11vnc"
Requires=display-manager.service
After=display-manager.service

[Service]
ExecStart=/usr/bin/x11vnc -loop -nopw -xkb -repeat -noxrecord -noxfixes -noxdam$
#ExecStop=/usr/bin/killall x11vnc
Restart=on-failure
RestartSec=2

[Install]
WantedBy=multi-user.target


~./vnc/xstartup:
Code: Select all
#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession
gnome-session &
#gdm &


and finally the [VNCServer] part of my /etc/lightdm/lightdm.comf:
Code: Select all
[VNCServer]
enabled=true
command=Xvnc
port=5900
#listen-address=
width=1024
height=768
depth=24


KR
Charlie
SnakeFighter
 
Posts: 4
Joined: 2020-06-14 10:36

Re: Keep an X Session alive after VNC close?

Postby eriefisher » 2020-06-14 12:12

You would first need a running X session instead of starting one with VNC. If you have a session running you might just be able to connect to it by appending the connection with :0. Again though, you need a running session.

This is old but might help.
https://serverfault.com/questions/27044 ... -x-session
____________________________________________
There's a manual?
Siduction
Debian Sid
Xfce4 4.14
User avatar
eriefisher
 
Posts: 112
Joined: 2008-06-04 03:49
Location: Ontario's South Coast

Re: Keep an X Session alive after VNC close?

Postby SnakeFighter » 2020-06-14 13:52

Thank you, erie.

I didn't have much luck with that answer (it is old, as you say), I will keep playing and see what I can come up with.

Charlie
SnakeFighter
 
Posts: 4
Joined: 2020-06-14 10:36

Re: Keep an X Session alive after VNC close?

Postby eriefisher » 2020-06-14 22:17

____________________________________________
There's a manual?
Siduction
Debian Sid
Xfce4 4.14
User avatar
eriefisher
 
Posts: 112
Joined: 2008-06-04 03:49
Location: Ontario's South Coast

Re: Keep an X Session alive after VNC close?

Postby SnakeFighter » 2020-06-15 08:04

It's more recent, but I don't think it helps with trying to get a session to persist after a VNC connection has been closed?

Apologies if I'm not using the right terminology / asking the question correctly!

Thanks again for engaging.
SnakeFighter
 
Posts: 4
Joined: 2020-06-14 10:36

Re: Keep an X Session alive after VNC close?

Postby SnakeFighter » 2020-06-15 13:55

OK, I think I have it sorted- the important bit is to include the "-many" parameter when starting x11vnc. Hopefully it will just keep on running in the background forever...

Thanks again.

Charlie
SnakeFighter
 
Posts: 4
Joined: 2020-06-14 10:36


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable