I really wanted to get the vscode server working on my beagleplay. After some investigation, I found that the server was crashing on boot. It seems like this issue was reported previously by @silver2row : bb-code-server and starting to get errors on building and keeping it up while running!
The beagleplay intro doc also mentions the following: “You may get a warning about an invalid or self-signed certificate”. i didn’t know what this referring to until I saw these journalctl logs:
The fix for me was to remove “–cert” from /lib/systemd/system/bb-code-server.service. I would like to see this removed by default, with the premise that users should be aware to NOT port-forward or have the beagleplay be available from external/global networks.
I’d like to hear everyone’s thoughts on this. Should we remove certificates for a working “out-of-box” experience?
@Sabeeh_Khan , that was not for the BeaglePlay but it may be similar. I think…
sudo apt install bb-code-server may help. I see in some releases for armhf repos, it is not installed by default.
P.S. I do not have the BeaglePlay right now. I cannot test it on my end.
I have the same issue on my BeaglePlay. I tried installing the bb-code-server, but this did not change anything. In the end I also followed @Sabeeh_Khan’s approach and removed the “–cert” from /lib/systemd/system/bb-code-server.service.
Same with mine. Had to remove --cert for it to start…
I think it might be a race condition… --cert is auto generated on first time, but on first startup all ssh key’s are wiped for a fresh install…
After a reboot, does it work on the 2nd try?
Background, --cert enable https, which makes the preview window and other more advanced functions actually work in modern browsers, within VScode…
Hey @RobertCNelson ,
Yes, after a reboot the server comes up.
I didn’t realize feeding bb-code-server PEM keys generated from ssh-keygen would work. I’ll try that and report back.
Sorry to cause confusion, and I don’t think I did anything wrong, but when I checked ~/.local/share/code-server there were localhost.key and localhost.crt with populated values!! These files had 0 bytes file size before.
Does bb-code-server automatically generate certs once it comes up?
I then added back the “–cert” tag and https works now.
Awesome @Sabeeh_Khan and @BarryBeagle a size of 0 is something we can check for and fix, thanks!