Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

noVNC Multiple Localhost Servers

Ive got 4 dev VMs for four projects (all VMware Player VMs w/ubuntu 15.04 host) where each is running VNC (ports 5900, 5901, 5902, 5903) respectively.

I downloaded noVNC and saved to /var/www/html (my apache2 server on same host). Based on the ReadMe I then ran on my terminal

 ./utils/launch.sh --vnc localhost:5900

I received a missing websockify error, so downloaded it and placed it into the util folder. I then ran the same command and it worked! The terminal told me to Navigate to a url and sure enough I could control my VM.

However -- I'm wondering how can I use noVnc to access all 4 VM's? Is there some simple way to extend the port to a range like in iptables or firewalld?

./utils/launch.sh --vnc localhost:5900-5903
like image 765
Chris Avatar asked Dec 19 '22 22:12

Chris


1 Answers

Okay, Ill answer for myself here in case it helps someone in the future...

First, create a token file where each line has a nickname, ip address, and port.

I created a file named token.list where each line looks like:

localhostnickname1: localhost:5900
localhostnickname2: localhost:5901
...

Then I use my terminal to go into the websockify folder so I can see the run file. I issue it the command:

./run --web /path/to/noVNC --target-config /path/to/token.list localhost:6080

Finally, I open my web browser and go to :

http://localhost:6080/vnc_auto.html?path=?token=localhostnickname1

Where localhost1 is the nickname of my first server on the first line of token.list

This link was my reference. If you want to serve this outside of localhost -- change the parameter localhost:8060 from localhost to an IP

like image 149
Chris Avatar answered Dec 28 '22 06:12

Chris