Start VNC at Boot

linux Add comments
italiano

Sometimes could be useful to manage a PC from a remote computer. To do it VNC maybe is one of the best solutions.

It’s good if VNC starts at PC’s boot.

Some easy steps:

root:~# apt-get install vnc4server vnc4-common

To start a program at boot we have to insert the command to run it in the /etc/rc.local file.

root:~#nano /etc/rc.local

and insert the following row before exit 0. (exit 0 must be always the last row)

su - user -c "/usr/bin/vnc4server :1 -geometry 1024x768 -depth 16 > /tmp/vncserver.log 2>&1 &" &

This command let start vncserver automatically at boot in usermode and on a Display different from the main display.
You have to substitute in that row USER with your user and you can customize the command vnc4server like it’s good for you.
If you would run other programs with VNC, you have only to add other rows in rc.local like the follow row

su - user -c "DISPLAY=:1 /usr/bin/gkrellm &" &

, , ,


Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Login