Pablo Santalla

VS Code on Raspberry Pi 5 - Stable Setup

VS Code v1.97+ crashes on Pi 5 with "code 5" error due to incompatibility with the 16K pagesize kernel. This is the workaround I've been using since the bug appeared. As of this revision date, Microsoft hasn't fixed it yet, but it's likely this will become unnecessary at some point.

Problem

VS Code v1.97+ crashes with "code 5" error on Pi5 due to incompatibility with 16K pagesize kernel.

Solution

Kernel Fix (permanent)

  1. Edit boot configuration:
sudo nano /boot/firmware/config.txt
  1. Add at the end:
kernel=kernel8.img
  1. Reboot:
sudo reboot

Install VS Code

sudo apt update
sudo apt install code -y

First Launch

code

On login: accept "Use weaker encryption" (keyring not available by default).

Performance

Restore 16K Kernel (if Microsoft fixes the bug)

  1. Edit boot configuration:
sudo nano /boot/firmware/config.txt
  1. Remove this line:
kernel=kernel8.img
  1. Reboot:
sudo reboot
  1. Check if VS Code remains stable. If it crashes, revert the change.

Known Issues

System Info

Changelog