Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion selfdrive/test/setup_xvfb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

# Sets up a virtual display for running map renderer and simulator without an X11 display

DISP_ID=99
if uname -r | grep -q "WSL2"; then
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WSL2 detection logic may not work correctly. WSL2 kernel versions typically contain "microsoft" or "WSL" (lowercase) in the output of uname -r, not "WSL2" (uppercase). For example, a typical WSL2 kernel version looks like "5.10.16.3-microsoft-standard-WSL2" or "5.15.90.1-microsoft-standard-WSL2".

Consider using a more robust detection pattern:

if uname -r | grep -qi "microsoft.*wsl"; then

This uses case-insensitive matching (-qi) and checks for "microsoft" followed by "wsl" anywhere in the string, which should reliably detect WSL2 environments.

Suggested change
if uname -r | grep -q "WSL2"; then
if uname -r | grep -qi "microsoft.*wsl"; then

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

@TheSecurityDev TheSecurityDev Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mine looks like 6.6.87.2-microsoft-standard-WSL2. And you contradicted yourself.

DISP_ID=0 # WSLg uses display :0
else
DISP_ID=99 # Standard Xvfb display
fi
export DISPLAY=:$DISP_ID

sudo Xvfb $DISPLAY -screen 0 2160x1080x24 2>/dev/null &
Expand Down
Loading