🔧

Raspberry pi

4 notes  •  Tools & Utilities

Raspberry Pi VNC Server Commands

RealVNC Server is available for Raspberry Pi and runs in two modes: service mode (uses the physical console) and virtual mode (creates a virtual display). Use systemctl to manage both.

VNC Server in Service Mode (Physical Console)

# Start / stop
systemctl start vncserver-x11-serviced.service
systemctl stop vncserver-x11-serviced.service

# Enable / disable at boot
systemctl enable vncserver-x11-serviced.service
systemctl disable vncserver-x11-serviced.service

VNC Server in Virtual Mode (Headless)

# Start / stop
systemctl start vncserver-virtuald.service
systemctl stop vncserver-virtuald.service

# Enable / disable at boot
systemctl enable vncserver-virtuald.service
systemctl disable vncserver-virtuald.service

Verify

systemctl status vncserver-x11-serviced.service

Notes

  • Service mode shares the Pi's physical desktop; virtual mode creates an independent virtual display.
  • Connect with any VNC client (RealVNC Viewer, TightVNC) using the Pi's IP address.
  • Enable VNC in Raspberry Pi Configuration > Interfaces before starting the service.

Fix: Raspberry Pi Samba Share Not Visible on Windows 10

After Windows 10's Creator Update, SMB1 is disabled by default for security reasons. If your Raspberry Pi Samba share disappears from Windows Explorer, this is usually the cause.

Quick Fix: Enable SMB1 (Temporary)

Control Panel > Programs > Turn Windows features on or off
# Enable: SMB 1.0/CIFS File Sharing Support
# Restart Windows

Better Fix: Configure Samba to Use SMB2/SMB3

# On the Raspberry Pi, edit smb.conf
sudo nano /etc/samba/smb.conf

# In the [global] section, add:
min protocol = SMB2
ntlm auth = yes

sudo systemctl restart smbd

Verify

In Windows Explorer, try \\raspberry-pi-ip\sharename or \\raspberrypi\sharename.

Notes

  • Leaving SMB1 enabled long-term is a security risk (WannaCry and other exploits target it). Use SMB2 or SMB3 instead.
  • If shares still don't appear, try accessing via IP address rather than hostname to bypass NetBIOS discovery issues.

Install Node.js and npm on Raspberry Pi

Node.js enables the Raspberry Pi to run JavaScript server-side applications. This guide installs Node.js and npm using the NodeSource repository for the latest LTS version.

Prerequisites

  • Raspberry Pi running Raspberry Pi OS (Debian-based)
  • Internet connection

Steps

# Update package lists
sudo apt-get update
sudo apt-get upgrade -y

# Install via NodeSource (recommended for latest LTS)
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs

# Verify installation
node -v
npm -v

Alternative: Install via apt (older version)

sudo apt-get install nodejs npm

Test

echo 'const http = require("http"); http.createServer((req,res) => res.end("Hello Pi!")).listen(3000);' > server.js
node server.js
curl http://localhost:3000

Notes

  • The NodeSource repository provides Node.js 18 LTS for ARM — compatible with Raspberry Pi 3/4/5.
  • For running a permanent server, use PM2: npm install -g pm2 && pm2 start server.js.

Install LabVIEW Runtime 2021 on Raspberry Pi

NI LabVIEW Runtime allows Raspberry Pi to run LabVIEW-built applications. This guide installs lvrt21-schroot on Raspberry Pi OS.

Prerequisites

  • Raspberry Pi (3B+ or 4 recommended)
  • Raspberry Pi OS (October 2021 or later)
  • Internet access and SSH or terminal access

Steps

# 1. Change the default password
passwd

# 2. Set up WiFi or Ethernet
raspi-config

# 3. Enable required interfaces in raspi-config
#    (Serial, SPI, I2C as needed)

# 4. Add the NI LabVIEW runtime repository
sudo sh -c 'echo "deb [trusted=yes] \
  http://feeds.labviewmakerhub.com/debian/ binary/" \
  >> /etc/apt/sources.list'
sudo apt-get update

# 5. Install the runtime
sudo apt-get install lvrt21-schroot

# 6. Reboot
sudo reboot

Verify

dpkg -l | grep lvrt

The package should be listed as installed.

Notes

  • The text may wrap in terminal — copy commands into a text editor first to see full lines.
  • LabVIEW applications built for Raspberry Pi must target the ARM Linux RT platform.
  • Refer to NI's Maker Hub for application deployment instructions.