• General
  • VSCode remote over ssh with bela?

Can anybody get VSCode editing over SSH working with Bela? I'm tried with my bela mini, but the connection never completes, I think because the VS install part fails. The site, https://code.visualstudio.com/docs/remote/linux, says some platforms might have issues, so I'm guessing there's some level of incompatibility. Would be a nice way to develop. Has anybody got this working?

Paul

I never used VSCode, but I successully use sshfs on macos to mount Bela's root partition via ssh.

If I understand correctly, that page lists as requirements for Debian: openssh-server, bash and curl or wget. All of those are installed on the Bela image. Is it possible that it also requires an internet connection for the remote "server" (Bela)? If it is installing something on the server, it may need to connect to the internet for downloading the install packages (which would explain the requirement for curl or wget). Maybe this is needed only once during installation? If your board is not connected to the internet, you may try to connect it (e.g.: via network sharing from the host), and/or you may try to dissect the installation script, figure out what needs to be downloaded, download it from the host and scp it over.

7 months later

If you try this, you might run into memory issues. I believe when I installed the CPP checker module, the bela mini ran out of memory and freezes. Turning the CPP module off again and my bela seems more stable. But looking at mem while compiling, it still seems to get very low. I'm not familiar with memory on Linux, but based on the dmesg logs, memory was an issue. Maybe 500MB isn't enough for all these features, which is unfortunately as intellisense and reference jumping are some of my favorite features.

This is what my memory looks like with my project running. i'm guessing the node process is VSCode remote.

top - 18:12:13 up 1:46, 2 users, load average: 1.08, 1.09, 0.94
Tasks: 96 total, 2 running, 68 sleeping, 0 stopped, 0 zombie
%Cpu(s): 11.8 us, 87.8 sy, 0.0 ni, 0.0 id, 0.0 wa, 0.0 hi, 0.4 si, 0.0 st
KiB Mem : 499012 total, 12380 free, 345156 used, 141476 buff/cache
KiB Swap: 0 total, 0 free, 0 used. 110016 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2391 root 20 0 6596 4216 3768 R 93.0 0.8 16:26.43 Harm
2396 root -2 0 217384 201972 25264 S 3.2 40.5 0:38.24 scsynth
2407 root 20 0 5404 2372 1864 R 1.9 0.5 0:19.65 top
1072 root 20 0 8500 4260 3672 S 0.6 0.9 0:20.73 sshd
62 root 20 0 0 0 0 I 0.3 0.0 0:01.33 kworker/0:2
1643 root 20 0 170768 54412 18276 S 0.3 10.9 0:52.83 node
2402 root 20 0 0 0 0 I 0.3 0.0 0:00.76 kworker/u2:2

You can do ps aux | grep PID where PID is the pid of the high memory process and you'll see how it was invoked and therefore whether it is indeed the VS process or the Bela IDE.

I have no idea how any of this VS stuff works, but can you not set it up to cross-compile instead?

    giuliomoro but can you not set it up to cross-compile

    Or is that what it is doing already? And in that case, why is it using ram and cpu on the board?