ServiceNow MID Server on a Raspberry Pi 5 (arm64)
There are some folks who have provided great resources and guidance on how to install and configure a MID server from various ServiceNow versions on various Raspberry Pi models. This is largely an update of the work they have done for a Pi 5 and a Zurich MID.
Steps
- Get a Raspberry Pi. I went through these steps on a Raspberry Pi 5 with 8 GB RAM and an SSD, running Raspberry Pi OS (64-bit), which is based on Debian 12 (Bookworm). CanaKit has some good options.
- Consider setting up a firewall (such as ufw) on your Pi to restrict inbound traffic.
- Set up your user in ServiceNow. Create a user, set a password, and assign the
mid_serverrole. - Login to your Pi. If you’re not already in a terminal session, open one.
- Verify your OS and architecture.
cat /etc/os-release
uname -mFor me, this is:
VERSION_CODENAME=bookworm
aarch64 (ARM64)- Install Java 17. This can run alongside a later version of Java. Later versions cause SecurityManager issues with the MID. Don't update the system default
javaunless you want to screw up your Minecraft server. Run:
sudo apt-get update && sudo apt-get install openjdk-17-jre-headless- Confirm the Java 17 path is as expected.
ls /usr/lib/jvm/ | grep 17You should see Java 17 directories listed.
- Create a dedicated system user to run the MID server service. The command below creates the directory path
/opt/servicenowand sets it as the home directory path for the new user. It also prevents interactive login.
sudo useradd -r -m -d /opt/servicenow -s /usr/sbin/nologin sn_mid- Because ServiceNow no longer provides wrapper files for ARM64 architecture, you'll need to retrieve a “donor” MID zip file that includes the wrapper files for ARM64. These were still provided as of Vancouver. Create directories for both the donor and the MID to be installed and assign ownership to the MID user.
sudo mkdir -p /opt/servicenow/{mid,donor}
sudo chown -R sn_mid:sn_mid /opt/servicenow- Switch to the new
sn_miduser and retrieve the donor MID zip file.
sudo -u sn_mid bash
cd /opt/servicenow/donor
wget "<put the link to your mid zip here>"
unzip mid.*.linux.x86-64.zip- Confirm that the donor files include the required wrapper. You're looking for something like
wrapper-linux-arm-64.
ls /opt/servicenow/donor/agent/bin | grep 'linux-arm-64'- Switch to the MID installation directory. Retrieve and unzip the current MID Server zip using the link from your ServiceNow instance (MID Server > Downloads). You'll probably need to scroll to the bottom of the page and check the checkbox for the link to appear.
cd /opt/servicenow/mid
wget "<put the link to your mid zip here>"
unzip mid.*.linux.x86-64.zip- Since we're not updating the system
javato Java 17, pin the MID to Java 17. Since we didn't set a password forsn_mid, exit fromsn_mid.
exit
sudo nano /opt/servicenow/mid/agent/conf/wrapper-override.conf- Uncomment the
wrapper.java.commandline and set it to the path for Java 17. You validated this above, so tweak this if needed from what I have here. Update your JVM heap size while you're here if you want (wrapper.java.maxmemory).
wrapper.java.command=/usr/lib/jvm/java-17-openjdk-arm64/bin/java- Save
wrapper-override.confand edit the JVM architecture configuration, updatingset.SNC_JVM_ARCH.
sudo nano /opt/servicenow/mid/agent/conf/wrapper-jvm.confset.SNC_JVM_ARCH=aarch64- Save
wrapper-jvm.confand exit. Switch to the MID user again.
sudo -u sn_mid bash- Copy the ARM64 wrapper binary from the donor MID to the current MID.
cp /opt/servicenow/donor/agent/bin/wrapper-linux-arm-64 \
/opt/servicenow/mid/agent/bin/- Create the expected wrapper symlink for the current architecture and switch back from
mid_user.
cd /opt/servicenow/mid/agent/bin
ln -sf wrapper-linux-arm-64 wrapper-linux-$(uname -m)-64
exit- Copy the donor’s
wrapper.jarto the current MID so it matches the version of the native wrapper executable.
sudo cp -a /opt/servicenow/donor/agent/lib/java-service-wrapper.jar \
/opt/servicenow/mid/agent/lib/java-service-wrapper.jar- Copy the donor’s ARM wrapper native libraries into the current MID
liblocations.
sudo cp -a /opt/servicenow/donor/agent/lib/libwrapper* \
/opt/servicenow/mid/agent/lib/ 2>/dev/null || true
sudo mkdir -p /opt/servicenow/mid/agent/lib/aarch64
sudo cp -a /opt/servicenow/donor/agent/lib/aarch64/libwrapper* \
/opt/servicenow/mid/agent/lib/aarch64/ 2>/dev/null || true- Ensure ownership is
sn_mid(installer locked the tree).
sudo chown -R sn_mid:sn_mid /opt/servicenow/mid/agent/lib- Verify the required native library now exists where it should.
sudo find /opt/servicenow/mid/agent/lib -maxdepth 2 -type f -name 'libwrapper-linux-arm-64.so' -o -name 'libwrapper.so'- There's a problem file that gets created when the MID service starts that needs to be addressed. The comments on Jon Ulrich's article talk more about this. It may be related to a binary with a filename that's lengthier than allowed.
Add a script to delete this file before the service starts.
sudo nano /opt/servicenow/mid/clean-nonprintable.sh- Populate and save the script.
#!/bin/bash
python3 - <<'PY'
import os, string
root="/opt/servicenow/mid/agent"
allowed=set(string.ascii_letters + string.digits + " ._-@+,:()[]{}")
for name in os.listdir(root):
path=os.path.join(root, name)
if os.path.isfile(path):
if any(ch not in allowed for ch in name):
try:
os.remove(path)
except Exception:
pass
PY
exit 0- Make the script executable.
sudo chmod +x /opt/servicenow/mid/clean-nonprintable.sh- Run the MID installer. Be sure when answering the questions to have the service run as
sn_mid.
sudo /opt/servicenow/mid/agent/installer.sh- Configure the service to run the cleanup script prior to starting. Replace
mid01with your actual service name.
sudo systemctl edit mid01.serviceAdd and save:
[Service]
UMask=0022
ExecStartPre=/opt/servicenow/mid/clean-nonprintable.sh- Reload with your new configuration and restart the service. Replace
mid01with your actual service name.
sudo systemctl daemon-reload
sudo systemctl restart mid01.service- Verify the service and logs. Replace
mid01with your actual service name.
sudo systemctl status mid01.service --no-pager -l
sudo tail -n 120 /opt/servicenow/mid/agent/logs/wrapper.log
sudo tail -n 200 /opt/servicenow/mid/agent/logs/agent0.log.0- Validate your MID in ServiceNow!
Credits, References, and Links
Mid server on raspberry pi
The essential guide to getting a mid server on a raspberry pi Recently I attempted to get a mid server running on my raspberry pi and could find no clear instructions. Here is what I did to get it working on a Pi 3 model B running respian jessie light, hopefully it can help you out in your efforts.…

See comments by tblevins, kristymerri, and lewismac (with a Vancouver MID link).
Install Script for ARM64 MID Server on Washington DC (Ubuntu)
Hi all, The attached Bash script installs a Washington DC MID Server on ARM64 Ubuntu. This may be useful for you if you virtualize Ubuntu on Apple Silicon, for example. It asks for User Input - Either an existing Config.xml file location , or Instance Name, MID Name and the MID Username & PW - a…

MID Server Java runtime - Information on Bundled and Compatible versions, Upgrading or Replacing - Support and Troubleshooting - Now Support Portal
Until Kingston, MID Servers were bundled with Oracle’s build of the Java Runtime Environment (JRE). Since Madrid ServiceNow’s own OpenJDK based JRE build is included. No Oracle licenses are required. This
MakeFarm Hackzone exhibit Part 1 - MID and OctoPrint install/config
I’m a ServiceNow fangirl.. that comes to no surprise to anyone who knows me well. Because I am such a fangirl, I do my best to incorporate ServiceNow into as many of my own hobbies as possible. One of those hobbies happens to be 3D printing. If you attended any of the recent Knowledge events and vis…

The MID server under my desk
My home on-prem MID server, mounted under my desk NOTE: the procedures described within are not supported by ServiceNow Introduction - a Micro-MID? A key component to the power of the ServiceNow platform is the MID server. This device is what provides visibility into your IT estate for your instanc…

Mid server on Raspberry Pi Zero W
I installed the MID server to “Raspberry pi Zero W” and the connection to the ServiceNow succeeded. I will post it as a case. (By cooperation of Google translation) “Raspberry pi Zero W” “Kingston of My Instance” as of February 20, 2018 After setting the file of Raspberry pi as in the past case, a…
