LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-06-2017, 10:54 AM   #1
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 114

Rep: Reputation: Disabled
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
 
Old 02-06-2017, 12:24 PM   #2
davjohn
Member
 
Registered: Jan 2017
Posts: 34

Rep: Reputation: Disabled
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.
 
Old 02-06-2017, 12:47 PM   #3
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 114

Original Poster
Rep: Reputation: Disabled
Question

Quote:
Originally Posted by davjohn View Post
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)?
 
Old 02-06-2017, 01:01 PM   #4
davjohn
Member
 
Registered: Jan 2017
Posts: 34

Rep: Reputation: Disabled
Quote:
Originally Posted by andrixnet View Post
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.
 
Old 02-06-2017, 01:12 PM   #5
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 114

Original Poster
Rep: Reputation: Disabled
Question

Quote:
Originally Posted by davjohn View Post
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 ?
 
Old 02-06-2017, 01:18 PM   #6
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Ireland
Distribution: Slackware, Crux, NetBSD
Posts: 1,463

Rep: Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923
Quote:
Originally Posted by andrixnet View Post
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.

Last edited by Gerard Lally; 02-06-2017 at 01:23 PM.
 
Old 02-06-2017, 01:20 PM   #7
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Ireland
Distribution: Slackware, Crux, NetBSD
Posts: 1,463

Rep: Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923
Quote:
Originally Posted by andrixnet View Post
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.
 
Old 02-06-2017, 02:23 PM   #8
davjohn
Member
 
Registered: Jan 2017
Posts: 34

Rep: Reputation: Disabled
Quote:
Originally Posted by andrixnet View Post
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.
 
2 members found this post helpful.
Old 02-07-2017, 09:06 AM   #9
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 114

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gezley View Post
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.
 
  


Reply

Tags
vncserver, x11


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Issues running KDE in a VNC session on a headless server GlowingApple Linux - Server 2 08-30-2016 09:04 PM
How to keep VNC server running on headless RPi Ihatewindows522 Linux - Software 5 02-23-2016 10:42 AM
LXer: How to turn your Ubuntu 14.10 headless server into a Gnome 3 + VNC Network Desktop LXer Syndicated Linux News 0 03-10-2015 06:03 PM
[SOLVED] Cannot get VNC running headless Mithrilhall Fedora 1 10-19-2010 12:09 PM
Questions on Headless VNC installation hecresper Fedora - Installation 0 01-23-2004 05:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration