VectorLinux
August 01, 2014, 05:33:15 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: Download and Run VNC to Auto-Start on Power-Up. Includes Auto-Login.  (Read 12030 times)
phreon
Member
*
Posts: 52


« on: September 20, 2008, 07:52:51 am »

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.

Make the contents of xstartup look like this...


#!/bin/sh

?
unset SESSION_MANAGER
 exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
startx &



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.)

Edit the file /usr/share/config/kdm/kdmrc,(It appears Vector 5.9 standard gold uses KDM as your login manager by default.), change three lines, (undo the comments):

AutoLoginEnable=true   
AutoLoginUser=   <-- insert user name
PreselectUser=    <-- insert user name


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.
« Last Edit: September 20, 2008, 07:55:02 am by phreon » Logged
The Headacher
Louder than you
Global Moderator
Vectorian
*****
Posts: 1545


I like the bass to go BOOM!


WWW
« Reply #1 on: September 21, 2008, 02:41:02 am »

Since this looked a lot like a HOWTO, I moved it to the "how to"  section of the board Wink
Logged

Most music on my soundcloud page was arranged in programs running on VL.
phreon
Member
*
Posts: 52


« Reply #2 on: September 22, 2008, 11:24:43 am »

Thanks Headacher,

I not sure it was worthy of a true howto until the forum vetted it.
Hope my amateur Linux work will hold up.

P
Logged
M-ake
Member
*
Posts: 92


« Reply #3 on: September 22, 2008, 12:40:18 pm »

Is there a friendly soul to add necessary steps to enable auto-login on VL-light, please ? Otherwise this howto should work on VL-light correct ?

Thanks.
Logged

Jumalauta!!
--
Fish go m00!
nightflier
Administrator
Vectorian
*****
Posts: 4018



« Reply #4 on: September 22, 2008, 06:08:36 pm »

The steps for editing kdmrc apply to Light as well. However, there is a script on the JWM menu which will do that for you. Look under "System".
Logged
phreon
Member
*
Posts: 52


« Reply #5 on: September 23, 2008, 06:26:04 am »

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
Logged
LeeDB
Member
*
Posts: 33


« Reply #6 on: September 23, 2008, 07:13:18 pm »

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:

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=Application
Name=X11-VNC
Comment=run x11vnc upon startup
Categories=Application;
Exec=x11vnc -usepw
Icon=xfce4-display
Terminal=true
StartupNotify=false
GenericName=

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,
Lee
Logged
rbistolfi
Packager
Vectorian
****
Posts: 2277


« Reply #7 on: September 24, 2008, 08:35:20 am »

Hi Lee, by default x11vnc will die after the first connection, you c an change this starting the server with the -forever flag.
Logged

"There is a concept which corrupts and upsets all others. I refer not to Evil, whose limited realm is that of ethics; I refer to the infinite."
Jorge Luis Borges, Avatars of the Tortoise.

--
Jumalauta!!
LeeDB
Member
*
Posts: 33


« Reply #8 on: September 24, 2008, 03:01:14 pm »

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.

Thanks again,
Lee
Logged
LeeDB
Member
*
Posts: 33


« Reply #9 on: September 27, 2008, 05:58:28 pm »

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 again, rbistolfi, for the advice.
Lee
Logged
stretchedthin
Administrator
Vectorian
*****
Posts: 3780


WWW
« Reply #10 on: August 27, 2009, 01:08:54 pm »

I have a screencast that is based on the first part of this tutorial.  So for those us who just need to see it being done here it is....
Screencast. Remote control of desktops on your network with tightvnc
« Last Edit: August 27, 2009, 01:14:53 pm by stretchedthin » Logged

Vectorlinux screencasts and  tutorials can be found at....
http://www.opensourcebistro.com/blog1
http://www.youtube.com/user/vid4ken?feature=mhee
M0E-lnx
Administrator
Vectorian
*****
Posts: 3178



« Reply #11 on: August 27, 2009, 01:28:30 pm »

Nice guide.

I would change one of your steps though.
stopping the vnc server does not require a kill command

You can just do
Code:
vncserver -kill :1
on the server and it will stop it.
Logged

stretchedthin
Administrator
Vectorian
*****
Posts: 3780


WWW
« Reply #12 on: August 27, 2009, 03:01:35 pm »

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.
Logged

Vectorlinux screencasts and  tutorials can be found at....
http://www.opensourcebistro.com/blog1
http://www.youtube.com/user/vid4ken?feature=mhee
M0E-lnx
Administrator
Vectorian
*****
Posts: 3178



« Reply #13 on: August 27, 2009, 05:07:30 pm »

Seems better to me too, I've used both,

However, nothing compares to NX.
You should probably do a screencast on NX... I have a howto on my blog (link below)
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!