Remote Access to Quectel Pi H1 via VNC
VNC stands for Virtual Network Computing. It is a graphical desktop sharing system that allows you to remotely view and control the complete desktop environment of another computer over a network.
Prerequisite: For VNC remote access to work, both devices must be on the same local area network, and the target device must have the VNC service enabled.
Due to compatibility issues with the underlying Wayland protocol, the Debian system can only adopt the Xvfb+x11vnc solution at present.
Install necessary software
Use the debug serial port or adb shell to enter the terminal window and enter the following command:
sudo apt update
sudo apt install -y xvfb xfce4 x11vnc
- When encountering an option, simply press the
Enterkey
Set VNC password
Enter the following command on the device terminal:
# Follow the prompts to enter the password twice in a row
mkdir -p ~/.vnc
x11vnc -storepasswd
Create a startup script
Enter the following command on the device terminal:
# Create Script
cat > ~/vnc_start.sh << 'EOF'
#!/bin/bash
echo "=== Starting Reliable VNC Server ==="
pkill Xvfb
pkill x11vnc
pkill startxfce4
sleep 2
echo "1. Starting virtual display..."
Xvfb :99 -screen 0 1280x720x24 -ac &
sleep 5
echo "2. Setting display environment..."
export DISPLAY=:99
echo "3. Starting desktop environment..."
startxfce4 &
sleep 10
echo "4. Starting VNC server..."
x11vnc -display :99 -forever -shared -rfbauth ~/.vnc/passwd -rfbport 5900 -bg
sleep 3
echo "=== Verification ==="
echo "VNC Process: $(ps aux | grep x11vnc | grep -v grep | wc -l)"
echo "Port Status: $(ss -tlnp | grep 5900 | wc -l)"
echo ""
echo " VNC SERVER READY!"
echo " Connect to: $(hostname -I | awk '{print $1}'):5900"
echo " No password required"
echo " Full desktop environment available"
EOF
#Modify permissions
chmod +x ~/vnc_start.sh
- Set login password, x11vnc -display :99 -forever -shared -rfbauth ~/.vnc/passwd -rfbport 5900 -bg
- Do not set a login password, x11vnc -display :99 -forever -shared -nopw -rfbport 5900 -bg
Switch x11 sessions
# Edit GDM configuration to force the use of X11
sudo nano /etc/gdm3/daemon.conf
# Remove comments from the file (i.e. remove the first #) and do not use Wayland protocol
WaylandEnable=false
# Restart GDM
sudo systemctl restart gdm3
- After GDM configuration forces the use of X11, the display screen connected to the device will not be able to display
Management commands
# Start VNC
./vnc_start.sh
# Stop VNC
pkill Xvfb
pkill x11vnc
# View status
ps aux | grep -E "(Xvfb|x11vnc)"
ss -tlnp | grep 5900
Test connection
# Connect from another computer, enter the password as prompted to log in
# For example, vncviewer 10.66.82. *: 5900
Vncviewer<Device IP Address>: 5900
- After successful connection, you will see the following screen
Restore display
After GDM configuration forces the use of X11, the display screen connected to the device will not be able to display. To restore the display, enter the following command:
#Edit GDM configuration
sudo nano /etc/gdm3/daemon.conf
#Add comments in the file (i.e. add the first #) using Wayland protocol
#WaylandEnable=false
#Restart GDM
sudo systemctl restart gdm3
- There may still be bugs in the current testing, and the mouse icon may not be found after recovery