Skip to content

Instantly share code, notes, and snippets.

@carltesta
Last active February 5, 2024 21:13
Show Gist options
  • Save carltesta/2fe997abb681d0166038955eba7ac71c to your computer and use it in GitHub Desktop.
Save carltesta/2fe997abb681d0166038955eba7ac71c to your computer and use it in GitHub Desktop.
Creating a JackTrip Hub Virtual Server with Ubuntu Desktop environment

Creating a JackTrip HUB Virtual Server with Ubuntu Desktop environment and RDP access

This short guide explains how to create a JackTrip Virtual Machine using DigitalOcean, an easy to use cloud server platform. The goal here is to create a server with a desktop interface that you can login to and start JACK and QJackTrip for rehearsals, performances, etc. You can also install audio processing software like SuperCollider but I will save that for another tutorial. The benefit of creating this on a virtual machine is that using DigitalOcean's snapshot feature you can save this configuration and spin it up as needed and save money. You don't need this running 24/7 if you're only using it for rehearsals and performances. This configuration costs about $0.35/month to store on DigitalOcean as a snapshot. The minimal configuration described at the very bottom (without the desktop interface) is about $0.11/month to store on DigitalOcean using their snapshot feature.

Create your droplet with Ubuntu 20.04

The first step is to create a droplet with Ubuntu 20.04 LTS. Choose a root password or create an ssh key. Once your droplet is up and running, copy and paste the ip address DigitalOcean gives you, open up a terminal and type

ssh root@your_ip_address

and enter your password that you choose when you created the droplet.

Create a user with sudo privileges

First you will create a username for yourself, you will do most of your work with the server via this username so choose a username and password that works for you

Create a user replace username with your preferred username adduser username

Give that user sudo privileges usermod -aG sudo username

Add that user to the audio group, this will allow JACK to run in realtime mode usermod -a -G audio username

[Optional] Enable a Firewall

I'm not creating a firewall in this tutorial because it's not a server that is going to be running constantly, but if you want to enable a firewall with UFW you can read this DigitalOcean tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-20-04

Setup Desktop Environment and XRDP

Now you can logout as root using the command exit and log back in using the username and password you created. Once you're logged in you can type the following commands and enter your password as needed:

sudo apt-get update

If you want a barebones app setup without email, office apps, etc then I reccommend going for the minimal desktop install otherwise you can leave out the minimal tag and just install ubuntu-desktop

sudo apt install ubuntu-desktop-minimal

Next you install XRDP which is a RDP server which will enable you to use a program like Microsoft Remote Desktop to login to your server with a friendly desktop interface.

sudo apt-get install xrdp

Then make sure you enable xrdp to begin at startup

sudo systemctl enable xrdp

If you've setup a firewall in a previous step then you'll have to allow port 3389

sudo ufw allow 3389/tcp

Install JACK and build QJackTrip

Install the JACK (JACK Audio Connection Kit) software using apt sudo apt install jackd2

Build and install QJackTrip. QJackTrip is a version of JackTrip with a Graphic User Interface (GUI)

First clone the qjacktrip branch of the jacktrip repository git clone --branch qjacktrip https://github.com/jacktrip/jacktrip.git

Next, install the dependencies to build QJackTrip sudo apt install -y --no-install-recommends build-essential librtaudio-dev qt5-default autoconf automake libtool make libjack-jackd2-dev qjackctl audacity git

Change directory to jacktrip cd jacktrip

Run the build script using ./build-script

Finally, change directory into the build directory and copy the newly built qjacktrip application into your usr/local/bin folder and make it executable cd build sudo cp qjacktrip /usr/local/bin/ sudo chmod 755 /usr/local/bin/qjacktrip

Once you've done this you'll want to restart your system using the command below sudo shutdown -r now

Now you are finally ready to log into your server using a program like Microsoft Remote Desktop.

Simply log in to your desktop using the IP address of the server and your username and password you created in the first step.

Run JACK and QJackTrip!

Click on activities on the upper-left hand corner and search for the "Terminal" application

Run Jack on the Command Line using the following command jackd -R -t500 -ddummy -r44100 -p256

Open a new Terminal tab by pressing the plus button and run QJackCtl qjackctl

Finally, open up another tab and run QJackTrip qjacktrip

From here you can start your Hub Server with auto-patching enabled. If you need to do custom routings you can open up the Connect tab in QJackCtl and manually connect clients to each other.

Even more minimal installation

You could create an even more minimal JackTrip server using this same method but leaving out the parts where you install the Ubuntu Desktop and XRDP. Then you'd just log in to your server via SSH and create a .jackdrc file sudo nano .jackdrc

Include the following in the .jackdrc file usr/bin/jackd -R -t500 -ddummy -r44100 -p256

Press ctrl-o to save the file, press ctrl-x to exit

Then you can start your jacktrip hub server using one command like qjacktrip -S -p1 which would give you a simple client loopback setting. Check the JackTrip website to get more details on the various Hub settings and commands. Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment