MS Code Remote SSH + Pinephone PRO

got my python setup and running remote, with MS Code, on my laptop, connected remotely via SSH to pinephone pro.

MS Code has a very useful capability “Remote Development using SSH“. Briefly, it lets me use my favorite big screen/keyboard to run/test/edit code on a remote system.

The pinephone pro supports this!

my phone currently running:

> uname -a

Linux manjaro-arm 5.16.2-2-MANJARO-ARM #1 SMP PREEMPT Fri Jan 21 21:39:27 UTC 2022 aarch64 GNU/Linux

Notes on pygame

need to configure X display stuff; once you have a pygame test program that runs locally, and you try to ssh and run it, you will see error:

pygame.error: No available video device

have seen this before, need to configure the DISPLAY variable. On a “local” terminal session on the phone, you can type

env | grep DISPLAY

to get the proper value, then “export” it, on your ssh terminal, for me:

export DISPLAY=:1

usually this is sufficient; but I found also needed the XAUTHORITY variable.

the error I first saw was:

Authorization required, but no authorization protocol specified

on my usual generic ubuntu or raspberry pi machines I did not see this error; the pinephone setup uses a “random” name each time, so you need to look it up after each reboot, you can get it with a “find” command

find /run/user/1000 -name "xauth*"

may give a permissions error about subdirectories, if you are not root, but that is fine, it should find the file, something like:

/run/user/1000/xauth_WUxldc

the part after the underscore will change each reboot.

so then you export:

export XAUTHORITY=/run/user/1000/xauth_WUxldc

then you can run your pygame tests!

all of these steps could be put into a bash script; but I have not done that yet, perhaps tomorrow!

This entry was posted in tech. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s