Running Scrivener on Linux

December 31, 2021. 1,180 words and a 6 min read.

Scrivener is a desktop and mobile writing app, it provides a powerful and diverse set of tools for writing short or long-form content. It's makers, Literature and Latte, describe it as:

Scrivener is the go-to app for writers of all kinds, used every day by best-selling novelists, screenwriters, non-fiction writers, students, academics, lawyers, journalists, translators and more. Scrivener won't tell you how to write—it simply provides everything you need to start writing and keep writing.

I use Scrivener regularly (primarily on macOS and iOS) and as part of my most recent, masochistic journey to use Linux for everyday computing (is 2022 yet another year of Linux on the desktop?) I had tried and struggled to either find a Linux version or get it running under Wine.

Frustratingly, Scriveners developers used to regularly release a beta Linux build, but it's been long abandoned. Getting even this version running on a new kernel and distro was a difficult experience, and it being a beta of Scrivener 2, it's missing many of the features I'd become used to from Scrivener 3.

As many Linux users will know, these kinds of situations are relatively common and leave us with only one, somewhat dreaded, alternative: Wine. Wine is a fantastic, mature piece of software that allows you to run Windows executables on Linux. It's an incredibly useful tool that is unfortunately very complex to configure, and the resulting configurations are pretty fragile.

But I dove in, based on the rumour that the latest Scrivener Windows builds would only require a small amount of work to configure. In Wine-land we define 'small amount of work' as only three weeks, two animal sacrifices at the altar of Baphomet and a single relapse into alcoholism.

I did eventually get it working. Kind of. There was a lot of trial and error, but eventually the executable would start and would sort of, half-work for a while before crashing. It was a frustrating experience and was very fragile. This was almost certainly due to my ineptitude rather than any fault of the Wine community.

Dear reader, I ended up giving in and going back to the complex hierarchy of Markdown files that those of us who write on Linux know so well. Then I learned about Bottles.

Enter Bottles

Bottles is a project with the aim of making running Windows software on Linux easy. It provides a pretty UI and a set of sane, well-tested configurations to run Windows applications.

The first concept is Windows application-specific environments, it calls them "bottles". These are siloed (even sandboxed) configurations you can build for each Windows application you want to run. This is a powerful idea, as it makes dependency management much simpler than managing your Wine prefixes (in my experience, the main source of Wine “fragility”). It's conceptually similar to Docker, and is useful for the same reasons.

Another great idea in Bottles is that it provides well-tested, mature configurations for running the software. Rather than needing to trial and error and work out exactly which .NET framework you need to install to run a piece of software, Bottles allows you to select one of three options for its environments that work for most applications:

  • Gaming, which is (as you might guess) an environment specifically built for running Windows games on Linux (using Proton and other tools to emulate the windows graphics and audio stack)
  • Software, which is a catch-all name for basically 'any Windows program that isn't a Game'
  • Custom, a way of describing your dependencies for a Bottle and configuring it from scratch, should you wish to

I've used Bottles to run a few Windows applications and the 'Software' environment has worked without configuration every time.

Installing Bottles

Bottles is installable in a few ways, as is everything on Linux, but in my case (running a pretty stock Ubuntu 21.10) I ended up using the Flatpak distribution on Flathub. I've used Flatpak quite a bit to automate the setup of my Linux machines and getting it running is pretty straightforward.

With Flatpak running you just need one command:

$ flatpak install flathub com.usebottles.bottles

This should take a minute or two to install Bottles dependencies and binaries.

Running Bottles and configuring your Scrivener bottle

Bottles can be run a number of ways, and starting it will depend on how you installed it. In my case, having installed it via Flatpak, I start Bottles via the CLI:

$ flatpak run com.usebottles.bottles

Once running, Bottles provides a simple UI for creating a Bottle, but for the sake of completeness I've included a guide for creating a simple 'Software' Bottle:

  1. Open Bottles
  2. Click the '+' icon in the top left of the window
Bottle's environment management and creation screen
Bottle's environment management and creation screen
  1. Choose a name for your Bottle (e.g. Scrivener) and select 'Software' as the environment, click 'Create'
Creating your Scrivener Bottle
Creating your Scrivener Bottle
  1. You'll wait a few minutes for Bottles to download and install the necessary dependencies for your environment
Bottles breating your environment
Bottles breating your environment

Installing and running Scrivener in your bottle

When your bottle is created, you'll need to first 'install' Scrivener into the emulated Windows file system and then run it to use the application.

  1. Download the latest Windows build form Scrivener. I'm using the 64-bit build of 3.1.1. This will download Scriveners Windows .exe installer.
  2. When your Bottle has finished configuring (step 4, above) you'll be presented with a screen like the one below. Click 'Run Executable', navigate to the Windows Installer you just downloaded and select it.
Your bottle configuration
Your bottle configuration
  1. After a few seconds the Windows installer will appear, follow it as normal. When the installer is complete it will close and you'll be returned to the Bottle settings UI.
  2. To run Scrivener, you need to click 'Run Executable' again and this time navigate to the location of the installed Scrivener executable in the emulated Windows filesystem. The location of this file may vary by Linux distribution, but on the latest Ubuntu it's located at: ~/.var/app/com.usebottles.bottles/data/bottles/bottles/{name of your bottle, from Step 3 above}/drive_c/Program Files/Scrivener3/Scrivener.exe
  3. Once selected, Scrivener should start and be fully functional
Scrivener 3.1.1 running on Ubuntu
Scrivener 3.1.1 running on Ubuntu

Notes on saving Scrivener running in a Bottle

The Scrivener version you now have running only has access to the emulated Windows file system inside the Bottle, so that's where it can save files. This is a little annoying to navigate to (see how long the path to the .exe above is) so I symlinked a directory in the Windows filesystem to somewhere more convenient for access, for example:

$ ln -s /.var/app/com.usebottles.bottles/data/bottles/bottles/Scrivener/drive_c/users/Joe8Bit/Documents/ ~/Documents/Scrivener

I've been using the 'Bottled' version of Scrivener for several weeks without any issues. It's fully functional and hasn't got any mysterious bitrot in the way other Wine-based programs I run have.

Related posts