Hey Linux guys, VNC question

HappyCracker

Senior member
Mar 10, 2001
939
5
81
Here's my system:
Dual PPro 200mhz
256 meg RAM (EDO baby!)
Linksys 10/100 card
I would like to save myself the money of a KVM switch. How can I hook it up to my Athlon XP box through the network ports and have it boot without having a keyboard and mouse hooked up? Also, probably on the same line, how would I install (or whatever) a program like TightVNC/RealVNC (either one) to control it? My XP is running WinXP, the PPro is running RedHat 8, have 9 availible if that's of any help to you. If you haven't guessed, I'm sorta new to the whole Linux thing and would love to learn, but switching one box off to put a keyboard and mouse on the other is a big pain. Cheers for the help! For those who read the distributed computing forum, I know I just posted this there, a few levels down in one of my posts and figured it would be better here. Sorry.

edit: Essentially, I want this computer to operate under my bed only connected to the rest of the world by a power cord and a cat 5 umbilical to my main machine. This main box is connected to the network by an 802.11b connection
 

loup garou

Lifer
Feb 17, 2000
35,132
1
81
Install VNC on the machine you want to control (server) and the one you want to control it from (client). Open an instance of the VNC client and type in the IP of the server you want to connect to. Enter password. The end.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
yep. Depending on the bios you may have to have a keyboard hooked up to it for it to boot up.

When linux boots up it uses concept called runlevels. Usually runlevel 5 is the X windows runlevel. That is when it finishes booting up it goes to runlevel 5 and provides you a graphical login. Runlevel 3 is the normal multi user runlevel, meaning you get the command line at the end of it. Runlevel 1 comes up when your booting up and runlevels 0 and 6 are for either rebooting or shutdown. But you have to keep in mind that their is no hard and fast rule to this runlevel thing. It can vary from distro to distro.

Another thing. Each program is the child of another program. Like this:
you start of at a login prompt. you enter you user name and password and get a bash shell. From that bash shell you startx, from startx you start X from X you start kdeinit, from kdeinit it loads all the kde gui stuff from that and you open a xterm. From that xterm you open ssh and login to a remote computer. If you use a command: "ps -AH" from the command prompt you can see all these relationships. So if you issue a kill to that first startx it will shutdown all the X stuff, kde stuff and all the programs you started in it including the ssh session.

However were does it all start? If a program needs something to start it, what is the very first program to start up? Well it's started by the kernel when it is loaded. It is called init. Init's behaviour is controlled by the runlevels described above. It's what starts the login getty stuff, it starts up all the services and if you have it go to runlevel 5 it will start the gui login stuff, too. (xdm, gdm, kdm, whatever).

The file /etc/inittab controls the scedualing. You can fire up the text editor and view the file and can even edit it to change init's behavior, but I wouldn't recommend trying it from there.

In your /etc/rc.d/ directory you have several more directories. Each corisponding to a specific runlevel. It will execute the scripts in those directories depending on the runlevel.
So runlevel 3 will execute every file in the /etc/rc.d/rc3.d/ and runlevel 0 will run every script in directory /etc/rc.d/rc0.d/.

(Another example. I use Slackware. In slack I don't have any /etc/rc.d/rc3.d/ directories. I only have a /etc/rc.d/rc.M file. Inittab tells init to execute /etc/rc.M when it reaches runlevel 3 and rc.M has several if/then statements looking for different files that specificly designed to start up different services and such. A bit simpler, but requiring more manual intervention so that install script by unsupported programs won't be able to set up it's runlevel as easily as in Redhat and most other distros. For me though I like it. I recently added "mpg321 /home/drag/.muzak.mp3" on the tail end of my rc.M file to play some soothing acid jaz music every time I boot-up)

Now usually when you install services in redhat using rpms it will plop a script in the /etc/init.d directory. So if you install sendmail, it will put a sendmail script in the /etc/init.d. Now part of the install creates a symbolic link from the /etc/rc.d/rcX.d to the corrisponding script in the /etc/init.d directory. (Symbolic links are like "shortcuts" or pointers to files located elseware. You can make links using the "ln -s" command.)

Normally the command chkconfig will show you how the whole /etc/rc.X and /etc/init.d stuff is set up. And you can use it to set which script starts at which runlevel. It will take care of all the symbolic links and handle that stuff so you don't have to. If you can I would just use that command to take care of everything, but sometimes it isn't enough.

Now I don't know how you install vnc or what command is needed to start the server up.
If you installed it using a rpm, make sure that the server is set to start up when the graphical login stuff starts in runlevel 5. If you had to install it by some other means, it is pretty likely that it will still set up the different runlevel stuff for you, but if it didn't you may need to make your own script and put it in the /etc/rc.d/rc3.d directory.

A simple bash script can look like the following. Lets pretend that once you install vnc it will put a executable file in the /usr/local/bin file called vncstart. Of course this probably isn't the correct name and location of the command to actually start vnc server, but hopefully you get the idea.

#! /bin/sh

# start vnc here:
/usr/local/bin/vncstart

And that would be about it. Just don't forget to make the script executable if it needs to be. (the command would be "chmod 744 scriptname") If you know sh scripting you can add if then statements to do checking to make sure that it will start up properly and stuff, or to set up some extra things you may like to have associated with vnc) but this should be enough. Once you get everything configured and set up you can use the "telinit q" command to have init reload itself and hopefully it will set up your vnc correctly.

You should check out the "man" files on different things: inittab init runlevel shutdown kill.
to help fill in the blanks on what is needed to do. Also read any documentation about the vnc version you are installing and find out if you can acually set it up to start from init, or can it only be executed from the X session after you login and stuff. Also check out this page. This is what I used to fill in my blanks about Redhat. I suppose Redhat will have a nifty gui config tool that you can use to establish runlevels and scripts and crap, but I think it's helpfull to understand what's going on in the background. Also check out Redhat's website and see if you can find any info on runlevels and stuff to automate starting up services.

Now if that crap all works out, you aught to be able to just plug it into the wall, turn it on, and it will automaticly set up vnc for you.

Hope that helps.
 

HappyCracker

Senior member
Mar 10, 2001
939
5
81
It's early and I have to go to school for a final, but WOW! Thanks man! I can't wait to get home and play already. If I can get this working, I may even forgo Windows on my other duallie. Thank you
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Ya just be carefull. Messing around with runlevels is a easy way to toffu a nice install. Be sure to look over the man files, and try to find other documentation. I am no expert on Redhat, so I may be wrong on a couple things, so double check. Try something easy like using the chkconfig command to turn off some non-esentall service like ftp or ssh and then turn it back on, just to get familar with how everything works before going in a hacking away at it.


Good Luck! It's not all that complicated once you play around with it for awile, just don't put anything critical on that computer, it's easy to mess up by accident and linux isn't gonna hold your hand like windows does, so recovery can be a bear sometimes. But having fun is the main thing.
 

HappyCracker

Senior member
Mar 10, 2001
939
5
81
Oh, hehe, sorry, haven't gotten to play yet. I've been prepping for my Calc 2 final tomorrow morning. Then it's spanish at night, and finally, freedom baby! Until I get a job, that is....I will keep you guys posted. I'm also thinking of taking one of my cat 5 cables and making a crossover myself the ultra-ghetto way and just cutting the wires about halfway or whatever and twisting the connections I need together. The correct ones of course. Thank you for your interest in this little project. A dedicated F@H box or router for my half of the network is what i'm after and this should be fun. Cheers!
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
If you want to make your own cables eventually, whatever you do don't go and get stuff from a retail store like radio shack or compusa. It's a complete rippoff. Like 8 rj55 costs something like 5 bucks.

Their is a place down the road were I live, they do wholesale and custom installs for businesses all over the country and there corporate headquarters are here. I just walk down there and ask to see there sales rep. You can buy something like 100 meters of cat5 in a box for damn cheap and rj45 ends for 17 cents ap
ice (probably cheaper then that, but for some reason that's what sticks in my head). For the price of a few pre-made 20 foot cables from radio shack I can wire up a small business. And the proper line crimping/cutting tool can be had for 19 bucks, however professional ones run upwards to 300 dollars, but it's worth it if you do it for a living.