PDA

View Full Version : Cant run vnc server !!



khanfar
2016-02-07, 17:45
When i try to setup vnc server i got this : root@kali:/# vncserver :1 -geometry 1776x1080 && echo "Closing terminal in 5 secs" && sleep 5 && exit

Warning: kali:1 is taken because of /tmp/.X1-lock
Remove this file if there is no X server kali:1
A VNC server is already running as :1
root@kali:/#

khanfar
2016-02-07, 17:47
Help to solve this ..any idea ???

Bob The Marauder
2016-02-16, 15:23
Basic VNC Troubleshooting - reboot the entire device (seems obvious but never know with these things)

Next, use the Nethunter VNC client to try to connect to 127.0.0.1:1 or 127.0.0.1:5901 and see if there is a session running and whether it is the one that should be running.

Have a look at your running processes with
ps -ef|grep vnc and see if there is an instance of VNC Server already running. If there is, try
vncserver -kill :1 which should relatively cleanly shut down that session and remove any lock files (replace -kill :1 with whatever number is listed if different. The space before the colon IS required).

If not, move /tmp/.X1-lock to a different location and run
vncserver :1 -geometry 1776x1080 && echo "Closing terminal in 5 secs" && sleep 5 && exit again to see what happens. That way, you should still be able to put /tmp/.X1-lock back again if it is an issue even via USB if it should come to that.

Finally, why not just start session 2?
vncserver :2 -geometry 1776x1080 && echo "Closing terminal in 5 secs" && sleep 5 && exit and remember to connect to session 2 or port 5902 instead?

Credit to http://superuser.com/questions/549386/what-is-the-correct-way-to-kill-a-vncsession-in-linux for the improved ps syntax (I would have just used ps | grep vnc)