CollabVM Server 2.0/Admin Panel and CollabVM Server 1.x/Server setup for beginners: Difference between pages

From Computernewb Wiki
(Difference between pages)
Jump to navigation Jump to search
m (1 revision imported)
 
computernewb>Mv
m (Update)
 
Line 1: Line 1:
[[File:AdminPanel-200.png|thumbnail|500px|Screenshot of the Admin Panel in CollabVM 2.0.0 beta (a81634f)]]
{{UnderConstruction/Choco}}


The '''Administrator Panel''' lets you configure nearly everything in CollabVM.  
This guide is intended to help get you setup with CollabVM 1.2.11 along with an NGINX server to handle your requests. You may host it publicly or run it privately.
These instructions are tested '''only''' with Debian 11 and CollabVM 1.2.11. If you vary, you will have to substitute commands for your own. Basic Linux knowledge is '''strongly''' recommended.


From here, you can delete, create, and add virtual machines, as well as remotely manage them and change many settings in the server configuration. Be careful giving your admin panel to other users, because like all admin panels it can be used as a weapon of mass destruction if used maliciously.
= Installation =
== Basic server requirements ==
* OS: Windows is '''not''' supported (but works). As said, these instructions are tested with Debian 11. Most Linux distributions will work, however.
* CPU: Preferably one which supports hardware virtualization. It is not required, but performance may suffer without it.
* RAM: You will need enough RAM to host your OS, CollabVM and the associated virtual machine. Have at least 2 GB of RAM free.
* Disk: Technically you need only about 50 megabytes of storage to run CollabVM, however you will need space for NGINX and your associated VM. Have atleast 4 GB of free storage, much more (>16GB) if you are hosting full Windows VMs.
* Permissions: You'll likely need root-level access to the server you're using in order to install packages for the system. However, collab-vm-server should '''NEVER''' be run as root! (or administrator privileges, when on Windows)


This page will document all the features found in the Admin Panel.
== collab-vm-server setup ==
Do the following under a user with limited privileges (with the exception of sudo commands, if you wish):
# You will need to grab the required libraries and some additional tools for collab-vm-server:
#* <code>sudo apt install -y libboost-dev libboost-system-dev libcairo-dev libvncserver-dev libc-dev libturbojpeg-dev libsqlite3-dev make clang git</code>
# Next, you'll want to clone (download) the collab-vm-server repository: <code>git clone https://github.com/computernewb/collab-vm-server-1.2.git -b release/1.2.11 --recurse-submodules</code>
# Now, change directory: <code>cd collab-vm-server</code>
# Since we will run collab-vm-server under NGINX, we will need to modify two files:
#* Using the editor of your choice, edit the file <code>src/websocketmm/websocket_user.cpp</code> inside the CollabVM source code. Remove the double slashes in the line containing <code>//#define WEBSOCKETMM_SUPPORT_PROXYING</code>.
#* The next file to edit is <code>src/CollabVM.cpp</code>. Here, look for a line containing <code>server_->start("0.0.0.0", port);</code>. Change the <code>0.0.0.0</code> to <code>127.0.0.1</code>
#** What we've done here is make it so CollabVM listens only on localhost. This way, malicious users cannot spoof their IP address by setting headers.
# To compile collab-vm-server, execute this command: <code>make -j$(nproc) JPEG=1</code>
#* If you would not like JPEG support (not recommended!) you can leave out the <code>JPEG=1</code> flag. Do not disable this unless you know what you are doing.
#* Note that this command will also use all of your cores, if you would like to utilize less cores, replace <code>$(nproc)</code> with the amount of cores you'd like to use
The collab-vm-binary is now compiled and ready to be used. It doesn't provide a proper HTTP server though, so it will not run


==Changes from CollabVM 1.x==
== Webapp setup ==
There are a some changes in the admin panel since CollabVM 1.x.
Again, continue doing the following here under a user with limited privileges.
=== Main webapp ===
# Go back 1 directory: <code>cd ..</code>
# Install node.js:
## First, you need curl: <code>sudo apt install -y curl</code>
## Run this command: <code>curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -</code>
## Then install it: <code>sudo apt install -y nodejs</code>
# Get the web app: <code>git clone https://github.com/computernewb/collab-vm-web-app.git</code>
# Change directory into the webapp <code>cd collab-vm-web-app/</code>
# Install the required packages: <code>npm i</code>
# And install gulp globally: <code>sudo npm i -g gulp</code>
# Time to edit another file:
#* Edit <code>src/js/collab-vm/common.js</code>, look for the line containing <code>serverAddress: window.location.host,</code>, change it to <code>serverAddress: window.location.host + '/cvmws',</code>
# Now run <code>gulp</code>, let it build the web app.
=== Admin webapp ===
# Go back 1 directory, once again: <code>cd ..</code>
# Grab the admin webapp: <code>git clone https://github.com/computernewb/collab-vm-admin-web-app.git</code>
# Now change directory into the admin webapp <code>cd collab-vm-admin-web-app/</code>
# Then install the packages, once again: <code>npm i</code>
# We need to modify the same file:
#* Edit <code>src/collab-vm/common.js</code>, this time replacing <code>var serverAddress = window.location.host;</code> with <code>var serverAddress = window.location.host + '/cvmws';</code>
# Now run gulp once again: <code>gulp</code>
=== Constructing your HTTP directory ===
We will be creating the directory in <code>/home/test/collab-vm-www</code>, please substitute the commands as needed.
# First we will create the directory: <code>mkdir /home/test/collab-vm-www/</code>
# Now we will add a file inside:
#* Create the file <code>index.html</code> with the following content: <syntaxhighlight lang="html">
<!DOCTYPE html>
<html>
  <head>
      <title>...</title>
      <meta http-equiv="refresh" content="0; url=/collab-vm/" />
  </head>
  <body>
  </body>
</html>
</syntaxhighlight>
# Next, copy the main webapp into your www directory: <code>cp -r collab-vm-web-app/build /home/test/collab-vm-www/collab-vm</code> (Don't forget the <code>collab-vm/</code>)
# And the admin webapp: <code>cp -r collab-vm-admin-web-app/build /home/test/collab-vm-www/admin</code>
Now you have a working HTTP root for your Collab VM installation. We will be using NGINX in the next step in order to host this directory.


*There is no more "Save" button - everything now saves automatically.
== NGINX installation ==
*The Admin Panel page is now in Semantic UI instead of Bootstrap.
We will be installing and configuring NGINX to host our webapp and proxy connections to the collab-vm-server instance. In this case, we are using port 6004, with collab-vm-server using port 6005 and our root directory being the same as previously (<code>/home/test/collab-vm-www</code>). We are also not accepting IPv6 connections, which may need some additional configuration.
*The Admin Panel no longer users a master password but rather registered accounts with privileges.
# First, install NGINX: <code>sudo apt install nginx -y</code>
*Certain commands have variables - i.e. $IP_ADDRESS for a users IP, $TOKEN for a ReCAPTCHA token, etc.
# Next, you will want to add an additional site configuration to NGINX.
*You can now create user accounts from the admin panel.
#* Create the file <code>/etc/nginx/sites-enabled/collab-vm</code>, and insert the following contents inside. If needed, substitute the values as necessary. Root privileges might be required to edit this file. <syntaxhighlight lang="nginx">
 
server {
==QEMU Information==
  listen 6004; # Listen on port 6004
In release 4.2.0, the sound system will crash QEMU when the server attempts to generate sound. It is suggested to use 4.1.0 or earlier instead.
  access_log /var/log/nginx/cvm.log; # Log visitors to this file
 
  root /home/test/collab-vm-www/; # This will be your root www directory
==User invites==
  location /cvmws {
You can now create a user invite from the admin panel. (todo: write more here later)
    proxy_pass http://127.0.0.1:6005; # This will be the port collab-vm-server will be listening on
 
    proxy_http_version 1.1;
==Accessing the Admin Panel==
    proxy_set_header Upgrade $http_upgrade;
To access the admin panel go to '''localhost:port/admin'''
    proxy_set_header Connection "Upgrade";
 
    proxy_set_header Host $host:$server_port;
You will need to register an account before being able to access it.
    proxy_buffering off;
 
    proxy_redirect off;
==Options==
    proxy_set_header Sec-WebSocket-Extensions  $http_sec_websocket_extensions;
 
    proxy_set_header Sec-WebSocket-Protocol $http_sec_websocket_protocol;
===Server Config===
    proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key;
====Allow account registration====
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
*'''Default value''': false
    proxy_connect_timeout 10s;
 
    proxy_read_timeout 36000s;
If this is enabled, account registrations will be enabled. Users will be able to create their own accounts and use them on CollabVM. If you don't want users to be able to make accounts, simply disable this option.
    proxy_temp_file_write_size 16k;
 
  }
====Max WebSocket connections per IP====
  location / {
*'''Default values''': false, 0
    try_files $uri $uri/ =404;
 
  }
This will limit the amount of connections a user can have per IP address. This is mainly to prevent "turn-bombing" (racking up turns at a rapid rate). So for example, if you set this value to "3", users can only open 3 connections to CollabVM on their IP. It is not recommended to have this value below 2.
}
 
</syntaxhighlight>
If you want users to be able to have infinite connections, set the value to 0, or just disable it entirely.
# Now, enable and start NGINX using these commands:
 
## <code>sudo systemctl enable nginx</code>
====Ban IP Command====
## <code>sudo systemctl start nginx</code>
*'''Default value''': (none)
Now, visit your server's IP address on port 6004. If the IP address were <code>192.168.1.100</code>, then visit http://192.168.1.100:6004/ in your browser. It should load the CollabVM interface with an endless loading spinner.
 
If you want to be able to use the "Ban User" button on the VMs, you will have to add in a Ban IP command.
 
Example commands:
 
*Free/OpenBSD: '''pfctl -t blockedips -T add $IP_ADDRESS'''
*Linux: '''iptables -A INPUT -s $IP_ADDRESS -j DROP'''
*Linux (with ipset): '''ipset add blockedips $IP_ADDRESS'''
*Windows Vista/Server 2008 and up: '''netsh advfirewall firewall add rule name="CollabVM Block - $IP_ADDRESS" dir=in interface=any action=block remoteip=$IP_ADDRESS/32'''
 
===Captchas===
Captchas are a brand new feature in CollabVM Server 2.0 which will allow you to stop automated attacks against your VMs. You can either enable them for everyone or send individual users Captchas. This setting does not have to be enabled to use the "Send Captcha" option.
 
=====Enable Captchas=====
*'''Default value''': false
Enables Captchas on the site. If you use the default ReCaptcha, you will need to add in your ReCaptcha key. You can get a ReCaptcha key here: https://www.google.com/recaptcha/intro/
 
You may also use another service - i.e. FunCaptcha, hCaptcha, etc, but this will require you to modify the web app.
 
Variables: $TOKEN - user's Captcha token, $IP - user's IP Address
 
=====Verification URL=====
*'''Default value''': https://google.com/recaptcha/api/siteverify
 
The verification URL for the Captcha. You may change this to another service if you want.
 
=====HTTP POST Parameters=====
*'''Default value''': secret=6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe&response=$TOKEN
 
The HTTP POST Parameters will go here. This is where your ReCaptcha key goes should you choose to stick with it.
 
=====JSON success variable=====
*'''Default value''': success
 
The "success" variable returned.
 
====Require captcha before user interaction====
*'''Default value''': false
 
If this is enabled, users will be in a "read-only" state. They will still be able to view the VM and read the chat, but they will have to complete a Captcha before being able to chat, take a turn, change their username, start a vote reset, or participate in a vote reset. It is recommended to enable this setting if you have automated attacks being launched against your VMs.
 
===Recordings===
Recordings are a brand new feature in CollabVM Server 2.0 which let you keep logs of every action that occurs on the VM. It is recommended to use these if you are running a public server. Note that Recordings must be enabled per VM in the VM Settings.
 
====Keyframe Interval (seconds)====
*'''Default value''': 60
 
The Recording Keyframe Interval, in seconds.
 
====File Duration (minutes)====
*'''Default value''': 600
 
The duration of each recording, which is by default 600 minutes (10 hours). If you want to have more recording files, i.e. create a new one each hour, you can set this to 60, whereas if you want less recording files you could set it to 1440 minutes (24 hours).
 
=====Screen=====
*'''Default value''': true
 
Capture the screen in the recordings. It is highly recommended to keep these logged if you are running a public server.
 
=====Audio=====
*'''Default value''': True
 
Capture the audio in the recordings. This will increase the file size amount, and is not needed unless you want to make sure everything is logged.
 
=====Input=====
*'''Default value''': true
 
Capture the input sent in the VMs. It is recommended, although not necessary, to keep these logged if you are running a public server.
 
=====Chat & Users List=====
*'''Default value''': true
 
Saves a log of the chat and the list of users on the VMs. It is highly recommended to keep these logged if you are running a public server.
 
===Virtual Machines===
 
====Start====
This button will execute the Start command specified in the VM settings.
 
====Stop====
This button will execute the Stop command specified in the VM settings.
 
====Restart====
This button will execute the Restart command specified in the VM settings.
 
====Change Settings====
This button will allow you to change the settings of the selected virtual machines.
 
====View Recordings====
This button will allow you to view the Recordings (logs) of the selected virtual machines.
 
====New VM====
This button will let you create a new VM.
 
===New Virtual Machine Settings===
 
====Auto Start====
*'''Default value''': false
 
If this is enabled, the VM will automatically start when the CollabVM Server is started, unless the <code>--n</code> or <code>--no-autostart</code> argument has been given.
 
====Name====
*'''Default value''': (none)
 
This is the display name of the VM that will appear on the site. For example if you had Windows 7 as a VM, you would name it "Windows 7". This is not the same as the URL Name in CollabVM Server 1.x - each VM is identified by its ID instead of a URL.
 
You can also now use Unicode in VM titles, so you can for example use Japanese, Arabic, Chinese, Urdu, Russian, etc.
 
====Description====
*'''Default value''': (none)
 
This description will appear above the chat when users click on your VM. It is recommended to fill this with details of your VM, such as what programs it has, the admin password (if there is one), etc.
 
====Safe for Work====
*'''Default value''': false
 
If your VM prohibits NSFW (not safe for work) content, such as pornography or other things, you can enable this setting to indicate this. Note that this does not prevent users from opening porn or other NSFW material on your VM - it's up to you and your admins to stop it.
 
You could also check this if you have a VM with an OS like i.e. MS-DOS without a connection to the internet. Note that users can still display images with something like Base64 on modern operating systems even if it does not have an internet connection.
 
====Operating System====
*'''Default value''': (none)
 
This will appear when a user clicks "Show Details". It is recommended to put the full name of the OS here, example: "Windows 7 Ultimate SP1" or "Debian 10 Buster", etc.
 
====RAM====
*'''Default value''': 0
 
This will list how much RAM the VM has. Currently, it only supports gigabytes. If your VM only has i.e. 500 MB of RAM, put "0.5" for now.
 
====Disk Space====
*'''Default value''': 0
 
This will list how much Disk Space the VM has, in gigabytes. Currently, it only supports GB. If your VM has i.e. 500 MB of space, put "0.5" for now.
====Start Command====
*'''Default value''': (none)
 
The start command for your VM goes here. Some examples:
 
*QEMU: <code>qemu-system-i386 -m 1G -usb -device usb-tablet -nographic -vnc :0 -monitor telnet:127.0.0.1:55555,server,nowait</code>
*VirtualBox: <code>VBoxManage startvm "Windows 7" --type headless</code>
*VMWare: <code>vmrun start path/to/vmxfile.vmx nogui</code>
 
====Run Start Command when Guacamole disconnects====
*'''Default value''': false
 
This option will allow you to re-run the Start Command if Guacamole disconnects. Typically, this only happens if the VM is shutdown or the VM is not responding.
 
====Stop Command====
*'''Default value''': (none)
 
The stop command for your VM goes here. Some examples for common hypervisors:
 
*QEMU: <code>echo quit | telnet 127.0.0.1 55555</code>
*VirtualBox: <code>VBoxManage controlvm "Windows 7" poweroff</code>
*VMWare: <code>vmrun stop path/to/vmxfile.vmx hard</code>
 
====Vote for Reset Command====
*'''Default value''': (none)
 
The vote for reset/restart command for your VM goes here. Some examples for common hypervisors:
 
*QEMU: <code>echo system_reset | telnet 127.0.0.1 55555</code>
*VirtualBox: <code>VBoxManage controlvm "Windows 7" reset</code>
*VMWare: <code>vmrun reset path/to/vmxfile.vmx hard</code>
 
====Restrict VM to registered users only====
*'''Default value''': false
 
If you only want your VM to be usable by registered users (and not guests/unregistered users), enable this option. This is recommended if you are running a private server or if you want to prevent automated attacks more thoroughly. Note that unregistered users can still see your VM in the list, see the screenshot on the homepage and see the amount of users online.
 
====Restrict voting to registered users only====
*'''Default value''': false
 
If you do not want guests to be able to participate in vote for resets, enable this option. It is only recommended to enable this option if you are being attacked by bots or similar, as it will make most users unable to participate in vote resets.
 
====Recordings====
*'''Default value''': false
 
If you want to use Recordings (logs), enable this option. If you don't want to have any logs, you can leave this disabled. It is highly recommended to use Recordings if you are running a public server.
 
====Votes Enabled====
*'''Default value''': false
 
If you want to enable Vote for Reset, use this option. Make sure there is a "Vote for Reset Command" command put in the VM Settings.
 
====Vote Time====
*'''Default value''': 0 second(s)
 
The amount of time the Vote Reset will last for. If you set this to i.e. 120 seconds then users will have 120 seconds to cast their votes. If you want Vote Resets to automatically win you can set this time to 0.
 
====Vote Cooldown Time====
*'''Default value''': 0 second(s)
 
The amount of time you have to wait before you can start another vote reset. If you set this to i.e. 240 seconds then users will have to wait 240 seconds before they can reset the VM again. If you don't want there to be a cooldown time set this to 0.
 
====Protocol====
*'''Default value''': RDP
 
The protocol to be used. There are currently two options: VNC and RDP. VNC is what most software, i.e. QEMU, VMWare and Hyper-V use, while RDP is used by VirtualBox. You can connect CollabVM Server 2 to any VNC and RDP server, including even i.e. TightVNC and Microsoft's RDP Server, so you could host a real machine if you want.
 
If you use QEMU, you can also utilize VNC audio. If you use VirtualBox or Microsoft's RDP, you can utilize RDP audio.
 
'''NOTE''': YOU CAN NOT USE THE RDP PROTOCOL FOR VNC SERVERS AND VICE VERSA. THEY ARE COMPLETELY SEPARATE PROTOCOLS THAT ARE INCOMPATIBLE WITH EACHOTHER!!
 
====Guacamole Connection Parameters====
Specify the Guacamole Connection Parameters here. Two parameters MUST be specified: <code>hostname</code> and <code>port</code>. <code>hostname</code> is the server's IP to connect to - usually this is localhost, although you can specify an IP or domain name running outside your localhost. <code>port</code> is the port to connect to - for VNC this is 5900 by default, and for RDP this is 3389 by default. If your VNC server is running with a password, you can use the <code>password</code> parameter to use the password.
 
See [https://guacamole.apache.org/doc/gug/configuring-guacamole.html#connection-configuration this page] for more information and more arguments.
 
[[Category:Documentation]]

Revision as of 20:05, 17 March 2022

Template:UnderConstruction/Choco

This guide is intended to help get you setup with CollabVM 1.2.11 along with an NGINX server to handle your requests. You may host it publicly or run it privately. These instructions are tested only with Debian 11 and CollabVM 1.2.11. If you vary, you will have to substitute commands for your own. Basic Linux knowledge is strongly recommended.

Installation

Basic server requirements

  • OS: Windows is not supported (but works). As said, these instructions are tested with Debian 11. Most Linux distributions will work, however.
  • CPU: Preferably one which supports hardware virtualization. It is not required, but performance may suffer without it.
  • RAM: You will need enough RAM to host your OS, CollabVM and the associated virtual machine. Have at least 2 GB of RAM free.
  • Disk: Technically you need only about 50 megabytes of storage to run CollabVM, however you will need space for NGINX and your associated VM. Have atleast 4 GB of free storage, much more (>16GB) if you are hosting full Windows VMs.
  • Permissions: You'll likely need root-level access to the server you're using in order to install packages for the system. However, collab-vm-server should NEVER be run as root! (or administrator privileges, when on Windows)

collab-vm-server setup

Do the following under a user with limited privileges (with the exception of sudo commands, if you wish):

  1. You will need to grab the required libraries and some additional tools for collab-vm-server:
    • sudo apt install -y libboost-dev libboost-system-dev libcairo-dev libvncserver-dev libc-dev libturbojpeg-dev libsqlite3-dev make clang git
  2. Next, you'll want to clone (download) the collab-vm-server repository: git clone https://github.com/computernewb/collab-vm-server-1.2.git -b release/1.2.11 --recurse-submodules
  3. Now, change directory: cd collab-vm-server
  4. Since we will run collab-vm-server under NGINX, we will need to modify two files:
    • Using the editor of your choice, edit the file src/websocketmm/websocket_user.cpp inside the CollabVM source code. Remove the double slashes in the line containing //#define WEBSOCKETMM_SUPPORT_PROXYING.
    • The next file to edit is src/CollabVM.cpp. Here, look for a line containing server_->start("0.0.0.0", port);. Change the 0.0.0.0 to 127.0.0.1
      • What we've done here is make it so CollabVM listens only on localhost. This way, malicious users cannot spoof their IP address by setting headers.
  5. To compile collab-vm-server, execute this command: make -j$(nproc) JPEG=1
    • If you would not like JPEG support (not recommended!) you can leave out the JPEG=1 flag. Do not disable this unless you know what you are doing.
    • Note that this command will also use all of your cores, if you would like to utilize less cores, replace $(nproc) with the amount of cores you'd like to use

The collab-vm-binary is now compiled and ready to be used. It doesn't provide a proper HTTP server though, so it will not run

Webapp setup

Again, continue doing the following here under a user with limited privileges.

Main webapp

  1. Go back 1 directory: cd ..
  2. Install node.js:
    1. First, you need curl: sudo apt install -y curl
    2. Run this command: curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
    3. Then install it: sudo apt install -y nodejs
  3. Get the web app: git clone https://github.com/computernewb/collab-vm-web-app.git
  4. Change directory into the webapp cd collab-vm-web-app/
  5. Install the required packages: npm i
  6. And install gulp globally: sudo npm i -g gulp
  7. Time to edit another file:
    • Edit src/js/collab-vm/common.js, look for the line containing serverAddress: window.location.host,, change it to serverAddress: window.location.host + '/cvmws',
  8. Now run gulp, let it build the web app.

Admin webapp

  1. Go back 1 directory, once again: cd ..
  2. Grab the admin webapp: git clone https://github.com/computernewb/collab-vm-admin-web-app.git
  3. Now change directory into the admin webapp cd collab-vm-admin-web-app/
  4. Then install the packages, once again: npm i
  5. We need to modify the same file:
    • Edit src/collab-vm/common.js, this time replacing var serverAddress = window.location.host; with var serverAddress = window.location.host + '/cvmws';
  6. Now run gulp once again: gulp

Constructing your HTTP directory

We will be creating the directory in /home/test/collab-vm-www, please substitute the commands as needed.

  1. First we will create the directory: mkdir /home/test/collab-vm-www/
  2. Now we will add a file inside:
    • Create the file index.html with the following content:
      <!DOCTYPE html>
      <html>
         <head>
            <title>...</title>
            <meta http-equiv="refresh" content="0; url=/collab-vm/" />
         </head>
         <body>
         </body>
      </html>
      
  3. Next, copy the main webapp into your www directory: cp -r collab-vm-web-app/build /home/test/collab-vm-www/collab-vm (Don't forget the collab-vm/)
  4. And the admin webapp: cp -r collab-vm-admin-web-app/build /home/test/collab-vm-www/admin

Now you have a working HTTP root for your Collab VM installation. We will be using NGINX in the next step in order to host this directory.

NGINX installation

We will be installing and configuring NGINX to host our webapp and proxy connections to the collab-vm-server instance. In this case, we are using port 6004, with collab-vm-server using port 6005 and our root directory being the same as previously (/home/test/collab-vm-www). We are also not accepting IPv6 connections, which may need some additional configuration.

  1. First, install NGINX: sudo apt install nginx -y
  2. Next, you will want to add an additional site configuration to NGINX.
    • Create the file /etc/nginx/sites-enabled/collab-vm, and insert the following contents inside. If needed, substitute the values as necessary. Root privileges might be required to edit this file.
      server {
        listen 6004; # Listen on port 6004
        access_log /var/log/nginx/cvm.log; # Log visitors to this file
        root /home/test/collab-vm-www/; # This will be your root www directory
        location /cvmws {
          proxy_pass http://127.0.0.1:6005; # This will be the port collab-vm-server will be listening on
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "Upgrade";
          proxy_set_header Host $host:$server_port;
          proxy_buffering off;
          proxy_redirect off;
          proxy_set_header Sec-WebSocket-Extensions  $http_sec_websocket_extensions;
          proxy_set_header Sec-WebSocket-Protocol  $http_sec_websocket_protocol;
          proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_connect_timeout 10s;
          proxy_read_timeout 36000s;
          proxy_temp_file_write_size 16k;
        }
        location / {
          try_files $uri $uri/ =404;
        }
      }
      
  3. Now, enable and start NGINX using these commands:
    1. sudo systemctl enable nginx
    2. sudo systemctl start nginx

Now, visit your server's IP address on port 6004. If the IP address were 192.168.1.100, then visit http://192.168.1.100:6004/ in your browser. It should load the CollabVM interface with an endless loading spinner.