Configure & Enable VNC via SSH Console ONLY, openSUSE 13.1

Hi everyone - hopefully as time rolls on I can contribute something, rather than just ‘taking’, but I have to start out with a request for assistance!

I’ll start off with the core question:
Is there a guide to configuring & enabling VNC using just the command line?

I’ve found many guides on how to do so using the GUI, but I want to be able to do this via SSH and I cannot find a single guide that handles this.

I’ve not used linux, any variety really, for 10 years - prior to that I’d used very few distributions (started with slackware in about '93 and moved to [then] suse 6.0 in about '00) but given I’d most recently used suse I felt comfortable giving OpenSUSE a crack. So a few days of drama behind me (turned out I had a faulty DVD drive, the last thing I checked) I got it running on an old, disused ML350 G5, had it configured for its initial primary purposes (plex media server, a minecraft server for the kids & dev tools installed for me to un-rust my old coding skills) with SSH & VNC working so it could sit headless in another room. The next day the UPS it was on took a surge and failed to cope, took out the UPS and the server in one hit. (me pursuing a resolution to that is another story :slight_smile:

I’ve now setup an OpenSUSE 13.1 install on an unused PC exactly the same as the prior, configured (I thought) exactly as I had the previous server, yet I can’t get VNC to play. I tested everything else but this before I moved it and made it headless - my mistake, really.
Previously I had VNC working where I could submit a username and password to VNC Viewer and it would log in, NOW when I attempt a connection it has the username input disabled and all I can do is enter a password, to which it nicely responds “No password configured for VNC auth”. I’ve attempted running vncpasswd under a user login via SSH, I’ve modified the etc/xinet.d/vnc file to have that username in the first session and I’ve restarted xinetd, I’ve opened the port in the firewall, even disabled the firewall - nothing is working.

The simple solution is for me to go find the server, plug in the appropriate bits and pieces and just do the work there, but I’d really like to be able to fix this via console, as I figure I must be able to.
I know it’s probably stubborn of me, but I’d like to nut this out so that if/when it happens again I’ve got a resource to look to. I know there’s a lot of skewing of discussion towards GUI manipulation of the OS, but I figure there has to be some healthy interest in console as well.

This is due to the differences between the Linux vnc and Windows VNC which is most likely what you’re using, this should work for you:

I’m assuming you’ve created a vnc password somewhere, I used /root/.vnc/passwd which is very naughty but it’s just an example and make sure you have x11vnc package installed.

/etc/xinet.d/vnc


service vnc1{
        socket_type     = stream
        protocol        = tcp
        wait            = no
        user            = nobody
        server          = /usr/bin/Xvnc
        server_args     = -noreset -inetd -once -query localhost -geometry 1024x768 -depth 24 -rfbauth /root/.vnc/passwd -securitytypes none
        type            = UNLISTED
        port            = 5901
}

Remember to enable “Remote Access” from YAST → (run as root) yast2 remote and make sure to checkmark (x) Allow Remote Administration and check that firewall has a port open or is disabled ( │[X] Open Port in Firewall [Firewall Details…] )

Then grab UltraVNC from http://www.uvnc.com/ , use VNCViewer and connect to port 5901.

Thanks for the help :slight_smile:

You’re right, trying to connect from a Windows box to the Linux box - using VNC Viewer rather than Ultra VNC, but otherwise I’d already attempted everything you’d suggested (I started with the vnc passwd being under a regular user account, when that failed I attempted with root).

I was never able to quite find out what caused the problem, so I hope it doesn’t resurface at any point in the future, but I do now have VNC working just fine: VNC Viewer connects to :5901 and shows the graphical user login screen where I can log in as any desired account.

It was “fixed” by an uninstall/reinstall of VNC and a whole raft of other things. Part of a whole lot of frustration with getting any gui front end tools going; webyast got stuck unable to accept eulas, and a ruby update couldn’t be installed. After uninstalling VNC and required packages, webyast and required packages, Flash and all the ruby packages, and after a bit of fiddling in cmdline yast, I finally got VNC working, then finally flash (had to run software management through VNC rather than webyast/yast to accept the eula), then webyast - still can’t accept that ruby update but that’s another issue).

I still don’t know if I’d missed a step or done something wrong, however the second time around installing and everything worked.

Hi!

The setup I have is as follows:
I have the x11vnc package installed, the local directory added to my PATH for regular users, and an executable file named VNC in my home folder, containing:

x11vnc -display :0 -unixpw -ssl

And also have ssvnc downloaded onto my windows box:
http://www.karlrunge.com/x11vnc/
http://www.karlrunge.com/x11vnc/ssvnc.html

The way I use vnc is I ssh into my box, type
VNC &
which starts the vnc server in the background for 1 connection, and then I connect with my unix user and password via the ssvnc client.

For Linux PC to Linux PC VNC I only use via SSH console. I was taught how to do this years back by Yaloki and I’ve been using it since to maintain my mother’s PC, where she lives in a different continent from myself.

I mostly go with the default openSUSE configuration.

A simplification as to how I have done this (and more security can be added later) follows. Below when I refer to ‘her’ it will be my mother’s PC in Canada (the PC whose desktop I want to access) where I call her ‘mothercpu’ and when I refer to ‘my’ it will be my PC where I am physically sitting here in Europe. Lets assume for this example her routers IP address is 70.71.72.73.

I have enabled the ssh daemon enabled on her PC (in Canada), and I have port 22 open on her PC for the ssh connection. I have her router setup such that any ssh request at port 22 is forwarded to my mother’s PC’s port#22 on her home LAN. On both our PCs I have the application ‘x11vnc’ installed and also the application ‘tightvnc’. I also have root ssh access disabled on my PC and my mother’s PC.

To access her PC I open two konsoles on my PC in Europe. In the first konsole I type:


ssh -t -L 5900:localhost:5900 mothercpu@70.71.72.73 'x11vnc -localhost -nolookup -nopw -display :0'

I will then get a prompt for a password for user ‘mothercpu’. I then enter that password. I can then see in the terminal x11vnc being launched.

and in the second terminal on my PC here in Europe I type:


vncviewer -encodings "tight copyrect hextile" localhost:0

That then redirects the vnc output from her pc, through an encrypted ssh, back to my PC in Europe.

Once that is functioning, one can then start adding more security (such as changing port #, adding more security to the ssh, etc … ) and one can map the dynamic IP on her router using a service such as dyndns.

Again, this is Linux PC to Linux PC.

I do it on regular basis for customer support from Windows as well. On remote side I usually simply start vncserver which can be also customized to launch any program on startup (e.g. gnome-session).