Perkify - X11

Written by Rich Morin.

Contents: (hide) (show)

Path:  AreasContentHowTos

Precis:  using Perkify via the X Window System (X11)

This page is an introduction to using Perkify via the X Window System (X11). Let’s start with a bit of terminology:

An X client is an application program that displays on an X server but which is otherwise independent of that server.

http://www.linfo.org/x_client.html

So, if Perkify has an X-based application (i.e., client), we should be able to run it from the host OS, using an appropriate server.

Preliminaries

The procedure for installing an “appropriate server” varies from OS to OS.

Usage

Perkify ships with X forwarding enabled and includes a few dozen common X11 clients. So, is your host machine has a working X11 setup, starting up an X11 client should Just Work. However, the command syntax can get a little complicated.

Syntax

As documented on Vagrant’s SSH page, the command to access a virtual machine (VM) via SSH begins with vagrant ssh:

vagrant ssh [name|id] [-- extra_ssh_args]

If our current directory is ~/perkify (or any other directory with a Vagrantfile and such), we can leave off the [name|id] part. This leaves us with [-- extra_ssh_args], which the page explains as follows:

If a -- (two hyphens) are found on the command line, any arguments after this are passed directly into the ssh executable. This allows you to pass any arbitrary commands to do things such as reverse tunneling down into the ssh program.

https://www.vagrantup.com/docs/cli/ssh.html

So now, we’re in the wonderful world of ssh command options. The ssh man page lists dozens of these, but fortunately we only need a couple at the moment. First, we use -X to tell SSH to enable X11 port forwarding. Then, we use -p 2222 to tell SSH which port to use. Following Vagrant’s suggested practice, Perkify forwards the VM’s SSH port (22) to port 2222 on the host machine.

Finally, we need the name of a command on the VM, along with any options we want to use with it. For example, we might want to run an xclock window, upating the appearance every two seconds:

$ vagrant ssh -- -X -p 2222 xclock -update 2

Examples

As a quick sanity check, let’s try running some example commands (use Control-C to terminate the command):

$ vagrant ssh -- -X -p 2222 xclock -update 2
$ vagrant ssh -- -X -p 2222 xeyes

For a bit more of a stress test, try running a copy of the Firefox web browser on the VM and interacting with it on your host’s window system. Although this actually works, the scrolling won’t be all that fast:

$ vagrant ssh -- -X -p 2222 firefox

Note: The article Run graphical programs within Vagrantboxes gives a nice rundown on X installation and basic usage.

Accessibility

The state of accessibility in the X11 ecosystem seems very fragmented, varying by the particular stack of software that is being used. Apparently, the AT-SPI2 protocol will typically be a major player in any accessible X11 stack. However, this still leaves open the question of what your app is doing, what libraries it is using, what screen reader you are using, etc.

This is all too deep for me, but if you’re interested in digging further, check out Samuel Thibault’s Accessibility page. It provides an overview and lists a lot of useful resources.

To be continued…