Originally Posted by
rahulroy
hey can anyone help me with this i can start kali in terminel but unable to get GUI since vnc server is not starting.everything goes well but the only thing is vnc.i have attached screenshots.
i tried netstat -l in which localhost is not listening on port 5900
also nc -s 127.0.0.1 -p 5900 -l is not working.
please if anyone can help me it will really be helpful. thanks in advance
Kali linux by default uses
Code:
/usr/lib/vino/vino-server --sm-disable
in startup applications however vino-server isn't the greatest it's very buggy for doing remote access without a screen atached so I recommend tightvncserver instead of fixing the broken vino-server as it's much easier than dropping into source code.
Follow these instructions:
Code:
sudo apt-get install tightvncserver
--VNC SERVER ON BOOT--
Create new file called vncboot in init.d directory
Code:
nano /etc/init.d/vncboot
Put in the following
Code:
### BEGIN INIT INFO
# Provides: vncboot
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VNC Server at boot time
# Description: Start VNC Server at boot time.
### END INIT INFO
#! /bin/sh
# /etc/init.d/vncboot
USER=root
HOME=/root
export USER HOME
case "$1" in
start)
echo "Starting VNC Server"
#Insert your favoured settings for a VNC session
su - root -c "/usr/bin/vncserver :0 -geometry 1280x800 -depth 16 -pixelformat rgb565"
;;
stop)
echo "Stopping VNC Server"
/usr/bin/vncserver -kill :0
;;
*)
echo "Usage: /etc/init.d/vncboot {start|stop}"
exit 1
;;
esac
exit 0
Make it executable with 755 permissions and update to be default service on boot
Code:
chmod 755 /etc/init.d/vncboot
update-rc.d vncboot defaults
Now start the service
Code:
service vncboot start
It will prompt you the first time to enter a password for your vnc server enter your password once the confirm it and for view only use 'n' and enter
The vncserver now should be started and will start on boot.
--AUTO BOOT AND LOGIN STARTX--
The problem you will have now is that when you boot your Raspberry Pi you will not have access to vnc on boot if it doesn't login automatically for you to do this complete the following:
Add # in front of this line
Code:
1:2345:respawn:/sbin/getty 115200 tty1
Add this below the line we commented out:
Code:
1:2345:respawn:/bin/login -f root tty1 </dev/tty1 >/dev/tty1 2>&1
Now we need to edit ~/.profile
Add the following just before the last line of code
Code:
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
/usr/bin/startxfce4
fi
If not seeing colors in terminal bugs you as much as it does me, uncomment these lines in ~/.bashrc:
Code:
export LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
Hope this helps you, now you should be able to plug this in anywhere and connect to it assuming it's connected through ethernet or wifi