Skip to content

fix(vnc): start VNC server on boot and correct noVNC port from 4200 to 9020#44

Open
tejas0077 wants to merge 4 commits intobugbasesecurity:mainfrom
tejas0077:fix/novnc-port-4200
Open

fix(vnc): start VNC server on boot and correct noVNC port from 4200 to 9020#44
tejas0077 wants to merge 4 commits intobugbasesecurity:mainfrom
tejas0077:fix/novnc-port-4200

Conversation

@tejas0077
Copy link
Contributor

Fixes #41

Description
Two bugs were causing noVNC to fail in the Kali container:
VNC server never started — entrypoint.sh installed Xvnc via the Dockerfile but never launched it on container startup.
Websockify was running but had nothing to proxy to (port 5989 was not listening).
Wrong port in run.sh — run.sh displayed the noVNC URL as http://localhost:4200/ which is actually the shellinabox port.
noVNC runs on port 9020.

Changes Made
kali/entrypoint.sh: Added Xvnc startup on DISPLAY=:89 (port 5989), XFCE desktop session, and websockify proxy (port 9020 to localhost:5989)
run.sh: Fixed noVNC URL from port 4200 to 9020 (lines 1063 and 1326)

Type of Change
Bug fix (non-breaking change that fixes an issue)
Related Issues

Fixes #41
Testing
Manual testing performed.
Verified entrypoint.sh correctly starts Xvnc, XFCE, and websockify in sequence.
Verified run.sh now shows correct noVNC port 9020.

Checklist
My code follows the project's style guidelines.
I have performed a self-review of my code.
My changes generate no new warnings.

Tejas Saubhage added 3 commits March 14, 2026 15:53
Signed-off-by: Tejas Saubhage <tsaubhage0007@gmail.com>
Signed-off-by: Tejas Saubhage <tsaubhage0007@gmail.com>
…o 9020

Fixes bugbasesecurity#41

- Add Xvnc startup on DISPLAY=:89 (port 5989) to entrypoint.sh
- Add XFCE desktop session startup on DISPLAY=:89
- Add websockify proxy startup (port 9020 -> localhost:5989)
- Fix run.sh noVNC URL from port 4200 to 9020 (4200 is shellinabox)
@Hackerbone
Copy link
Collaborator

Hi @tejas0077

Two things in this PR:

  • Capabilities have already been merged into the project main can you pull the latest main into your branch?
  • Can you update entrypoint.sh changes to also have defensive checks so that if the services are already running it detects those and skips or overwrites the steps (for eg: if that display is already in use this might fail)

Please update your PR with these fixes.

@tejas0077
Copy link
Contributor Author

Hi @Hackerbone, I have addressed both your review comments:
Pulled latest main into the branch via rebase capabilities commits are no longer included.
Updated entrypoint.sh with full defensive checks for all services: shellinabox, OpenVPN, Xvnc, XFCE and websockify now each check if they are already running before starting, and skip gracefully if so. Xvnc also checks if the display socket /tmp/.X11-unix/X89 is already in use before attempting to start.
Please re-review when you get a chance. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VNC Issue

2 participants