How does VNC work?

This question derives from http://www.experts-exchange.com/questions/28735461/Can-Linux-do-multi-user-with-GUI.html where I asked if I could view user desktops remotely from workstations. One of the suggestions was VNC. I want to pursue that here.

My environment is Slackware 64 and it has libvncserver-0.9.9-x86_64-2 and tigervnc-1.1.0-x86_64-1. I've found other versions of vnc out there including REALvnc, ultraVNC and tightVNC. Some of these are commercial and supported.

First question: I've come across lots of howtos about starting the various programs, program options, tunnelling, etc., but nothing that really tells me how to proceed step by step.

So, Let's say I'm a user sitting in front of a workstation in my office and I want to log into the Linux server in the computer room and get a desktop for my account on that server. What do I do?
LVL 1
jmarkfoleyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CompProbSolvCommented:
My familiarity is with Windows but it should be similar.

On the Linux server in the computer room you would install VNC server.  You would set a password, make sure that the server runs on startup, and make sure that the server firewall allows port 5900 (or whatever you change it to) through.  I use TightVNC and the default installation will do everything.

On the workstation, install or run the VNC viewer.  When it asks for a server name, type in the IP address of the Linux server and hit Enter.  You'll get to a login screen where you type the password you set up in VNC on the server.  Hit enter and you're there!
0
CompProbSolvCommented:
With Windows you can set up shortcuts to the VNC viewer program and add the IP address of the destination after the command line.  This allows you to have icons to connect to a variety of computers.  If you change the port on the server (easily done in VNC server) then you would add a colon and the port number after the IP address when specifying the server.

If you want to get to computers behind a firewall (remote locations) you would set up port forwarding on the router to allow for it.
0
jmarkfoleyAuthor Commented:
CompProbSolv: I appreciate your jumping in ...
On the Linux server in the computer room you would install VNC server.
To the best of my knowledge, VNC is installed.
You would set a password, make sure that the server runs on startup,
Here's where I start to run into problems. When I ran vncserver at the command line, from the root user I got:
$ vncserver

You will require a password to access your desktops.

Password:

New 'mail:1 (root)' desktop is mail:1

Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/mail:1.log

1 18:27:54 root@mail:~

Open in new window

It did ask for a password (more on that later) and created the startup scripts as show. I'm doing this remotely, so I can't see if something is happening on the server's monitor. After logging out and back in I ran it again, as root:
> vncserver

New 'mail:2 (root)' desktop is mail:2

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/mail:2.log

1 23:08:50 root@mail:~

Open in new window

Notice a different display number. Why? Also, is this really starting a "server" to handle any connection or is it just for user root? What about user 'mary'?  You wrote:
On the workstation, install or run the VNC viewer.  When it asks for a server name, type in the IP address of the Linux server and hit Enter.  You'll get to a login screen where you type the password you set up in VNC on the server.
which makes me think I have to start a vnc "server" for each user. Is that right? Not sure about your statement, "make sure that the server runs on startup" applied.

Maybe some linux vnc users need to jump in here too?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

CompProbSolvCommented:
I'm afraid that we're running into the differences between how this is done in Linux and in Windows and my ignorance of the former.

With Windows, you can set the host end up as as system service and it runs for all users.

When I've used VNC, the password is not user-specific.

What happens when you try to connect to the server with VNC?  If it doesn't give you a prompt for login credentials, try adding :1 or :2 after the IP address for the server.
0
SandyCommented:
I would suggest you to use LTSP  (ltsp.org) in this case, A scalable and better option to setup a diskless nodes environment.

TY/SA
0
jmarkfoleyAuthor Commented:
I did get VNC running, but lots of issues/questions ...

CompProbSolv:
With Windows, you can set the host end up as as system service and it runs for all users.
Apparently this is doable for Linux as well, but documentation is not clear as to how that works. If I have several users logging in, will they get their own desktops, files, etc.? The 'system service' route does want a specific user -- should that be root? Should I just create a new user? The howto's I've read are pretty light on specifying this.

what I did was just run it as a normal user. This is shown in my 2nd screen listing in posting ID: 41020923.

I then installed Ubuntu 14.04 desktop on a laptop. I did the apt-get as instructed in https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-14-04, which in the end was useless because that installed the server, not the viewer.

Jumping to step 4 in those instructions, I ran the following on the Ubuntu laptop:

ssh -L 5901:127.0.0.1:5901 -N -f -l user server_ip_address

though again, not sure that did anything. Will try without that on the next experiment. Sadly, the instructions end there with the statement, "Next, you can use your VNC viewer to connect to the VNC server at localhost:5901". Uh, what *is* my "VNC viewer"? Again, assumed knowledge. Arrrgh! I had no executable on the computer named anything like that, so I took a shot at `apt-get install vncviewer` - and that did install the program. In fact, despite the page's name, "How to Install and Configure VNC on Ubuntu 14.04", this howto was for setting up a server, not a viewer.

Anyway, I ran `vncviewer 192.168.0.2:2 (the ";2") refers to the display number which I found on the server by doing `ps ax`), and I was able to log in! I also tried `vncviewer -fullscreen 192.168.0.2:2` and that worked as well, giving me a full screen.

I think this addresses my core need in this question. I'll close it out and post some VNC specific questions.

My new post is: http://www.experts-exchange.com/questions/28736293/VNC-viewer-screen-issues.html

Sandy: Yes, I have been investigating LTSP as well, but VNC was quicker, so I'll follow-through on this, then turn to LTSP. I have LOTS of questions/issues with that as well!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jmarkfoleyAuthor Commented:
I found the Linux procedure, but CompProbSolv pointed me in the right direction. Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.