Open RamWebDev opened 2 years ago
Hi @RamWebDev Trying to figure out useful Photon OS installations recipes for VS Code extensions. Unfortunately there isn't yet a "sweet spot" of a stable and easy-to-go installation.
On a test with Photon OS installed on a RPI4, and a laptop with W10 and VS Code, the following Microsoft Marketplace Extensions have been installed. Here some findings.
Setting up SSH host 192.168.0.140: ([details](command:opensshremotes.showDetails "Show details")) Initializing VS Code server
. SSH from a Windows Command Shell works flawlessly. vi /etc/ssh/sshd_config
# uncomment the line 'AllowTcpForwarding yes' and save quit
systemctl restart sshd
With the change above, Remote-SSH from the W10 laptop to the Photon OS on RPi4 connected successfully. You already posted the issue in the VS Code forum https://github.com/microsoft/vscode-remote-release/issues/7006. "Remote Development" includes the sub-extensions Remote-WSL, Remote - Containers as well, but as said the successful installation of the local extension Remote-SSH is a prerequisite (tested with prerelease v.085.2022071315).
wget -O- https://aka.ms/install-vscode-server/setup.sh | sh
, accept the terms in the License agreement and grant access to the server. In my case the registration failed with a tunnel issue log-rpi4.txt.
The platform secure storage failure aka 'zbus error' has been mentioned hereNow, "Visual Studio Code Remote Server" looks similar to https://github.com/coder/code-server. Simply said, the idea is to use Visual Studio Code in a web browser.
On RPi4 Photon OS the standard installation curl -fsSL https://code-server.dev/install.sh | sh
fails because the Photon OS arm64 vanilla bits do not include all packages preinstalled. So you have to install them manually e.g.
cd ~
tdnf install -y wget curl glibc-iconv glibc glibc-devel glibc-tools libstdc++ libstdc++-devel autoconf automake binutils diffutils
gcc glib-devel linux-api-headers make ncurses-devel util-linux-devel zlib-devel nodejs
curl -J -L -O https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn-v1.22.19.tar.gz
tar -xzvf yarn-v1.22.19.tar.gz
cd yarn-v1.22.19/
PATH="~/yarn-v1.22.19/bin:$PATH"
npm install --global yarn
cd ~
curl -J -L -O https://github.com/coder/code-server/releases/download/v4.5.1/code-server-4.5.1-linux-arm64.tar.gz
tar -xzvf code-server-4.5.1-linux-arm64.tar.gz
cd code-server-4.5.1-linux-arm64/
./postinstall.sh
In ~/.config/code-server/config.yaml you can add the bind address, etc. The password is stored in ~/.config/code-server/config.yaml.
The default port 8080 has to be opened on Photon OS: /sbin/iptables -A INPUT -p tcp --dport 8080 -j ACCEPT
Start the code-server ~/code-server-4.5.1-linux-arm64/bin/code-server
. Connect in a webbrowser to VS Code and login.
Opening a file e.g. server.js worked.
The Java Debug Terminal didn't start successfully. The console window shows issues e.g.
Error: Module did not self-register: '/root/code-server-4.5.1-linux-arm64/lib/vscode/node_modules/spdlog/build/Release/spdlog.node'
(node:5083) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 internalMessage listeners added to [ChildProcess].
Back to your question, Remote Container debugging extension of VSCode seems promising. It is still buggy but the interval of new releases is short. The lack of missing package manager + packages handling in installation scripts is a common linux issue.
edited:
The server.js uses the module express. With npm install express
this prerequisite is met.
It seems to work, hope this helps.
Describe the bug
When using Remote Container debugging extension of VSCode to debug Photon OS container, it fails with below logs msg
[22 ms] Remote-Containers 0.241.3 in VS Code 1.69.2 (3b889b090b5ad5793f524b5d1d39fda662b96a2a). [21 ms] Start: Resolving Remote [23 ms] Setting up container: /type-express-srv4 [30 ms] Start: Run: docker inspect --type container /type-express-srv4 [149 ms] Start: Check Docker is running [149 ms] Start: Run: docker version --format {{.Server.APIVersion}} [292 ms] Server API version: 1.41 [293 ms] Start: Inspecting container [293 ms] Start: Run: docker inspect --type container 6461f8496631948afcf481adcec4569c678cd0847a2cf202230f4e7cb2c40d79 [367 ms] Start: Run in container: /bin/sh [369 ms] Start: Run in container: uname -m [569 ms] aarch64 [569 ms] [569 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null [574 ms] NAME="VMware Photon OS" VERSION="4.0" ID=photon VERSION_ID=4.0 PRETTY_NAME="VMware Photon OS/Linux" ANSI_COLOR="1;34" HOME_URL="https://vmware.github.io/photon/" BUG_REPORT_URL="https://github.com/vmware/photon/issues" [574 ms] [574 ms] Start: Run in container: cat /etc/passwd [579 ms] Start: Run in container: test -d /root/.vscode-server [582 ms] [583 ms] [583 ms] Start: Run in container: test ! -f '/root/.vscode-server/data/Machine/.writeMachineSettingsMarker' && set -o noclobber && mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null [586 ms] [586 ms] [586 ms] Exit code 1 [586 ms] Start: Run in container: cat /root/.vscode-server/data/Machine/settings.json [590 ms] [590 ms] cat: /root/.vscode-server/data/Machine/settings.json: No such file or directory [590 ms] Exit code 1 [590 ms] Support for ARM64 is in preview.
[590 ms] Start: Run in container: test -d /root/.vscode-server/bin/3b889b090b5ad5793f524b5d1d39fda662b96a2a [593 ms] [593 ms] [593 ms] Exit code 1 [593 ms] Installing VS Code Server for commit 3b889b090b5ad5793f524b5d1d39fda662b96a2a [594 ms] Start: Installing VS Code Server [594 ms] Start: Run in container: mkdir -p /root/.vscode-server/bin/3b889b090b5ad5793f524b5d1d39fda662b96a2a_1659239364084 [599 ms] [599 ms] [625 ms] Start: Run in container: (dd iflag=fullblock bs=8192 count=6258 2>/dev/null; dd iflag=fullblock bs=2631 count=1 2>/dev/null) | tar --no-same-owner -xz -C /root/.vscode-server/bin/3b889b090b5ad5793f524b5d1d39fda662b96a2a_1659239364084 [636 ms] [636 ms] zcat: not gzip [637 ms] Start: Run in container: mv -n /root/.vscode-server/bin/3b889b090b5ad5793f524b5d1d39fda662b96a2a_1659239364084/* /root/.vscode-server/bin/3b889b090b5ad5793f524b5d1d39fda662b96a2a && rmdir /root/.vscode-server/bin/3b889b090b5ad5793f524b5d1d39fda662b96a2a_1659239364084 [662 ms] Shell server terminated (code: 2, signal: null)
Reproduction steps
Expected behavior
Should allow using remote development extension to debug and connect to PhotonOS container
Additional context
No response