The following guide will instruct you step-by-step how to cross-compile
ScummVM for the Raspberry Pi(3B/3B+/4), using a PC running Ubuntu on
Windows 10. My goal in outlining this process was to have a running
nightly-build version of ScummVM to play The Longest Journey on my RPi. As
a beginner, there were many hurdles to overcome that I wanted to make sure
I had a detailed outline of, and I wanted a learning tool to reinforce
some Linux and Raspberry Pi fundamentals, as well as exploring some
methods to make your Pi and Windows PC cooperate.
If I am going about things incorrectly or in a convoluted way, please correct me at firstname.lastname@example.org, and if you’re following along, proceed at your own risk!
What you’ll need:
I assume if you are interested in doing this project, you have all the components already on-hand. But, at the risk of redundancy, you will need:
- A PC Running Windows 10
- A Raspberry Pi (3B/3B+/4) and the appropriate Power Supply / HDMI Cable / Monitor / Mouse / Keyboard
- an SD card (8gb or larger) that you don’t mind formatting
- A USB SD Card Reader (or any other form of sd card reader)
- The Internet and a way to connect the Pi and PC to your network (WiFi or Cat5 switch/router)
This isn’t 100% required if you already have a copy of RPiOS up and running, but I’m going to outline this process so that we can start from a neutral baseline.
Plug your SD card into your Win10 PC (make sure you don’t mind flashing this SD Card - the following process will permanently delete all the files on the SD Card!)
Download the latest Raspberry Pi Imager from the website here:
Install it and open.
You will be presented with 3 boxes, click the first to select which Operating System you want to install.
We need Raspberry Pi OS (32-bit).
This next step can be risky if you are uncertain what you are doing!
Click the second button to select the SD card. Make sure it is the device you want to flash! Once the flash is started, all data from the SD card will be deleted. If you are unsure, you can unplug and plug back in your SD card from the USB port and watch to see which device is removed / re-added to the list.
(My device shows up as a “Mass Storage USB Device” and I can confirm the file size on the printed label of the SD card -32 GB, is correct with what it is being detected, 31.9 GB)
Click Write to begin flashing a fresh copy of Raspberry Pi OS (32-bit) to your SD card.
This is going to take a while, so either be patient until it is done, or skip to Step 2.
If you skip to step 2, be mindful not to reboot your Windows 10 PC until Raspberry Pi Imager is finished!
As a Linux newbie, I’ve found Ubuntu running inside my Windows 10 PC is
a really neat tool to have. It allows you to perform Linux/Ubuntu
operations without having to go too far from the safe, warm blanket of
To install it, we first need to enable a Windows feature called “Windows Subsystem for Linux”. Type “features” into the Windows search bar, and click the “Turn Windows features on or off” program listing.
Scroll down a bit and click the checkbox next to “Windows Subsystem for Linux”.
Let Windows install this feature, and afterwards it will require restart.
If you skipped ahead from Step 1, Do not restart Windows until your SD Card is done flashing!
Once Windows 10 has rebooted, we need to grab Ubuntu from the Microsoft
Type “store” into the Windows search bar and click the “Microsoft Store” app.
Once the Microsoft Store is open, find the Search bar inside the app and type “ubuntu”.
Click on the Ubuntu entry, making sure to get the standard “Ubuntu” app and not “Ubuntu LTS”.
Now click the Install button.
Once the install is completed, type “ubuntu” in the Windows search bar and open the “Ubuntu” app, it will take a minute to finish installing on its first launch.
Once the Ubuntu terminal opens, it will ask you for a new username and password. Fill out that information accordingly, and remember that we will need it in the future.
Once complete, and you will see the Ubuntu bash prompt.
We now have a little pocket of Linux/Ubuntu running inside Windows 10! This is where we will cross-compile our ScummVm code.
Now that our SD card is finished, plug it into your Pi, and turn on your
Eventually, you will be greeted with the Raspberry Pi Desktop welcome screen.
Click Next to get started.
Choose your country, language and timezone accordingly and click Next.
We now need to set a new password. (For convenience sake, you can make it the same as what you set for Ubuntu for Win10). When done, click next.
The next window is going to adjust the Pi’s video settings if you have black bars around your screen. If you see black borders, make sure you check the box and click next.
If you are connecting to your network/internet over Wifi, the next screens will have you choose your WiFi network and enter your WiFi Password. If you are connected over ethernet cable, you can skip this step.
Now that your Pi has internet access, we want to allow it to update. Click Next to start the process.
This update process is going to take a while.
While we are waiting, let’s take a minute to go back to Windows PC and download a couple programs we are going to need.
Download VNC Viewer and Filezilla FTP here:
Once downloaded, install both programs onto your Win10 PC. Why did we get these programs? We are going to need a way to transfer files between our Pi and Windows 10. One convenient way is enabling SSH, which will allow us to SFTP into the Pi. If you are unfamiliar with SFTP or FTP, it is simply a way for files to be transferred over a computer network. We will need an FTP client like FileZilla on our Win10 machine to transfer files over SFTP.
Another useful feature to enable VNC. VNC is similar to remote desktop, and will allow us to see our Raspberry Pi desktop on our Win10 PC, as well as control our Pi with our Win10 mouse and keyboard. The program VNC Viewer on our Win10 PC will let us facilitate this.
Before we can use these features, we need to configure Raspberry Pi OS to accept SSH and VNC connections. We can turn on these functions with a couple checkboxes in the Raspberry Pi OS configuration menu.
Head back to your Raspberry PI, and allow it to reboot once the update process we started in Step 3 is complete.
Once your Pi boots up, click the Pi icon in the top left, navigate to
Preferences, and click “Raspberry Pi Configuration”. Once in the
Configuration window, go to the “Interfaces” tab, and check the
corresponding boxes to enable SSH and VNC.
To connect our Win10 PC to the Pi over these protocols, you will need to know the Pi’s IP Address. To find the IP address, mouse over the wifi connection icon in the top right:
For mine, the IP address is the bottom under wlan0: Configured “192.168.1.9”. We can ignore the numbers after the forward slash.
Now that SSH and VNC are enabled, we can head back to our Win10 PC and
set up VNC Viewer and Filezilla to connect to our Pi.
To start, open VNC Viewer.
Click File - New Connection:
Under the VNC Server field, enter the IP address we copied down from our Pi. Also, fill out the Name as anything you’d like (I named mine RPi 3B+). Don’t worry about the other fields, click OK.
On the main VNC Window, double click your new connection entry. It will open a dialog box. On your first run, it may perform an ‘Identity Check’ and make sure you want to connect to a new device. Click “Continue” to connect. It will now ask you to enter a username and password.
The default username for our Raspberry Pi OS install is “pi”.
Enter “pi” for the username, and enter the password you set on the initial setup of RPi OS.
Also check “Remember password” if you do not want to enter it every time (we will be coming back to this a couple times in this guide).
We should now have a VNC Viewer window that mirrors our RPi desktop. Take a minute to see how seamlessly your keyboard and mouse inputs flow from your Win10 PC to the RPi.
Now open Filezilla on our Win10 PC.
Filezilla is the FTP client we will use for moving files back and forth between the RPi and our Win10 PC.
A brief overview - The left panel of the screen represents files on our Win10 PC, and, once it is connected, the right panel of the screen will be the files on our Raspberry Pi. The PC we are running Filezilla is referred to as the “Local Site”, and the device or location we connect to is referred to as the “Remote Site”.
To connect to the RPi, click File - Site Manager:
Click the “New Site” button and type in a name (I named mine “RPi 3B+”). Now we need to set the following options:
Password: Enter the password you created for your RPi on initialization.
You should now see your Raspberry Pi file system on the right tab.
Be careful not to accidentally delete or move anything here as it may break your RaspberryPi OS install!
We now have remote VNC access to our Pi to remote control the desktop and terminal, and Filezilla to FTP files back and forth. We also have Ubuntu for Win10 running on our Win10 PC. With our tools laid out and tested, we should be ready to get to work.
From this point on, this guide is an echo of the official ScummVM/RPi wiki, found here:
I worked through this guide, with the help of the author and the dwellers of the ScummVM Discord server. These folks are a lot more versed in the technical knowledge behind the process, and this guide should be taken as one guy’s attempt to work through the steps, and not definitive. There were however specific steps I had to take outside the scope and direction of the wiki that I’d like to document.
Use the open VNC window to start the terminal on our RPi’s desktop. We can do so by clicking the icon found at the top of the menu bar.
This is where we are going to be doing a bit of work. Note that in this guide, any text that is intended to be copied exactly into a terminal will be formatted with a dotted surrounding frame, for example:
If we typed that command and pressed enter, it would return a list of folders in our RPi’s home directory:
Note that you can copy the highlighted console commands from this document with CTRL-C, and paste into the RPi console with CTRL-SHIFT-V.
What we need to do now is gather the headers and libraries on our RPi that are required to build our ScummVM binary. Without getting into the weeds of programming jargon, these are bits of code and programs that ScummVM depends on to compile and work with the RPi. From here on I’m going to generically call them ‘dependencies’.
To do this, we need to use apt-get. Apt-get is a command to pull program files from a server and install them onto our Pi. We need to run
This will allow us to get the latest versions of our dependencies. Following the wiki, we need to get the following dependencies - note that copying and pasting this block of text will instruct your Pi to install the entire list:
This process will take a few moments. Once we are done, we are ready to copy over our dependencies contained in folders on our RPi, to our Win10 PC.
Before we copy our files over, we should make a quick pit stop over to
our Ubuntu terminal.
Windows automatically makes our Windows 10 hard drive(s) accessible to Ubuntu, but we want to check. Run:
The terminal will show you which drive letters are available inside Ubuntu, highlighted in green. I’m going to keep things simple and choose c, and create a directory to bring our dependencies over to. Be mindful that everything in Ubuntu / Linux is case-sensitive, and we need to respect that our mounted drives are lowercase letters. Let’s go to c and make a directory called “rpifiles”:
We can then check with
We should also be able to see this from our normal Windows File Explorer:
As per the wiki, we need to copy over three directories from our RPi root. (The root simply means the lowest level in the file system). Those directories are /usr, /lib and /opt. We want to copy those RPi directories into the Win10/Ubuntu c:\rpifles (or /mnt/c/rpifiles) directory we just made.
To do this, head over to Filezilla. We should still be connected to our Pi from before, but if not, click File - Site Manager, and connect to the site we previously established in Part 4. If you look to the column on the right, we should be in the default directory “/home/pi”. Click the “/” directly under the text “Remote Site” to select the root directory. It should look similar to this:
On the left column, navigate to our recently created “c:/rpifiles” folder.
Now we want to click and drag our folders from the right column (RPi) into our left column (Win10). Click and drag /usr, /lib and /opt to copy them over to our Windows 10 PC.
This is going to take a long time.
Keep an eye on the transfer, because at some point, you may encounter the dialog box “target file already exists”.
I choose the Action, “Overwrite if source is newer”, and check the box “apply to current queue only”, then click OK.
Note: I need to look into why this is happening. So far it has not had any negative effect.
While Filezilla is working to copy our files, we can begin to configure
Ubuntu on Win10 to prepare for compiling.
As instructed in the wiki, we need to get a copy of the Raspberry Pi tools, which has the cross-compiler we need. First, let’s make sure we are back to our home directory. Run the command from our Ubuntu on Win10 terminal:
For good measure.
The “cd ~” command takes you back to your /home/(user) directory, and “pwd” will show you the full path of your current location. If you look at the prompt, notice the ~$.
In Linux environments, the ~ (tilde) symbol means you are in your home directory, or put another way, the directory that belongs to your current user. We will be moving around a bit in the directories, so keep the above commands in your pocket to get back to “home” when required.
Also as a tip, you can paste into the Ubuntu terminal on Win10 with your mouse right-click.
Now we can run
This will make a copy of the Raspberry Pi Tools from the official RPi github. When complete, we should be able to run:
We now have a new tools directory in our home/”user” folder. Note that my “user” is going to read as “patrick”, but yours is going to be whatever username you set up when you initialized Ubuntu.
Following the wiki, we now need to make it possible to run the cross-compiler binaries from our ScummVM building directory. We do this by adding them to the PATH environment variable. Put simply, directories or files added to PATH can be run from any directory location in our Ubuntu terminal. To do so, run the following command:
Concerning HOME: This is a bit of a tangent, but note that when we reference $HOME in the above command, it refers to the "/home/(username)" folder. This can be seen if we run:
Look at the first line, “declare -x HOME="/home/(username)".
This is the bit of automatic configuration on our terminal that allows us
to use HOME interchangeably with our home directory. So in my case, the
directory we are adding to our PATH environment variable would be
One of Export’s functions is to make specific folders into generic names we can call. As a reminder, if you close the Ubuntu terminal, your export declarations will need to be reapplied.
Following the wiki, we now need to create a folder to house our copied RPi files and folders. The wiki suggests /opt/rpi_root. /opt is typically a folder used for optional add-on packages, so it is a good fit for us.
As referenced in Step 6, mkdir is the command to create directories in most linux os’s. The -p flag tells mkdir to create the parent directory if none exists.
This is going to return a “Permission denied” error.
Because we are attempting to create a folder outside of our home directory (where our user account has full read/write permissions), we need to use sudo to elevate our security privileges to execute this command. Let’s try it again with sudo:
It will then prompt you for your password. Enter your password to create this folder.
We can check with the command:
Which will return the contents of the /opt folder.
We now need to set:
So we can refer to this directory as RPI_ROOT generically. This is important as many calls made later on in the process are going to reference this folder as such.
Now to bring the three folders and files we coped into our c:\rpifiles (or /mnt/c/rpifiles) into our newly created /opt/pi_root folder. We are making a copy because we will be altering these files, and it is good to have a “clean” copy as a backup. If placed them in the folder we decided in Step 7, you would navigate to /mnt/c/rpifiles:
Then, we will use the cp command to copy the usr, lib and opt folders into our RPI_ROOT folder.
This will take a bit of time. As a note, a “-R” flag tells cp to copy
not just the files within the directory, but also the folders (and files
within those folders), all the way down the line. This is called a
recursive copy, hence “-R”.
Because we have copied files from our Pi into our Ubuntu folder, many of the paths and links referenced inside the files no longer make sense in our current environment. Basically, because we moved the folders and files, they no longer “point” to the right places. The wiki has thankfully sourced a Python script to correct for this. We can download it into our home folder with a couple commands:
We now need to use chmod to make our recently downloaded script ‘executable’. This means the file is given permission on our system to ‘run’. We can do that with the +x flag:
Now, to run it:
Note: I’m not sure if sudo is required here or not...I also need to get clarification on the $(which python3) command) to make sense of why we are handling it that way.
We have one more export command to run, to add $RPI_ROOT to our PATH environment variables. According to the wiki, this is required for proper detection of the libcurl related files by ScummVM's configure script.
Before we get to compiling, we should update our Ubuntu:
Once Ubuntu is updated, we will also need the utilities make, pkg-config, and build-essential. Let’s get them now.
We are now ready to get the SummVM latest source code. We can do so by cloning over the ScummVM Github files. We want to clone the files in our home folder:
Now we need to make a folder inside our ScummVM called “scummvmDist” (again, be mindful of the capitalisation). This will be where the final binary and ScummVM required files will be compiled to.
As explained in the wiki, we need to configure the ScummVM build system. The following command will specify, among other things, that we are building for Raspberry Pi, and will direct the configuration to our Raspberry Pi local sysroot folder (the folder containing the Raspberry Pi dependencies we copied over).
Now, we can run three build commands from our Scummvm directory:
The make clean option will allow us to start fresh and remove any remnants of previous attempts at compiling. This is just to be safe if this isn’t your first attempt at a compile in this tutorial.
This will instruct make to build our ScummVM with as many cores as the command nproc detects on your system.
Finally, make install will copy the built program, and its libraries and
documentation to the correct locations.
Congratulations, you have successfully compiled ScummVM! But our work isn’t entirely over yet. If we navigate to our ~/scummvm/scummvmDist folder, we see that the compiling process has created the folders /bin and /share.
Inside the /bin folder is the scummvm binary file, simply called scummvm. This is what will be run to finally play ScummVM. Inside /share, we find a collection of folders and files that ScummVM packages with, and one folder deeper, inside /share/scummvm, are the files the binary relies on to operate correctly. For our ScummVm build to work, we need to copy the binary file "scummvm" from /bin to /share/scummvm. Let’s do that now:
We now have all the files we need in our ~/scummvm/ScummvmDist/share folder. To use the software, we need to get that folder onto our Raspberry Pi. The first step to achieve this is to first copy the ~/scummvm/ScummvmDist/share folder into our /mnt/c/rpifiles folder, let’s do that now:
To verify, let’s look at the contents of /mnt/c/rpifiles:
Now, we can use Filezilla to copy over the C:/rpifiles/share directory onto our Pi. If we navigate the left pane to c:/rpifiles, and connect to the Pi via SFTP again (as outlined in Step 7). Now simply drag and drop the share folder over. I chose /home/pi as the location for the share folder on the Pi.
It should only take a moment to copy. When it is complete, let’s use FileZilla to rename share to "scummvm" on our Raspberry Pi for clarity’s sake. To do so, right-click on the share folder, click rename, and then type in the new name for the folder, “scummvm”.
Let’s hop back on our RPi using VNC Viewer (as outlined in Step 5). We've been working almost exclusively in the terminal for a while, let's change things up and use the Raspberry Pi OS Gui to finish out our tasks.
Open the Raspberry Pi OS’s file explorer by clicking on the task bar’s folder icon:
If we navigate to the /home/pi directory, we should have easy access to the scummvm folder.
Let’s navigate to /home/pi/scummvm/scummvm and try to run the file scummvm.
You’ll be greeted with a dialog box asking how you want to open the file.
This is because the Raspberry Pi OS does not know that “scummvm” is an executable program file. Let’s open the RPi’s terminal to correct this. Open the terminal, and navigate to the folder in question:
Now using a command we learned in Step 8, let’s use chmod +X to tell Raspberry Pi OS that we want to treat this file as an executable.
Now we should be able to run ScummVM! Either type “scummvm” in the console and press enter, or use the file explorer to locate and double click on the program again. It should now launch the application.
Huzzah! Now, we need a game to test.
As I mentioned at the top of the guide, I wanted to run The Longest Journey. If you have a copy on Steam like me, you can FTP your steam\steamapps\common\The Longest Journey folder to your Raspberry Pi, using FileZilla. (See Steps 5 and 7 for more on FileZilla). I’d recommend placing it inside your /home/scummvm folder for easy access, but anywhere on your RPi’s SD Card should do. Once you have a game copied on to the Pi, we can use "Add Game…" to point ScummVM to the folder and finally add the game. Now that our game is added, let’s try running The Longest Journey:
Bah! An Error! No worries, though, I have discovered the solution.
Using advice found on this error thread:
we need to move some files around and create a folder in our /home/pi/scummvm/scummvm directory. I suspect this issue will be resolved in the future, but for now we have a simple workaround.
To correct the “could not open shader” issue when running The Longest Journey, we need to make an "engines/stark/shaders" directory inside the scummvm directory. Let’s use the RPi OS’s file manager program to do this.
Right click inside your /home/pi/scummvm/scummvm folder, and select New Folder...
Type “engines” and click ok. Double-click the engines folder and likewise create a “stark” folder. Once again inside the stark folder, create a “shaders” folder.
Now we should have a directory that looks like this:
If we navigate back to /home/pi/scummvm/scummvm, we will find a folder called shaders. We need to locate the shader files starting with the word “stark”.
We need to select these files. To do so, hold CTRL and click each file individually to highlight them all. Now, press CTRL-C to copy. Navigate back to the engines/stark/shaders and press CTRL-V to paste the files into the folder.
Now we are ready to actually play the game! Head back to /home/pi/scummvm/scummvm and run the scummvm executable file. Double click on The Longest Journey, and the game will now launch.
There is one last non-critical font error that is explained here:
From the ResidualVM Github page, “Steam version and demo from Steam are missing the fonts directory. The required fonts can be copied over from demo version obtained from different sources or a GOG or retail version.”
If using generic fonts bothers you, you can source the required /fonts folder from The Longest Journey Demo hosted here:
For our purposes, we can click past the error and finally get into the game!
Hopefully you found this tutorial helpful. If you have any comments or questions, feel free to hit me up on Facebook @ www.facebook.com/oldkidgaming, or @ email@example.com