Skip to content

Using Groove Basin over SSH

dohliam edited this page Sep 13, 2015 · 1 revision

Groove Basin and SSH

Many people may not be aware that Groove Basin works perfectly over an SSH connection, allowing you to stream your entire music collection while on the road or while using a thin client. For example, this is a great solution for people using chromebooks (only tested on Ubuntu running via crouton, but in theory should also work within Chrome OS as well), which typically have limited onboard disk storage.

Since Groove Basin has all the features of a full desktop application while still being quite lightweight and responsive, it can be a great drop-in replacement for your favourite music player. If you frequently do remote work, this is one of the best ways (possibly the only way) to get such full-featured access to your music collection over a secure connection.

Starting the Groove Basin server

If Groove Basin is not already running on the host computer, then the server needs to be started before you can access through your client over SSH.

Luckily, starting the server remotely is as easy as it is on a local machine. Just enter the Groove Basin directory (where the groovebasin.db database is located) and run Groove Basin from there:

groovebasin

The rest of this guide assumes that the server is running.

Forwarding the Groove Basin port

The trick to accessing Groove Basin over an SSH connection is to forward the Groove Basin port to the local machine so that the browser can access the music player client as if it was being served locally. The way to forward ports in SSH is using the -L option. The default port for Groove Basin is 16242, so you just need to forward this port to 127.0.0.1 (or localhost) on the local machine:

ssh -L 16242:127.0.0.1:16242 HOST

Replace HOST with the hostname or IP address of the remote host you want to SSH into. As long as the Groove Basin server is running on the remote machine, you should now be able to go to http://0.0.0.0:16242/ in the browser on your local machine and immediately see the Groove Basin player ready to stream your music collection.

You will need to click the "Stream" button at the top of the player window so that it says "Stream:On" in order to hear your music. There is currently no way to have streaming on automatically when connecting to Groove Basin.

Automating the connection

There are several ways to automate your connection to the Groove Basin server once you have established that the basic command above is working:

  1. You can use a combination of a bash alias / script etc containing the connection command, and a bookmark in your browser to the Groove Basin player URL. The script could be set to start automatically, and the player could then be accessed whenever desired by simply opening the bookmark in the browser.
  2. If you want to have more control of the opening of Groove Basin or don't always have a browser window open, you will probably want to use the "force pseudo-tty allocation" option with ssh (-t) to allow you to run further commands on the local machine after the remote connection has been established. However, be aware that you will need to call this option twice for it to work as expected: ssh -t -t -L 16242:127.0.0.1:16242 HOST &.
  3. To save time, you can use this small shell script which does everything described above and also automatically opens the Groove Basin player in a browser window on connection, as well as having a few extra options for starting/restarting the Groove Basin server.