Skip to content

Instantly share code, notes, and snippets.

@work-on-code
Forked from avoidik/README.md
Created February 15, 2024 12:56
Show Gist options
  • Save work-on-code/82c1b38abab6f36308d09e805584e57f to your computer and use it in GitHub Desktop.
Save work-on-code/82c1b38abab6f36308d09e805584e57f to your computer and use it in GitHub Desktop.
Run vlmcsd on Raspberry Pi

Run vlmcsd on Raspberry Pi

Steps

Add system user

sudo mkdir /opt/vlmcs
sudo addgroup --system vlmcs
sudo adduser --system --home /opt/vlmcs --shell /usr/sbin/nologin --no-create-home --gecos 'vlmcs' --ingroup vlmcs --disabled-login --disabled-password vlmcs
sudo chown -R vlmcs:vlmcs /opt/vlmcs

Download binary

curl -fsSL https://github.com/Wind4/vlmcsd/releases/download/svn1113/binaries.tar.gz -o /tmp/binaries.tar.gz
sudo tar -zxf /tmp/binaries.tar.gz --strip-components=5 -C /opt/vlmcs binaries/Linux/arm/little-endian/glibc/vlmcsd-armv6hf-Raspberry-glibc
sudo tar -zxf /tmp/binaries.tar.gz --strip-components=5 -C /opt/vlmcs binaries/Linux/arm/little-endian/glibc/vlmcs-armv6hf-Raspberry-glibc
sudo mv /opt/vlmcs/vlmcsd-armv6hf-Raspberry-glibc /opt/vlmcs/vlmcsd
sudo mv /opt/vlmcs/vlmcs-armv6hf-Raspberry-glibc /opt/vlmcs/vlmcs
sudo chown -R vlmcs:vlmcs /opt/vlmcs
rm -f /tmp/binaries.tar.gz

Add systemd service

Create /etc/systemd/system/vlmcsd.service file (change ip-addresses accordingly)

[Unit]
Description=vlmcsd
After=network.target

[Service]
User=vlmcs
Group=vlmcs
Type=forking
PIDFile=/run/vlmcs/vlmcsd.pid
ExecStart=/opt/vlmcs/vlmcsd -p /run/vlmcs/vlmcsd.pid -L 192.168.1.200:1688
ExecReload=/bin/kill -HUP $MAINPID
LimitNOFILE=65535
LimitNPROC=64
PrivateTmp=true
PrivateDevices=true
ProtectHome=true
ProtectSystem=strict
NoNewPrivileges=true
DevicePolicy=closed
ProtectControlGroups=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
LockPersonality=yes
WorkingDirectory=/opt/vlmcs
ReadOnlyDirectories=/
KillMode=mixed
RuntimeDirectory=vlmcs

[Install]
WantedBy=multi-user.target

Enable systemd service

sudo systemctl daemon-reload
sudo systemctl enable vlmcsd.service
sudo systemctl start vlmcsd.service
sudo systemctl status vlmcsd.service

Test

/opt/vlmcs/vlmcs -v -4 -i 4 -w raspberrypi -l 181 192.168.1.200:1688

Optional: Convert Office to KMS

cd /d %ProgramFiles%\Microsoft Office\Office16 || cd /d %ProgramFiles(x86)%\Microsoft Office\Office16
for /f %x in ('dir /b ..\root\Licenses16\proplusvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%x"
cscript ospp.vbs /dstatus
cscript ospp.vbs /unpkey:XXXXX >nul
cscript ospp.vbs /inpkey:XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99
cscript ospp.vbs /sethst:192.168.1.200
cscript ospp.vbs /setprt:1688
cscript ospp.vbs /act
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment