LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   VNC in command line (https://www.linuxquestions.org/questions/linux-newbie-8/vnc-in-command-line-542030/)

riseinarms 03-30-2007 06:11 PM

VNC in command line
 
I have Mandrake free version and I have it set so it starts in command line, and I wanted to know if I can have it so it automatically starts up a VNC server so I can connect to it without having to do anything on that computer?

arfon 03-30-2007 07:10 PM

Sure, just add it to your init scripts. Use Sudo to run the script as a user and not root.

riseinarms 03-30-2007 07:14 PM

Well the catch is I'm rather new and I don't know how to do that.

tredegar 03-31-2007 04:52 AM

Quote:

I don't know how to do that.
It's easy.

You have mandriva, where I think the init script you want is /etc/rc.d/rc.local
So, you need to become root, open that file with your favourite editor, and add a line like this to the very end of it:

su - yourusername -c "cd /home/yourusername && vncserver :1 -geometry 1024x768 -depth 24"

Save the file.

What this means is "Become the user "yourusername", change to that user name's home directory, then start the vncserver on display :1"

When you reboot, the vncserver will be started.
To connect to it, use the command vncviewer nameofcomputer:1


All times are GMT -5. The time now is 02:15 AM.