Developer build on Ubuntu Server 20.04.4

Starter Stuff

This howto will allow you to setup your own developer server for building Vircadia on Ubuntu Server 20.04.4. It’s based on the work by nshan which he and I have tested extensively. Please feel free to ask questions here or on Discord if you run into any problems.

First you should have ample resources for building Vircadia… the more the better but at the very least you should have at least 2 cores and 8 Gbs of Memory. Download Ubuntu 20.04.4 and install it on your computer or VM. We tested with 120 Gbs of disk space yet you might be able to whittle that down.

https://releases.ubuntu.com/20.04.4/ubuntu-20.04.4-live-server-amd64.iso

You want to install your Ubuntu Server with only the defaults. Basically, it is recommended not to add any additional software until the build environment is completed.

The Build

Just copy and paste these commands in your terminal… You can SSH in using Putty or similar SSH client like MobaXterm. https://mobaxterm.mobatek.net/download.html

# expand default volume to all available space

sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv

# install necessary build tools

sudo apt-get update
sudo apt -y install cmake g++ unzip

# Add QT v5.15.2 sources to sources list and update
start of section ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

!! If you get a message: “The repository ’http://ppa.launchpad.net/beineri/opt-qt-5.15.2-focal/ubuntu bionic Release’ does not have a Release file” or if the QT packages fail to install, skip this section and go to addendum at the bottom of the page. !!

sudo apt-add-repository -r ppa:beineri/opt-qt-5.15.2-focal
sudo apt-get update
sudo apt -y upgrade

# install qt libraries (likely missing some qml stuff, so interface will build but not run properly)

sudo apt -y install qt515base qt515connectivity qt515declarative qt515imageformats qt515multimedia qt515tools qt515webengine qt515websockets qt515xmlpatterns qt515svg qt515script

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
end of section

# install other libraries

sudo apt -y install libgl-dev libssl-dev libsdl2-dev npm

# Clone the Vircadia repository

git clone https://github.com/vircadia/vircadia --depth 1
cd vircadia/

# create builds directory and cd to it

mkdir build
cd build/

# create an environment variable to tell Vircadia where to find QT

export VIRCADIA_QT_PATH=/opt/qt515

# Run Cmake

cmake ..

Make install

The -j23 toggle tells the build how many cores you have… calculated = 2(number of cores) - 1
Change this to reflect your hardware. In this case I have 12 cores…

Chose one of the options that follow for the software you want to build:

# 1. To make the server and assignment clients

make domain-server assignment-client -j23

# 2. To make the interface

make interface -j23

# 3. To make it all

make domain-server assignment-client interface -j23

Execute the software

You won’t be able to run the interface because there is not a desktop environment. You will need to move the interface to a Untuntu 20.04.4 Desktop build by either an appimage, a snap or making a deb installer.

# To execute the server and assignment clients execute the following in separate terminals:

./domain-server/domain-server

./assignment-client/assignment-client -n 6

To stop the servers you can ctrl-c or type in a new terminal:

ps -Al

find the PID for the running service and type:

kill -9 <PID>

Addendum

Only perform this section if you had problems loading the repository. Not everyone experiences this problem and this is the work around. Perform the following instead and return to the instructions and continue after the section.

# Add QT v5.15.2 sources to sources list

sudo su
echo "deb https://ppa.launchpadcontent.net/beineri/opt-qt-5.15.2-focal/ubuntu focal main" >> /etc/apt/sources.list
echo "deb-src https://ppa.launchpadcontent.net/beineri/opt-qt-5.15.2-focal/ubuntu focal main " >> /etc/apt/sources.list
exit

# If the source above are not signed they will not work without --allow-insecure-repositories

sudo apt-get update --allow-insecure-repositories
sudo apt -y upgrade

# install qt libraries (likely missing some qml stuff, so interface will build but not run properly) which as before if not signed we need --allow-unauthenticated

sudo apt -y --allow-unauthenticated install qt515base qt515connectivity qt515declarative qt515imageformats qt515multimedia qt515tools qt515webengine qt515websockets qt515xmlpatterns qt515svg qt515script

Return and complete commands after section…

How to set up mongodb and metaverse server, and dashboard?
What about nginx?
Can you provide some guide lines?

Sounds like you want to setup your own Metaverse Server… I have not done this myself but will one day… till then I will point you to the docs…

Do let me know how you progress… Additionally, you can ask questions on the Discord Vircadia Dev channel for metaverse-server. MisterBlueguy helped us develop the current Metaverse Server…