CoCalc Blog

CoCalc brings collaborative persistent graphical Linux applications to your browser, with integrated clipboard and HiDPI support

William Stein and Hal Snyder • • cocalc

Graphical Linux Applications Finally Come to CoCalc!

The goal of CoCalc is to make all open source mathematics and data science software easily available in your web browser, in order to reduce the barriers to using open source software for teaching courses and doing research. For many years, people have been requesting the ability to run standard graphical Linux applications in CoCalc. Until now, we have primarily focused on Jupyter notebooks, and other “native” web applications. However, we finally figured out how to bring standard graphical Linux applications to CoCalc, which will further help in our mission of removing barriers to using free open source software in teaching and research.

Using Nteract (a desktop Jupyter client), Emacs, and Python Tk in CoCalc

CoCalc now has X11 graphical support, which lets you run any graphical Linux application in your browser. You want to try this out: Go to CoCalc.com, make an account, create a project, then click +New and select X11 Desktop.

starting an X11 display in CoCalc

You’ll get an xterm.js terminal on the left and a blank desktop on the right. Type xclock& in the terminal then press enter, and you’ll see a tab appear on the right. Click it and see a clock.

Running XClock in CoCalc

Type python3 in the terminal, and try something involving Turtle graphics, and it will just work:

Running XClock in CoCalc

Many other graphical programs work the same way, including inkscape, libreoffice, octave, gvim, emacs, gnome-shell, VS code, nteract, swirl, PyGame, and much more. Let us know what you want.

If you run anything that tries to display X11 graphics, it’ll also just pop up in the window on the right.

CoCalc adds Persistence, Collaboration, HiDPI/Retina support, and Full Clipboard Integration

Our support for X11 is based on the Xpra remote display server, with our own new Xpra client, which is a complete rewrite of the official Xpra HTML5 client. We have also integrated two core features of CoCalc:

• Persistence. You can close your browser, then come back later to the exact same session (with the same applications running), as long as your CoCalc project is still running.

• Collaboration. Another person can open the same X11 desktop and interactively use the same programs you’re using. This is very helpful for video or text chats (supported via chat on the right), and other collaborative work.

These features give CoCalc’s X11 support an edge over traditional X11 forwarding, for example via SSH. Xpra is also generally faster than X11 forwarding over SSH.

Our Xpra integration also looks crisp because it properly handles HiDPI and Retina displays by appropriately rescaling windows, and we provide zoom buttons to very easily tweak the size to your liking.

Finally, there is full clipboard integration between your computer and the remote X11 session (copy only works on Chrome 66+).

Screenshots

Octave

GNU Octave launched from a terminal with plot in X11

LibreOffice

R command line (left) exports dataframe to .xlsx file, which we then display in libreoffice(right)

Octave GUI

CoCalc running GUI version of GNU Octave

SAOImageDS9

Astronomical imaging in CoCalc with SAOImageDS9

Inkscape

Editing the CoCalc logo using [Inkscape](https://inkscape.org/), with chat on the side

Chrome

Chrome in Chrome in Chrome ... (NOTE: Chrome and Firefox will sometimes crash due to security restrictions of Docker, unfortunately.)

Snappy

If you want to try something that uses interactive OpenGL 3D graphics, run snappy (sage -python -m snappy.app and wait about 20 seconds), then type this into snappy

M = Manifold("8_20"); M.browse()


and click on the Dirichlet tab of the window that pops up. It’s pretty fast, actually. Much faster than I expected.

Studying the topology and geometry of 3-manifolds...