miércoles, 9 de mayo de 2012

Setup X11VNC Server

Setup

Ubuntu/Linux Mint and related projects

x11vnc is very similar to vnc, except that it allows you to view display :0, the display that would currently be showing on your monitor if you were sitting at your computer.
HINT: Replace "sudo nano" with "gksu gedit" on GNOME or "kdesudo kate" on KDE for a graphical editor.
1. Install the packages
sudo aptitude install x11vnc openbsd-inetd tcpd
2. Run the following command
ps wwaux | grep auth
This command should output something like this:
root      3838 10.1  1.7  13308  8840 tty7     Ss+  15:35   2:14 /usr/bin/X -br -nolisten tcp :0 vt7 -auth /root/xauth
erik      5156  0.0  0.1   2800   752 pts/0    R+   15:57   0:00 grep auth
Note the bold path after -auth, as you will need this for the next step
3a. Add the x11vnc service to inetd:
sudo nano /etc/inetd.conf
Add this line:
5900    stream  tcp4     nowait  root    /usr/sbin/tcpd /usr/local/bin/x11vnc.sh

4a. Then edit /usr/local/bin/x11vnc.sh:
sudo nano /usr/local/bin/x11vnc.sh
Enter this into the new file:
#!/bin/sh
/usr/bin/x11vnc -inetd -o /var/log/x11vnc.log -display :0 \
-auth /root/xauth -many -bg
Notice the bold path, this is where you put the path you found in step 2.
Now, to make the script executable, you have to run the command:
sudo chmod +x /usr/local/bin/x11vnc.sh
4b. If you use xinetd (openSUSE does) then skip steps 3a and 4a and put the following text into a new file named /etc/xinetd.d/x11vnc:
service x11vnc
{
port = 5900
type = UNLISTED
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/bin/x11vnc
server_args = -inetd -o /var/log/x11vnc.log -display :0 -auth /var/run/xauth/A:0-LliKdB -many -bg
disable = no
}
5. Restart inetd
sudo /etc/init.d/openbsd-inetd restart
6. You can now connect to display :0 from another machine by using a VNC client. For example:
vncviewer vnchost:0

No hay comentarios:

Publicar un comentario