Skip to content

Instantly share code, notes, and snippets.

@branning
Last active October 31, 2016 17:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save branning/bb2117209147fff1b12a47ad9a69902c to your computer and use it in GitHub Desktop.
Save branning/bb2117209147fff1b12a47ad9a69902c to your computer and use it in GitHub Desktop.
Use Winswitch to run Trillian remotely on Ubuntu and view locally on MacOS

Use Winswitch to run Trillian remotely on Ubuntu 14.04 and view locally on MacOS

Winswitch is like 'screen for X11', in that it allows you to start an application on a remote host, connect to it remotely, disconnect, and re-connect later and everything will be as you left it. It decouples the viewing of a graphical application from the running of it.

You can achieve a similar effect with X11 forwarding in ssh, by using ssh -Y <hostname> <application>, but when you disconnect the application will quit.

The connection itself is made with Xpra, which is like VNC but allows more efficient video and audio compression.

Install Trillian on remote server

This is kind of a pain, because Trillian only supplies a .deb. But you can make it work. The dpkg -i install command will fail, but you can fix after with --fix-broken/-f

wget -O trillian_2.0.0.5_amd64.deb https://www.trillian.im/get/linux/2.0/?deb=64
dpkg -i trillian_2.0.0.5_amd64.deb
apt-get install -f -y

Install Winswitch on remote server

Visit the Winswitch Linux downloads page, and select your distribution. The instructions that pop up below are good enough to copy-paste. Here are the steps for Ubuntu 14.04 Trusty Tahr:

# become root
sudo su -
# install winswitch packager's key
apt-get install curl
curl http://winswitch.org/gpg.asc | apt-key add -
# add winswitch repo to apt, then install winswitch
echo "deb http://winswitch.org/ trusty main" > /etc/apt/sources.list.d/winswitch.list;
apt-get install software-properties-common >& /dev/null;
add-apt-repository universe >& /dev/null;
apt-get update;
apt-get install winswitch

Install Winswitch on local Mac

There is a DMG installer of Winswitch here: http://winswitch.org/dists/osx/x86/Window-Switch.dmg

Open this installer, then drag the Window-Switch icon to Applications.

The package is untrusted, so the first time you run you'll have to open the Applications folder in Finder, then Ctrl+click the Window-Switch icon, select Open, then say Open anyway when it warns you about security.

Start Xpra session on display 100 running Trillian on remote Linux machine

This starts a persistent instance of Trillian. This is the application you view from the Mac.

Note: be sure to run this statement as a non-root user.

sudo su myuser
xpra start :100 --start-child=trillian

Connect with Winswitch to remote server

  1. Open Winswitch (+space, window-switch)
  2. Servers --> New Connection Winswitch New Connection dialog
  3. Open Server dialog (Servers --> myuser@trillian-server)
  4. Click Sessions tab, then Start Application Session near the bottom
  5. Connect to Trillian Session Winswitch connecto to Trillian session
  6. Enable auto-resume
  • Open Server dialog, click General tab
  • check Auto Resume box, near middle

Close and Resume

Now that Trillian is running on the remote Linux machine, you're free to disconnect and when you connect again everything will be as you left it. If you enabled 'Auto Resume', then your Trillian session will automatically re-open when you open Window-Switch on the Mac.

  1. Quit Window-Switch (+q)
  2. Open Window-Switch (+space, window-switch)
  3. Wait a second, Trillian windows should appear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment