How to compile a Stable Build of the Linux Server Stack on Ubuntu 16.04 LTS


#1

I did some testing and using the .deb provided for QT 5.6.1 I am able to build a working assignment-client and domain-server on Ubuntu 16.04 LTS. Here are the instructions. I assume you did a basic install of Ubuntu 16.04 LTS. I am now using Linode instead of DigitalOcean because you get 2GB of RAM for 10.00 a month (The servers require more ram than they used to). So if anyone wants to sign up through this link and give me some credit to help drive me to keep doing what I do, here is the link: http://Linode.com

Now for the instructions:

  1. apt-get update && apt-get upgrade -y
  2. apt-get install git build-essential cmake freeglut3-dev libicu-dev libssl-dev
  3. wget http://debian.highfidelity.com/pool/h/hi/hifi-qt5.6.1_5.6.1_amd64.deb
  4. dpkg -i hifi-qt5.6.1_5.6.1_amd64.deb
  5. adduser --system --shell /bin/bash --disabled-password --group --home /home/hifi hifi
  6. su - hifi
  7. git clone -b stable https://github.com/highfidelity/hifi.git
  8. cd ~/hifi
  9. mkdir build && cd build
  10. cmake -DSERVER_ONLY=TRUE -DQT_CMAKE_PREFIX_PATH=/usr/local/Qt5.6.1/5.6/gcc_64/lib/cmake ..
  11. make

Let us know how it works out for you!


My Compile in Debian (or how I learned to stop worrying and sideloaded QT)
Domain server at Ubuntu 16.04.1 LTS
Connection by place name
Best way to create a secure domain?
#2

Works …I think. You mightmake mention that the first instruction would be “su” I think. Where is the client? Thanks for the hard work!! Ric


#3

I used this and hifi compile scripts to create a dockerfile that mostly works. At the moment it is running on AWS and I can connect to it on port 40100, but unfortunately when the server restarts from changing the settings nothing changes which makes it unreachable via hifi. I’m guessing it’s a permissions problem and going to try some things but suggestions welcome.

FROM ubuntu:16.04

MAINTAINER Mat Tyndall <mat@beastpets.com>

RUN apt-get update && apt-get upgrade -y

RUN apt-get install -y wget git build-essential cmake freeglut3-dev libicu-dev libssl-dev libglib2.0-0

RUN wget http://debian.highfidelity.com/pool/h/hi/hifi-qt5.6.1_5.6.1_amd64.deb

RUN dpkg -i hifi-qt5.6.1_5.6.1_amd64.deb

RUN adduser --system --shell /bin/bash --disabled-password --group --home /home/hifi hifi

RUN git clone -b stable https://github.com/highfidelity/hifi.git

RUN mkdir build && cd build && cmake -DSERVER_ONLY=TRUE -DQT_CMAKE_PREFIX_PATH=/usr/local/Qt5.6.1/5.6/gcc_64/lib/cmake ../hifi/

RUN cd build && make assignment-client

RUN cd build && make domain-server

RUN cp /build/domain-server/domain-server /run 2>/dev/null && cp -uRL /build/domain-server/resources /run 2>/dev/null && cp /build/assignment-client/assignment-client /run 2>/dev/null && chown -R hifi:hifi /run

WORKDIR /run

USER hifi

EXPOSE 40100 40101 40102 40103

CMD ["./domain-server", "&", "./assignment-client"]

Setting up a server.. Help
#4

Another attempt at a dockerfile, refactored it and exposed more ports just in case.

Locally it seems to work better in that settings are saved on restart, however even after that it seems there were problems connecting to the ice-server (see log below) and even with a temporary name and domain id I was unable to connect with Interface.

As for the one on AWS, settings were not saved on restart (and restart seemed to take a few minutes), will look at logs tomorrow to see if I can figure out why.

Dockerfile:

FROM ubuntu:16.04

MAINTAINER Mat Tyndall <mat@beastpets.com>

RUN apt-get update \
  && apt-get upgrade -y \
  && apt-get install -y \
    wget \
    git \
    build-essential \
    cmake \
    freeglut3-dev \
    libicu-dev \
    libssl-dev \
    libglib2.0-0 \
  && wget http://debian.highfidelity.com/pool/h/hi/hifi-qt5.6.1_5.6.1_amd64.deb \
  && dpkg -i hifi-qt5.6.1_5.6.1_amd64.deb

RUN adduser --system --shell /bin/bash --disabled-password --group --home /home/hifi hifi \
  && su - hifi \
  && git clone -b stable https://github.com/highfidelity/hifi.git \
  && cd hifi \
  && mkdir build \
  && cd build \
  && cmake -DSERVER_ONLY=TRUE -DQT_CMAKE_PREFIX_PATH=/usr/local/Qt5.6.1/5.6/gcc_64/lib/cmake ..

WORKDIR /hifi/build

RUN su - hifi \
  && make assignment-client \
  && make domain-server

EXPOSE 80 443 40100 40101 40102 40103

USER hifi

CMD ["domain-server/domain-server", "&", "assignment-client/assignment-client"]

Warning messages from local container:

[WARNING] Cannot send an ice-server heartbeat without a private key for signature.
[WARNING] Waiting for keypair generation to complete before sending ICE heartbeat.
[DEBUG] Clearing current private key in DataServerAccountInfo
[DEBUG] Starting worker thread to generate 2048-bit RSA keypair.
[DEBUG] Generated 2048-bit RSA keypair. Uploading public key now.
[WARNING] Public key upload failed from AccountManager "Host requires authentication"

#5

I’m a little closer in that a PR I just submitted fixes the production settings for the ice-server but I still get the same warning above. It also doesn’t let me connect to the server with Interface either via the name or IP number. No idea what to try next, this is about as far as I’m willing to dig into the code.

# Dockerfile
FROM ubuntu:16.04

MAINTAINER Mat Tyndall <mat@beastpets.com>

RUN apt-get update \
  && apt-get upgrade -y \
  && apt-get install -y \
    wget \
    git \
    build-essential \
    cmake \
    freeglut3-dev \
    libicu-dev \
    libssl-dev \
    libglib2.0-0 \
  && wget http://debian.highfidelity.com/pool/h/hi/hifi-qt5.6.1_5.6.1_amd64.deb \
  && dpkg -i hifi-qt5.6.1_5.6.1_amd64.deb

RUN adduser --system --shell /bin/bash --disabled-password --group --home /hifihome hifi

ENV BRANCH="stable" \
  RELEASE_TYPE="PRODUCTION" \
  RELEASE_NUMBER=5429

USER hifi

# currently pointing at my fork
RUN cd /hifihome \
  && git clone -b stable --depth 1 https://github.com/flipside/hifi.git \
  && cd hifi \
  && mkdir build \
  && cd build \
  && cmake -DSERVER_ONLY=TRUE \
    -DQT_CMAKE_PREFIX_PATH=/usr/local/Qt5.6.1/5.6/gcc_64/lib/cmake ..

WORKDIR /hifihome/hifi/build

RUN make assignment-client \
  && make domain-server

EXPOSE 80 443 40100 40101 40102 40103

CMD ["domain-server/domain-server", "&", "assignment-client/assignment-client"]

#6

Little closer, tried using RC-23 and stable but no luck connecting to either of them with Interface. Help?

Dockerfile

FROM ubuntu:16.04

MAINTAINER Mat Tyndall <mat@beastpets.com>

RUN apt-get update \
  && apt-get upgrade -y \
  && apt-get install -y \
    apt-utils \
    wget \
    git \
    build-essential \
    cmake \
    freeglut3-dev \
    libicu-dev \
    libssl-dev \
    libglib2.0-0 \
  && wget http://debian.highfidelity.com/pool/h/hi/hifi-qt5.6.1_5.6.1_amd64.deb \
  && dpkg -i hifi-qt5.6.1_5.6.1_amd64.deb \
  && adduser --system --shell /bin/bash --disabled-password --group --home /hifihome hifi

ENV BRANCH="stable" \
  RELEASE_TYPE="PRODUCTION" \
  RELEASE_NUMBER=5505

RUN cd /hifihome \
  && git clone -b RC-23 --depth 1 https://github.com/highfidelity/hifi.git \
  && cd hifi \
  && mkdir build \
  && cd build \
  && cmake -DSERVER_ONLY=TRUE \
    -DQT_CMAKE_PREFIX_PATH=/usr/local/Qt5.6.1/5.6/gcc_64/lib/cmake ..

WORKDIR /hifihome/hifi/build

COPY start.sh /hifihome/hifi/build

RUN make assignment-client \
  && make domain-server
  && chown -R hifi:hifi ../

USER hifi

EXPOSE 40100 40101 40102 40103

CMD sh ./start.sh

start.sh

nohup assignment-client/assignment-client -n 4 &
domain-server/domain-server

#7

The server_only flag is back?
BTW if you install QT as root it will be in /opt

Cool about the deb, I have been using the installer which forced me to use a remote desktop :confused:


#8

How do you build interface with this?? Thanks!


#9

How to make interface from this??


#10

Those are instructions for server-only. You can find the normal build instructions here


OpenGL 4.1 required in Ubuntu
#11

Tried installing directly on an AWS Ubuntu 16.04 server (without docker). No problems with installation but still can’t connect with Interface and the logs are showing ICE connection problems still…

sudo apt-get update \
  && sudo apt-get upgrade -y \
  && sudo apt-get install -y \
    apt-utils \
    wget \
    git \
    build-essential \
    cmake \
    freeglut3-dev \
    libicu-dev \
    libssl-dev \
    libglib2.0-0 \
    screen \
  && sudo wget http://debian.highfidelity.com/pool/h/hi/hifi-qt5.6.1_5.6.1_amd64.deb \
  && sudo dpkg -i hifi-qt5.6.1_5.6.1_amd64.deb \
  && sudo adduser --system --shell /bin/bash --disabled-password --group --home /hifihome hifi

cd /hifihome \
  && sudo git clone -b stable --depth 1 https://github.com/flipside/hifi.git \
  && cd hifi \
  && sudo mkdir build \
  && cd build \
  && sudo cmake -DSERVER_ONLY=TRUE \
    -DQT_CMAKE_PREFIX_PATH=/usr/local/Qt5.6.1/5.6/gcc_64/lib/cmake ..

sudo make assignment-client \
  && sudo make domain-server \
  && sudo chown -R hifi:hifi ../

screen -h 1024 -dmS hifi domain-server/domain-server
screen -h 1024 -dmS hifi assignment-client/assignment-client -n 5

#12

I wish you would write a step-by-step for the “normal build” as you did for the server-only, which you did a GREAT job on! It just worked. Thanks, Ric


#13

Compiling was very easy following the OP guide. I got as far as flipside did, without being able to connect, regardless of how open I made the domain security settings.

I then connected the domain to a domain ID i created in HF. And then registered a place name, and connected that all together, and then a restart.

That worked, to log in. But there is no content in the domain. I was able to create a box, but it was gone closing interface and reconnecting. I double checked coordinates, and then made a huge box, just to be sure. and no the entity was not retained.

So I found what seemed to be the correct spot for assets and entities within the assignment-client folder (~/local/share/High Fidelity - dev/assignment-client). But still the domain is empty.

I’m sure the issue is something related placing things in the right place.

I guess I’ll do this with a windows vm instead for now.

/K


Cloud Domain Sever -- Linux? Windows?
#14

Well… I got it going… After getting a bit of sleep (I’m nursing a cold today) the answer came to me as I was laying there… and it was quite stupid simple.

I was only starting 1 assignment-client. When I used assignment-client -n 7, everything worked, and even the entities that I transferred from my windows install worked.

Why -n 7? I knew it needed 5 but I wanted to be sure it worked the first time. I then dug deeper looking at the server-console source code in github, (looks like a nodejs app) and saw it uses -n 6.

Also in the server-console I found a nice reference:
const HOME_CONTENT_URL = "http://cachefly.highfidelity.com/home-tutorial-release-5572.tar.gz";
This is the default sandbox content that gets loaded into
~/.local/share/High Fidelity - dev/assignment-client

YAY! I’m up.

/K


Cloud Domain Sever -- Linux? Windows?
#15

Hi, KriststarNova.
Could you write a step by step tutorial on how to connect remote server?

Currently, I complied a domain-server on ubuntu hosted on EC2 instance. What I wanna is connect this server from the Interface installed on my Macbook. I try use “GoTo” on my interface to navigate my EC2 domain-server by IP address and Places name, but nothing happens.

I’m very new and will be very appreciate your help.

Thanks


#16

Hi,
Have you fixed your issue? I exactly have the same environment and same problems as yours


#17

After seeing people have some issues with the instructions I decided to put together a new (and tested) method for compiling the hifi stack on Ubuntu 16.04. I used Amazon EC2 since that is what most people here seem to be using.

Setup

  • sudo su -
  • apt-get update && apt-get upgrade -y
  • apt-get install -y git build-essential cmake freeglut3-dev libicu-dev libssl-dev
  • wget http://debian.highfidelity.com/pool/h/hi/hifi-qt5.6.1_5.6.1_amd64.deb
  • dpkg -i hifi-qt5.6.1_5.6.1_amd64.deb
  • rm -rf hifi-qt5.6.1_5.6.1_amd64.deb
  • adduser --system --shell /bin/bash --disabled-password --group --home /home/hifi hifi

Switch User to hifi and get source / compile

  • su - hifi
  • git clone -b stable https://github.com/highfidelity/hifi.git
  • cd ~/hifi
  • mkdir build && cd build
  • cmake -G "Unix Makefiles" -DQT_CMAKE_PREFIX_PATH=/usr/local/Qt5.6.1/5.6/gcc_64/lib/cmake -DCMAKE_BUILD_TYPE=Release -DSERVER_ONLY=TRUE ..
  • make

Setup directory to store your high fidelity stack binaries and copy them over from build directory

  • mkdir ~/hifi-bin
  • cp -R assignment-client/assignment-client assignment-client/plugins ~/hifi-bin
  • cp -R domain-server/domain-server domain-server/resources ~/hifi-bin

Setup default home content

  • mkdir -p ~/.local/share/High\ Fidelity\ -\ dev
  • cd ~/.local/share/High\ Fidelity\ -\ dev
  • wget http://cdn.highfidelity.com/content-sets/home-tutorial-28.tar.gz
  • tar xfz home-tutorial-28.tar.gz
  • rm -rf home-tutorial-28.tar.gz

Run your new hifi server

  • cd ~/hifi-bin
  • ./domain-server &
  • ./assignment-client --max 10 &

#18

@Debs ^ this is I think what u need to do to get a server going