LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How to set up a headless VNC on Slackware (https://www.linuxquestions.org/questions/slackware-14/how-to-set-up-a-headless-vnc-on-slackware-4175599121/)

andrixnet 02-06-2017 09:54 AM

How to set up a headless VNC on Slackware
 
On slackware one can use runlevel 3 for a multi-user console based UI, or runlevel 4 for a multi-user X11 based GUI.

One can set up (fairly easy, with distro available packages) a VNC server inside a logged in X11 session.

Also, X11 forwarding over the network is not useful because it still requires a local X11 login and programs displayed remotely close when the client exists.

My question, and problem, is as follows:
  • a system running most often without a monitor (ie server)
  • the physical monitor shows console interface only
  • GUI with login manager available via VNC

The purpose is to have the server administration on console level and no interference from unneeded GUI (specifically no X11 on physical monitor),
and
have the ability to remotely connect to the server into X11 in such a way that it does not require X11 on the physical monitor and programs running in the GUI do not terminate when client disconnects (like happens with remote display by X11_forwarding).

Thank you

davjohn 02-06-2017 11:24 AM

Just use some vnc server. tigervnc is in extra.
Start vncserver from console or ssh session and connect with vncviewer.
I use this on my server which doesn't have any GPU.

andrixnet 02-06-2017 11:47 AM

Quote:

Originally Posted by davjohn (Post 5665978)
Just use some vnc server. tigervnc is in extra.
Start vncserver from console or ssh session and connect with vncviewer.
I use this on my server which doesn't have any GPU.

Can it be done to work unattended (so that vncserver runs at startup, instead of from the ssh session, so no need for ssh session)?

davjohn 02-06-2017 12:01 PM

Quote:

Originally Posted by andrixnet (Post 5665992)
Can it be done to work unattended (so that vncserver runs at startup, instead of from the ssh session, so no need for ssh session)?

Yes, just put something like this in /etc/rc.d/rc.local:
/bin/su -l USERNAME -c "vncserver"

But first run it manually to make sure it works and set password.

andrixnet 02-06-2017 12:12 PM

Quote:

Originally Posted by davjohn (Post 5666008)
Yes, just put something like this in /etc/rc.d/rc.local:
/bin/su -l USERNAME -c "vncserver"

But first run it manually to make sure it works and set password.

But how about running an X11 with display via VNC, unattended, such that it does not run as a specific user, but rather it displays the logni prompt like XDM ?

Gerard Lally 02-06-2017 12:18 PM

Quote:

Originally Posted by andrixnet (Post 5665943)
Also, X11 forwarding over the network is not useful because it still requires a local X11 login

Not true. x11 clients on the remote computer can use the display on your computer; no need for a display at their end. But if you don't want to use SSH you need to find some other way of setting the display explicitly at the remote PC:
Code:

export DISPLAY=your-host.home.local :0.0
or let SSH handle that for you automatically
Code:

ssh -X user@remote-host.home.local
SSH is the most convenient option for x11 and VNC. I use TightVNC through a SSH tunnel and there's no need for X running on the remote computer; TightVNC will set up a virtual framebuffer for you when you connect. I think it should be possible as well to start the vncserver in tmux so it continues to run even when you close the SSH session.

Gerard Lally 02-06-2017 12:20 PM

Quote:

Originally Posted by andrixnet (Post 5666016)
But how about running an X11 with display via VNC, unattended, such that it does not run as a specific user, but rather it displays the logni prompt like XDM ?

I could be wrong but I think you would need X running on the console to do that, and Karl Runge's x11vnc sever, which attaches to a real display.

davjohn 02-06-2017 01:23 PM

Quote:

Originally Posted by andrixnet (Post 5666016)
But how about running an X11 with display via VNC, unattended, such that it does not run as a specific user, but rather it displays the logni prompt like XDM ?

It should be possbile if you put something like that in inetd.conf:

Code:

5900 stream tcp nowait nobody /usr/bin/Xvnc Xvnc -inetd -query localhost -once securitytypes=none
I didn't test this, but accrding to man page it should work.

andrixnet 02-07-2017 08:06 AM

Quote:

Originally Posted by gezley (Post 5666021)
Not true. x11 clients on the remote computer can use the display on your computer; no need for a display at their end. But if you don't want to use SSH you need to find some other way of setting the display explicitly at the remote PC:
Code:

export DISPLAY=your-host.home.local :0.0
or let SSH handle that for you automatically
Code:

ssh -X user@remote-host.home.local
SSH is the most convenient option for x11 and VNC. I use TightVNC through a SSH tunnel and there's no need for X running on the remote computer; TightVNC will set up a virtual framebuffer for you when you connect. I think it should be possible as well to start the vncserver in tmux so it continues to run even when you close the SSH session.

The above solution does not allow client to disconnect without closing the remotely running programs, which is not good.

I will look into the suggested x11vncserver.


All times are GMT -5. The time now is 06:51 PM.