1

Currently VNC Server is running on port 5901.

I want to change the port to be around 10000-10100 (in this range).

How can I do that?


I have already tried the suggestions from How can I change the default port of Remote Desktop (VNC)?:

gconftool-2 --set --type=bool /desktop/gnome/remote_access/use_alternative_port true
gconftool-2 --set --type=int /desktop/gnome/remote_access/alternative_port 10050

since I want VNCServer to listen on port 10050 — but that doesn't make any change in the functionality.

  • What is the exact type of VNC you're running? Is it TigerVNC/RealVNC/TightVNC/etc.? – Yaron Aug 12 '19 at 14:26
  • @Yaron I installed vnc4server. That works fine on port 5901. – Ionică Bizău Aug 12 '19 at 14:27
  • I think it's because the Ubuntu developers switch to TigerVNC by default, the following Arch user guide should walk you through: https://wiki.archlinux.org/index.php/TigerVNC – Yaron Aug 12 '19 at 14:38
  • @Yaron Should the same field (alternative_port) work for TigerVNC? – Ionică Bizău Aug 12 '19 at 15:29
  • No, that's especially for GSettings and possibly for older versions of Ubuntu. – Yaron Aug 12 '19 at 15:59
  • @Yaron So, what's the solution for using a different port on the new versions...? – Ionică Bizău Aug 12 '19 at 16:36
  • LOL, the one I sent in the link, you can specify the port in /etc/systemd/system/*.socket (I'm not sure how this service is called on your system) and change the line which starts with ListenStream=. – Yaron Aug 13 '19 at 06:26
  • @Yaron There is no .socket file in that directory... – Ionică Bizău Aug 13 '19 at 06:31
  • Yeah, possibly, can you please take a look at vncconfig, there's an -rfbport option: http://manpages.ubuntu.com/manpages/bionic/man1/Xvnc4.1.html – Yaron Aug 13 '19 at 06:42

0 Answers0