Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Install tightvncserver and dbus-x11
  2. Run vncserver
    1. Enter the password "kaliVNC" twice
    2. When the command returns, kill the vncserver with vncserver -kill :1
  3. Create /usr/local/bin/vncserv and paste this content

  4. chmod 755 /usr/local/bin/vncserv

    Code Block
    languagebash
    collapsetrue
    #!/bin/bash
    PATH="$PATH:/usr/bin"
    DISPLAY="1"
    DEPTH="24"
    GEOMETRY="1280x960"
    OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"
    
    case "$1" in
    start)
    /usr/bin/vncserver ${OPTIONS}
    ;;
    
    stop)
    /usr/bin/vncserver -kill :${DISPLAY}
    ;;
    
    restart)
    $0 stop
    $0 start
    ;;
    esac
    exit 0


  5. Create /lib/systemd/system/vncserv.service and paste this content

    Code Block
    languagebash
    collapsetrue
    [Unit]
    Description=VNC Server
    
    [Service]
    Type=forking
    ExecStart=/usr/local/bin/vncserv start
    ExecStop=/usr/local/bin/vncserv stop
    ExecReload=/usr/local/bin/vncserv restart
    User=kali
    
    [Install]
    WantedBy=multi-user.target


  6. Run systemctl daemon-reload; systemctl enable vncserv

...