AuthorTopic: Download and Run VNC to Auto-Start on Power-Up. Includes Auto-Login. (Read 17460 times)

I have 6 computers around my home that the family uses. They are all networked through my local router both wired and wireless. I use VNC so I can access the desktop of each machine. VNC allow a user to see and use a remote machine desktop using a local computers display, mouse, and keyboard.

I have just begun to explore Linux and chose to learn it using an old HP PIII box with a 40 gig drive and 384 MB memory. In my searches about Linux I leaned that Vector would be a good choice for older computers. I installed an old NVidia card 32 mb card and an old network card as well. I wanted to add VNC on Vector so I can stuff this machine under a desk with no monitor, keyboard, or display but use it from any computer in the house. (All of my computers have both the vnc server and vnc viewer. So any computer can see and controll any other computer with a vnc server running.

(After much tortured hand holding by a dozen patient Vector forum folks.) What I needed to accomplish was ...>Download and install VNC into Vector Linux.>Tell Linux to auto-login on power-up.>Tell Linux to start the VNC server after auto-login so I can see the Vector desktop on my remote Windows machine.

Here is how I did it. (Painfully detailed, like I needed it.)

Download and Install VNC.

I used Gslapt to download TightVNC. The file is named "1.3.8-i586-4vl58.tlz". (I did not realize at this point that I could right click on the downloaded file and select install. I could have used Gslapt install it as well. Nube error.)

I used "installpkg tightvnc-1.3.8-i586-4vl58.tlz" to install it. (It installs the server and viewer as well as docs.)

Open a terminal window and type "vncserver" to start it. (VNC is installed in /user/bin which is already in path.)

VNC asks you to set and verify a password.

I had already downloaded the VNC Viewer on my windows box. I can view any VNC Server on any machine directly, or through an internet browser like Firefox. If you use a browser as a vnc viewer it automatically loads JAVA to start it and then it rips.

When I opened the Vector desktop on my Windows laptop, using Firefox, in the address line as "192.168.2.9:5801". VNC uses port 5800 on the server side (my Vector machine) for html, use 580X where X is the display number. (VNC tells you the display number when it starts. You don't need to use a port number in the IP address if you are using the vnc viewer on the remote machine to view the Linux machine.)

Your browser will then ask for the password you had set on the VNC server. Enter that.

Depending on your window manager (I think) it *may* work great.

If it does not give you a very pretty Vector desktop then ...

(My browser gave me a plain gray display with a Vector Terminal Window in it. Not very useful. I want to see the Vector desktop and be able to use it completely, including running apps and transfering files from my windows box.)

In a terminal window on the Vector box type "ps -aux" to get the process number of the vnc process you just started, type "kill xxxx" where xxx is the process number. This stops the vnc server.

To get a perfect display of Vector in on your browser or windows viewer you must edit the xstartup file in your .vnc folder in your Linux Home directory.

Go to your Home directory, in the view menu select "View Hidden Files". You wil see a .vnc directory.

Navigate into .vnc.

You will see the xstartup file. right click on it and open it with Abiword.

Save this file and restart vnc in a terminal window like you did earlier using "vncserver".Now go back to your windows VNC viewer or browser, type in the Vector box IP address, and there is the pretty Vector desktop.

Now you will need to set up Linux to Auto-Login on power-up.

Open a new terminal window and login as root, (type su and it will ask for root password.)Start Abiword. (type abiword, it will start.)

Save the file. If you try to edit this file in Abiwird as a normal user it will give you an error when you try to save it.To auto-start the vnc server after your machine has booted and finished auto-login.

Make sure you are still logged in as root.

Start Abiword as above.

edit /etc/rc.d/rc.local to add to the end of the file ...

su - username -c "/usr/bin/vncserver" &

Be careful to type this in exactly. The spaces after the "-" matter.Save the file.

Restart the Vector machine and on a remote machine on your network, fire up the vnc viewer and type in the IP address of the vector machine.

YeeHaa! There's the Vector desktop.

That's it I think. Solving this in Vector allowed me to learn a bunch about Linux and Vector. Frustrating and satisfying. I will keep at it.

I have been using VNC on Vector now for about a week. It is working really well and the remote display looks about as good as a native display. I have learned of one significant difference between the Windows server vnc and the Linux server vnc. Windows can handle file transfers between any Windows machine with vnc, but that is not in the linux version yet. I am not sure why and I can't tell if anyone is working on adding file transfer in the Linux vnc. Maybe a someone on this forum can suggest a fix.P

Interesting, I set up the same thing a couple of weeks ago, but I installed x11vnc via Gslapt, which avoided the need to edit the x11startup file in the .vnc directory.

I did edit the /usr/share/config/kdm/kdmrc exactly the same way as shown in the HowTo so that the machine would auto-login to the X session.

After that I used the 'xfce method' of starting applications automatically. For any program to be started automatically, you can create a desktop launcher for it in the directory /home/username/.config/autostart

I created a launcher named x11vnc.desktop with the following text inside:

It is easier than it looks - I just edited an existing desktop launcher file.

Now, I do have one problem. Apache and and x11vnc are both running on the computer. The web server stays up fine (except when the cat jumps on the switch on the power strip), but x11vnc eventually times out so that I can't connect. Actually I don't know for certain if x11vnc is timing out or if the X session is timing out. I have disabled the screen saver, but that didn't help. If x11vnc is the culprit, then I can always try switching to vnc and editing the x11startup file, but if my X session is timing out, then that won't fix it. Any suggestions would be appreciated.

Thanks! I'll give that a shot when I get home this evening. Somehow I missed the forever command line option when I was going through the options back when I first set it up. Last night I noticed after posting to this forum that it would not let me connect only a couple of minutes after I had disconnected, so I was already suspecting it was not a timeout issue after all. You just saved me from wading though x11vnc documentation to try to figure it out.

Just a quick follow up. The forever switch in the x11vnc command worked like a champ. That completed a VL Standard Gold web server project. The little Dell PIII-800 is sitting in a back room with no monitor connected and a wireless Airlink PCI card (Atheros based that VL detected perfectly, by the way, via vlwifi). The last step was to get the vnc server working reliably.

Thanks MOE,I'll see if I can update it. I just finished packaging x11vnc for VL 6.0. I'll see if I can get a tutorial on that one as well. It seems faster to me and the screen on the remote computer reflects what you are doing on the local one. First impressions is I like it better. Stay tuned.