Contents

A Comprehensive Guide to Installing SuperMemo in Linux (4 Ways)

Abstract
4 ways fall into 2 categories: wine-based or VM(virtual machine)-based. I’ve successfully installed SuperMemo based on Alessivs’s Lutris script, but currently using VirtualBox to run SuperMemo since I desperately need to use my SuperMemoVim.

./images/screenshot-2022-01-16-18-07-35.png

Introduction

If you take the Wine-based route:

  1. Lutris’s one-click installation by Alessivs

  2. Alessivs’s supermemo-wine

If you take the VM route:

  1. VirtualBox <– This is what I currently use

  2. VMware Workstation 16 Player

  3. WinApps for Linux

  4. qemu/kvm/virt-manager

Honorable mention:

  1. PlayOnLinux: doesn’t work for me

  2. $60 Crossover: doesn’t work for me

According to ease of installation: Lutris > VirtualBox > supermemo-wine > qemu-kvm

Note
Since you’re using Linux, I assume you know your way around a computer. This “comprehensive guide” won’t be a step-by-step tutorial. My aim is to share and introduce to you different ways to use SuperMemo in Linux, and hopefully you’d find the one you need.

Wine-based route

1. Lutris’s one-click installation by Alessivs

“Lutris is an Open Source gaming platform for Linux. It installs and launches games so you can start playing without the hassle of setting up your games.”

After installing Lutris on your Linux system, go to supermemo-18, click the Install button and hope for the best:

./images/screenshot-2021-11-18-03-10-05.png

If the above Lutris solution doesn’t work, you’ll have to investigate and debug. This is what happened to me. The installation was successful but the following error occurred when launching SuperMemo:

./images/screenshot-2021-11-16-20-35-00.png

After talking to Alessivs, these error messages happen:

Quote

when SuperMemo can’t load the mshtml component to display HTML components. Possible causes:

  • Internet Explorer was not installed

  • Internet Explorer was installed in a different prefix (by user mistake)

  • The IE8-provided mshtml.dll was not marked as “native” in the prefix’s Wine configuration.

According to supermemopedia doc, the very likely culprit is Internet Explorer 8. The Element windows in SuperMemo are Internet Explorer under the hood. Regardless of what “gaming wrapper” you use, i.e., Lutris, PlayOnLinux, or Proton, it needs to have a SuperMemo-compatible IE version. If you click the Element windows and there’s no response, or the above error pops up, it’s a problem with the IE under Wine.

Another cause of issue is your Wine version. The Wine version that comes with lutris-6.21-6-x86_64 works for me.

If you encounter other errors, your best resource is SuperMemo for Windows under Wine.

2. Lutris script that works for me

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# Source: alessivs/supermemo-wine.
# Modified by MasterHowToLearn.
# Edit with care.

name: SuperMemo 18
game_slug: supermemo-18
version: Stable
slug: supermemo-18-stable
runner: wine
year: 2019
description: 'Unofficial installer for SuperMemo for Windows under Wine - Stable edition.'
notes: |
    Note: Audio works best with 32-bit gstreamer libraries present in the system.

script:
  game:
    arch: win32
    exe: $GAMEDIR/prefix/drive_c/SuperMemo/sm18.exe
    prefix: $GAMEDIR/prefix
    working_dir: $GAMEDIR/prefix/drive_c/SuperMemo
  files:
    - setup: https://supermemo.org/install/sm18inst.exe
    - nircmd: https://www.nirsoft.net/utils/nircmd.zip
  installer:
    ##* Prefix creation
    - task:
        arch: win32
        install_gecko: false
        install_mono: false
        name: create_prefix
        prefix: $GAMEDIR/prefix

    ##* Required Winetricks verbs
    # SuperMemo cannot run without: ie8, winxp.
    #
    # Improvements:
    # - msxml3 (IE XML processing)
    # - riched20 (RTF component support)
    # - gdiplus (improved performance with HTML-embedded graphics)
    # - fontsmooth (readability)
    # - corefonts (default CSS uses Arial and Times New Roman; UI hard-codes Arial in some places)
    # - tahoma (classic UI uses Tahoma by default)
    # - quartz (prevents audio glitches in most configurations)
    #
    # winxp is applied every time the previous verb restores the
    # Winetricks-default version of Windows, which is Windows 7.
    - task:
        arch: win32
        name: winetricks
        app: ie8 winxp riched20 msxml3 gdiplus fontsmooth=rgb corefonts tahoma quartz cmd winxp
        description: Downloading and installing system requirements. Be patient.
        prefix: $GAMEDIR/prefix
    # Preparation
    - task:
        arch: win32
        name: set_regedit
        path: HKEY_LOCAL_MACHINE\System\WPA\PosReady
        key: Installed
        value: '00000001'
        type: REG_DWORD

    ##* Nirsoft NirCmd
    # Provides easy scripting access for a number of Windows APIs. Used by
    # external tools.
    - extract:
        file: nircmd
        dst: $CACHE/nircmd/
    - copy:
        src: $CACHE/nircmd/nircmdc.exe
        dst: $GAMEDIR/prefix/drive_c/windows/

    ##* README files
    - copy:
        src: setup
        dst: $GAMEDIR/updater
    - write_file:
        file: $GAMEDIR/README.txt
        content: |
          This is the installation folder for SuperMemo 18 under Wine, produced by the SM4Wine installers for Lutris.

          Quick guide to this folder
          --------------------------

          * The ./prefix folder hosts the Wine prefix.
          * ./prefix/drive_c is the equivalent of the C:\ drive under Windows.
          * Folders besides the prefix folder may host ancillary content. To know about their purpose, look for any README-style files.
          * Any executables herein may need Lutris (or another tool) to set up the correct execution environment, and may not work as expected if run independently (e.g. from the file manager).          
    - write_file:
        file: $GAMEDIR/updater/HOW-TO-UPDATE.txt
        content: |
          Update SuperMemo 18 to a newer version
          --------------------------------------

          Follow these steps to update SuperMemo to the next version within a major release:

            1. Close SuperMemo.
            2. Start Lutris and select the game entry.
            3. Choose “Run EXE inside Wine prefix” from the context menu, or from the side bar (if visible).
            4. Point the file chooser to sm18inst.exe, in this directory, and accept.
            5. Choose (x) Update, and click Next.
            6. Tick [x] “Do not create the Start menu folder”, and click Next.
            7. Click Install.
            8. Untick [ ] “Run SuperMemo 18”, and click Finish.          
    - write_file:
        file: $GAMEDIR/README.update.txt
        content: |
                    To update your SuperMemo installation, read ./updater/HOW-TO-UPDATE.txt

    ##* SuperMemo 18 installer
    - task:
        arch: win32
        args: /S
        description: Downloading and installing SuperMemo 18. This may take a few minutes.
        executable: setup
        name: wineexec
        prefix: $GAMEDIR/prefix
  wine:
    Desktop: true
    version: lutris-6.21-6-x86_64
    dxvk: false
    mscoree: disabled
    winemenubuilder: disabled
    mshtml: n

The above modified script from Alessivs is finally what worked for me. I recommend using the above lutris installer first. If that doesn’t work, then you may try this script.

Copy and paste the above code to a file. Name the file sm18-stable.yaml. To run it, go to the directory where the sm18-stable.yaml resides. Open a terminal and execute lutris -i ./sm18-stable.yaml:

./images/screenshot-2022-01-18-10-11-34.png

Then wait for it to finish while we pray. If everything goes well, you should see this dialogue:

./images/screenshot-2022-01-18-10-19-06.png

Clicking Launch:

./images/screenshot-2022-01-18-10-19-14.png

Try going through a few repetitions to see if any error dialogue pops up. If not, congratulations you have a working SuperMemo!

The reason for the black background is due to a Lutris’s setting. To disable it:

  1. Open lutris
  2. Under Games, right-click on SuperMemo, choose Configure
  3. Go to Runner options
  4. Disable Windowed (virtual desktop)
  5. Save

./images/screenshot-2022-01-18-10-23-30.png

3. Alessivs’s supermemo-wine

supermemo-wine is yet another Alessivs’s work. It installs SuperMemo without the Lutris helper and instead, using only winetricks. I tried this solution early on but the Error showing component 1 object Invalid floating point operation error occurred. Again, it’s the IE8 problem. According to the discussion in supermemopedia:

Quote
The secondary problem I encountered was, interestingly, due to wine-gecko being installed. After removing wine-gecko, ie8 would install, and I could have an acceptably working SuperMemo once again.

You could try this tip provided by James to see if SuperMemo works.

4. PlayOnLinux’s IE doesn’t work

I’ve tried installing SuperMemo through PlayOnLinux (POL):

./images/screenshot-2021-11-18-02-23-07.png

The IE available in POL are Gecko, which is Wine’s own implementation of IE. This version is not SuperMemo-compatible:

./images/screenshot-2021-11-17-21-12-58.png

From SuperMemo_for_Windows_under_Wine#Tips:

Quote

PlayOnLinux (4 and below) have outdated Internet Explorer install recipes (Internet Explorer being an important dependency)

PlayOnLinux 5 is in development and not yet stable

Virtual-machine route

1. VirtualBox

Info
Updated on 2022-03-24

This is my current solution: using SuperMemo and Balabolka inside VirtualBox. There are some advantages when using VirtualBox over other VM solutions.

1. Customizability

The ability to disable “auto capture keyboard”. I use i3 on my host machine. This means that when I’m inside the VM, and press Super (Win) key, it’ll be captured by the host machine instead of the guest OS. In other words, pressing Super (Win) inside VM is no difference than doing it in my host machine. I can just press Super+Return to bring up my host terminal next to the VM. For VMware, I need to first press host+Key to escape out of the VM capturing mode, and press, say Super+1 to switch workspace. In this regard, VirtualBox significantly reduces the friction when switching between the host and the guest.

2. Stability

After trying all the solutions mentioned in this article, VirtualBox offers the best stability. WinApps for Linux is still not fit for daily driver (probably because of my tiling window manager); and very disappointingly, I had random freezing issues in VMware; qemu-kvm (with Looking Glass and GPU passthrough) is a very hacky solution and thus many bugs.

2. VMware Workstation 16 Player

Given what I read online, VMware supposedly provides better performance than VirtualBox. However, this is not the case for me (at least no discernable difference), and the random freezes is unbearable. I simply stick to VirtualBox.

3. WinApps for Linux

Initially I opted for WinApps for Linux for better integration with the host Linux machine, since WinApps allows switching between SuperMemo and other Linux apps easily. Looking at the “How It Works”:

Quote

WinApps was created as an easy, one command way to include apps running inside a VM (or on any RDP server) directly into GNOME as if they were native applications. WinApps works by:

  1. Running a Windows RDP server in a background VM container
  2. Checking the RDP server for installed applications such as Microsoft Office
  3. If those programs are installed, it creates shortcuts leveraging FreeRDP for both the CLI and the GNOME tray

To install WinApps, follow this excellent winapps#installation.

My experience with WinApps

My experience with WinApps was rather unpleasant. There are issues with WinApps:

Sometimes I’d get a black screen (FreeRDP bug) and have to restart my laptop:

./images/screenshot-2022-01-18-10-52-14.png

Sometimes I can’t move the windows inside the VM (maybe resolution issue), or I can’t escape out of the VM:

./images/screenshot-2021-11-17-20-50-16.png

It’s almost impossible to use SuperMemo with a tiling window manager:

./images/screenshot-2021-11-17-20-53-57.png

./images/screenshot-2021-11-19-05-54-41-2.png

I understand that SuperMemo is never meant to be used with a tiling window manager, so I’ve set up an entire workspace to be opened in floating windows. AFAIK, there are many smaller windows that SuperMemo spawns, creating empty windows like below:

./images/screenshot-2022-01-18-11-04-35.png

The window should be the Knowledge Tree, but it’s not shown properly:

./images/screenshot-2022-01-18-11-05-57.png

4. qemu/kvm/virt-manager

./images/screenshot-2022-01-12-12-54-05.png

qemu/kvm provides the best performance. It gives almost bare metal performance if you configure GPU passthrough and do some performance tuning. However, I don’t need the best performance because I’m not using the VM for gaming. And VirtualBox provides good enough performance for me. I value customizability and stability way over performance.

Is using a virtual machine right for you?

Using a virtual machine is guarantee to make SuperMemo work, because SuperMemo is running in its native Windows glory: with the native Windows IE (not through Wine). Everything is Windows as far as SuperMemo is concerned.

With a Windows VM, I can replicate the exact workflow I had with my previous Windows setup. Not only SuperMemo will work perfectly, other auxiliary tools such as Microsoft Edge’s Read Aloud that I depend upon will also work.

I installed Windows 10 on my VM. Having it running in the background takes up roughly 3.8GB RAM. If your computer spec is not powerful enough (less than 8GB RAM), I’d not recommend this VM route.

Spinning up an entire virtual machine just to use SuperMemo and SuperMemoVim may seem excessive and even wasteful. However, my particular workflow depends heavily on AutoHotkey. I need to use my SuperMemoVim, as I’m so used to editing text and controling SuperMemo with Vim keybinding. Also, I have a balabolka ahk script to navigate between SuperMemo and Balabolka.

However, if you don’t need to have Vim-like navigation, then the Lutris solution above offers a great alternative. It saves a lot of system resources and laptop battery.

If you go for this VM-based route, I’d recommend VirtualBox. Please remember to create snapshots to back up your VM often:

./images/screenshot-2022-01-12-10-08-31.png

Conclusion

I’ve tried many, many solutions to make SuperMemo work in Linux. The process was a frustrating experience beyond imagination. However, it’s not SuperMemo’s fault since it’s never meant to be run in Linux.

If you don’t need to use SuperMemoVim, the Wine-based lutris solution is excellent. If you are like me who want to have the exact same Windows workflow, use VirtualBox. If you’re tech-savvy enough, use qemu-kvm with GPU passthrough. Regardless, if you’re using Linux and want to make SuperMemo work, expect minor trouble before you can make it work.

If you have any questions, feel free to email me and I’m more than happy to help.