UserVM Handbook

Revision as of 23:04, 13 February 2023 by Elijah (talk | contribs)

Welcome to the official guide on setting up a UserVM.

Prerequisites

You'll need:

  • A machine with decent specs (8GB of RAM and a modern CPU, probably)
  • A Linux distribution; You can pick any mainstream distro, for the purposes of this guide I recommend either Debian/Devuan or Arch/Artix. I recommend the OpenRC versions (Devuan/Artix) but that's just preference, pick what you're comfortable with. Yes, Ubuntu will work, it's terrible though
  • Basic knowledge of how computers and Linux systems work. We aren't going to hold your hand, you need to be comfortable with a command line
  • A few hours

Compiling the server

Install Git

First up make sure you have git installed:

sudo pacman -S --needed git # Arch
sudo apt install git # Debian

Clone the source

Now let's clone the source. This is assuming you're in your home directory but you can clone it wherever

git clone https://github.com/computernewb/collab3 collab-vm-server
cd collab-vm-server
git checkout release/1.2.11

Install build dependencies

Next, we need to install some build dependencies. First, the compile tools:

sudo apt install build-essential clang # Debian
sudo pacman --needed -S clang base-devel # Arch

Then run the included script to install required libraries:

scripts/grab_deps_linux.sh

Note that this only works on Debian or Arch-based distros. For other distros you'll need to track down the dependencies yourself, these are: libvncserver, cairo, boost, sqlite, turbojpeg

Enable reverse proxying mode

Next, we need to enable reverse proxying mode, as proxying behind nginx with SSL is required for a UserVM.

sed -i 's/\/\/#define WEBSOCKETMM_SUPPORT_PROXYING/#define WEBSOCKETMM_SUPPORT_PROXYING/g' src/websocketmm/websocket_user.cpp

Lastly, you should switch to listening on 127.0.0.1 rather than 0.0.0.0, which keeps the port CollabVM is running on closed. This is necessary in reverse proxy mode as anyone with the port can spoof their ip by setting the X-Forwarded-For header.

sed -i 's/0.0.0.0/127.0.0.1/g' src/Main.cpp

Build the server

Finally, build the server

make CC=clang CXX=clang++ JPEG=1