How to setup Jamulus on NREC - MCT-master/portal GitHub Wiki

Jamulus and NREC

This tutorial will show you how to set up NREC and Jamulus. You can skip to the Jamulus section if you are going to host it on a different service.

NREC

All NTNU and UiO users should have access to NREC using their Feide login.

Go to NREC and select Sign In. For authentication choose: Dataporten.

Once you've logged in you can see at the top left of your screen your project name, in this case DEMO-leigh.uio.no and the location, in this case osl for Oslo. bgo is the default but you will want to select set your location to osl for slightly lower latency.

Security Groups (Opening Ports)

On the left, expand the Project menu then Network menu and select Security Groups. You will probably have the default security group, but we will want to make two more: One for the SSH port so we can connect to the machine to set it up, and another for the Jamulus ports so people can connect to the Jamulus server.

Click the + Create Security Group button.

Give the security group the name SSH and click Create Security Group.

Your new security group gets created with two rules we don't want so make sure you delete both of the default rules first.

Now click the Add Rule button.

From the Rule dropdown list, select SSH which is at the very bottom of the list, then click the Add button at the bottom right of the dialogue.

You've set up the SSH Security group, now we need to make the second group for the Jamulus port. Click on Security Groups again in the left menu, and click Create Security Group.

Give this one the name Jamulus and click Create Security Group.

Delete the two default rules again.

Click Add Rule and select Custom UDP Rule from the Rule dropdown.

Then just add 22124 to the Port field and click Add.

You've set up your security groups.

Create a machine

Now expand the Project dropdown, then the Compute dropdown, and select Instances. Click the Launch Instance button on the right of the screen.

Give your machine and Instance Name and click Next >.

Click the up arrow for GOLD Debian 10, then scroll to the bottom of the dialogue and click Next >.

The only Flavor you can use for Debian with a standard NREC account is the m1.small so click the up arrow to select m1.small and then click Next >.

Click the up arrow for dualStack and click Next >. This gives you both IPv4 and IPv6 access.

On the Network Ports page you can't do anything, just click Next >.

On the Security Groups page, click the up arrows for SSH and Jamulus to move them from the Available list to the Allocated list. Once your screen looks like this, click Next >.

On the Key Pair page you can import a key pair if you already have one. If you don't, or don't know what I'm talking about, click the Create Key Pair button.

The key pair lets you connect to the machine by using a secret file on your computer, so no one else can connect to the machine unless they have your secret key file. The key will reside on your current computer so in the field Key Pair Name put a name that will help you identify where you are connecting from.

For Key Type select SSH Key.

Press the Create Keypair button.

The private key that gets shown to you when you click Create Keypair is what you need to store in your secret file in your computer and you should never give it to anyone else.

Click the Copy Private Key to Clipboard button.

If you're using windows, open VSCode, create a new file and paste in the copied private key and save it to:

C:\Users\your_user_name\.ssh\id_rsa.pem

On OSX open your text editor, paste in the copied private key and save it to:

/home/your_user_name/.ssh/id_rsa

Change your_user_name with your account name on your computer.

Click the Done button on the Create Key Pair dialogue.

Your new keypair will now show up in the Allocated section.

We don't need to configure anything else, so click the Launch Instance button at the bottom right.

Your instance will be scheduled for creation. If you wait a few seconds it will show up on your instances page.

Note the IP address of your new machine!

Open a terminal which has ssh (Powershell or cmd on Windows, Terminal on OSX).

Type the following to connect to your new machine, replacing xxx.xxx.xxx.xxx with the IP address just took note of:

On Windows:

ssh -i .ssh\id_rsa.pem [email protected]

On OSX:

ssh -i .ssh/id_rsa [email protected]

When asked Are you sure you want to continue connecting (yes/no)? type yes and hit enter.

You should now be presented with a terminal on your new linux box!

Jamulus

These instructions assume you are using a Debian distribution of Linux.

SSH to your linux machine and run the following commands in the linux terminal:

sudo apt-get install -y build-essential qtdeclarative5-dev qt5-default qttools5-dev-tools libjack-jackd2-dev

wget https://deac-ams.dl.sourceforge.net/project/llcon/Jamulus/3.5.10/Jamulus-3.5.10.tar.gz

tar -xzf Jamulus-3.5.10.tar.gz

cd Jamulus3.5.10/

qmake "CONFIG+=nosound headless" Jamulus.pro

make clean

make

sudo adduser --system --no-create-home jamulus

sudo mkdir /var/log/jamulus

sudo chown jamulus:nogroup /var/log/jamulus/

sudo mv ~/Jamulus3.5.10 /usr/local/bin/jamulus

We now have to make a service file that will run Jamulus in the background.

We will use the nano text editor. Run the following command to open the text editor.

sudo nano /etc/systemd/system/jamulus.service

Paste the text below into the open text editor in your terminal.

[Unit]
Description=Jamulus-Central-Server
After=network.target
[Service]
Type=simple
User=jamulus
NoNewPrivileges=true
ProtectSystem=true
ProtectHome=true
Nice=-20
IOSchedulingClass=realtime
IOSchedulingPriority=0
# This line below is what you want to edit according to your preferences
ExecStart=/usr/local/bin/jamulus/Jamulus --server --nogui \
--log /var/log/jamulus/jamulus.log \
--welcomemessage "<h2>My amazing server</h2>" \
--numchannels 30
# end of section you might want to alter
Restart=on-failure
RestartSec=30
StandardOutput=journal
StandardError=inherit
SyslogIdentifier=jamulus
[Install]
WantedBy=multi-user.target

Press the following key combinations to save and close the file.

Write out to file: ctrl + o

Confirm: enter

Close the text editor: ctrl + x

Now run the following commands to run the Jamulus service.

sudo chmod 644 /etc/systemd/system/jamulus.service

sudo systemctl daemon-reload

sudo systemctl start jamulus

Run this command to confirm no errors were thrown when starting the service.

tail /var/log/syslog

Now connect to your new Jamulus server using the IP address you noted earlier.

⚠️ **GitHub.com Fallback** ⚠️