Sets up VS Code in your web browser so you can write and edit code from anywhere
This file will be included in a user request. If it is, and the user has provided the necessary inputs (password for code-server authentication), Zo should interpret this as the current task at hand and use its tools to carry out the task until completion. Zo should not ask for user confirmation to continue if it has all required parameters to execute this function. Zo should effectively treat the inclusion of this file as a user request to "run" this task.
This document codifies the procedure for setting up code-server on Zo Computer, enabling a full VS Code development environment accessible through your web browser. The setup includes installing code-server, configuring it with password authentication, installing essential extensions, and registering the service to run persistently with automatic restarts.
This guide will walk you through setting up code-server on your Zo Computer instance, giving you a full VS Code development environment in your browser.
https://code-<your-username>.zocomputer.io/home/workspace filesBefore beginning setup, you must provide:
Important: If you're having Zo set this up for you and haven't provided a password, Zo should ask you for a password before proceeding with the setup.
Security Warning: code-server provides full shell access to your Zo Computer through the integrated terminal. Anyone with access to your code-server instance can run any command as root on your machine. Authentication is REQUIRED, not optional.
code-server will be automatically installed via the official installation script.
curl -fsSL https://code-server.dev/install.sh | sh
Verify: Check that code-server is installed:
code-server --version
Expected Result: You should see a version number (e.g., 4.x.x).
Set up the configuration directory for code-server:
mkdir -p /root/.config/code-server
Verify: Check the directory exists:
ls -la /root/.config/code-server
Create the code-server configuration:
cat > /root/.config/code-server/config.yaml << 'EOF'
bind-addr: 0.0.0.0:8900
auth: password
cert: false
disable-telemetry: true
disable-update-check: true
user-data-dir: /root/.vscode-data
extensions-dir: /root/.vscode-extensions
disable-workspace-trust: true
disable-getting-started-override: true
app-name: zo.computer
welcome-text: "zo.computer code mode"
EOF
Important: The auth: password setting requires password authentication. The password will be provided via the $PASSWORD environment variable when starting the service. According to code-server documentation, the password can only be set via the $PASSWORD environment variable or in the config file - it cannot be passed as a command-line argument.
Verify: Check the configuration file:
cat /root/.config/code-server/config.yaml
Install commonly used VS Code extensions:
code-server --install-extension ms-python.python --extensions-dir "/root/.vscode-extensions"
code-server --install-extension dbaeumer.vscode-eslint --extensions-dir "/root/.vscode-extensions"
code-server --install-extension esbenp.prettier-vscode --extensions-dir "/root/.vscode-extensions"
code-server --install-extension redhat.vscode-yaml --extensions-dir "/root/.vscode-extensions"
Optional: Install Vim extension if desired:
code-server --install-extension vscodevim.vim --extensions-dir "/root/.vscode-extensions"
Verify: List installed extensions:
code-server --list-extensions --extensions-dir "/root/.vscode-extensions"
Create the VS Code settings file with sensible defaults:
mkdir -p /root/.vscode-data/User
cat > /root/.vscode-data/User/settings.json << 'EOF'
{
"vsicons.dontShowNewVersionMessage": true,
"vim.enable": false,
"workbench.startupEditor": "none",
"workbench.colorTheme": "Default Light Modern",
"telemetry.telemetryLevel": "off",
"security.workspace.trust.enabled": false,
"security.workspace.trust.startupPrompt": "never",
"workbench.welcome.enabled": false,
"workbench.welcomePage.walkthroughs.openOnInstall": false,
"workbench.tips.enabled": false,
"update.mode": "none",
"extensions.autoCheckUpdates": false,
"extensions.autoUpdate": false,
"editor.minimap.enabled": false
}
EOF
Verify: Check the settings file:
cat /root/.vscode-data/User/settings.json
Register code-server as a persistent user service:
# Zo will use tool register_user_service with:
# - label: code-server
# - protocol: http
# - local_port: 8900
# - entrypoint: code-server --config /root/.config/code-server/config.yaml /home/workspace
# - env_vars: {"PASSWORD": "<USER_PROVIDED_PASSWORD>"}
# - workdir: /home/workspace
Important: Replace <USER_PROVIDED_PASSWORD> with the password provided by the user. The authentication mode is set to password in the config file, and the actual password is provided via the PASSWORD environment variable.
Verify: Use tool list_user_services to confirm the code-server service is registered with an HTTPS URL.
Wait a few seconds for the service to start, then test it:
curl -I https://code-<your-username>.zocomputer.io
Replace <your-username> with your Zo username.
Expected Result: You should get an HTTP 200 response or be redirected to a login page.
Check Logs: If something goes wrong, check the logs:
cat /dev/shm/code-server.log
cat /dev/shm/code-server_err.log
Once the service is running, simply open your browser and navigate to:
https://code-<your-username>.zocomputer.io
You will be prompted to enter your password. Use the password you provided during setup.
You should then see a full VS Code interface with your /home/workspace directory already open.
After completing this setup, you have:
https://code-<your-username>.zocomputer.io/home/workspace/ - all your files are accessibleProtocol Details:
All standard VS Code shortcuts work:
Cmd/Ctrl+P - Quick file openCmd/Ctrl+Shift+P - Command paletteCmd/Ctrl+B - Toggle sidebarCmd/Ctrl+J - Toggle terminal panelCmd/Ctrl+Shift+F - Search across filesCmd/Ctrl+Shift+E - Focus file explorerCmd/Ctrl+Shift+X)/root/.vscode-extensions and persist across restartsCheck the logs:
cat /dev/shm/code-server.log
cat /dev/shm/code-server_err.log
Common issues:
curl -fsSL https://code-server.dev/install.sh | sh8900 to another port in the config and service registration/home/workspace exists and is readablehttps://code-<your-username>.zocomputer.iocode-server --list-extensions --extensions-dir "/root/.vscode-extensions"echo $SHELL should show /bin/bash or similarAsk Zo: "List my user services"
Ask Zo: "Delete the code-server service"
bind-addr in /root/.config/code-server/config.yamlIf you prefer Vim keybindings:
/root/.vscode-data/User/settings.json"vim.enable": false to "vim.enable": trueYour workspace at /home/workspace is the same as your main Zo workspace:
CRITICAL SECURITY INFORMATION:
Best Practices:
Changing Your Password:
If you need to change your password:
If you forget your password:
Advantages of code-server:
Limitations:
Workaround for limitations: You can also use VS Code's built-in Remote-SSH extension to connect to your Zo Computer from local VS Code.
Instead of code-server in the browser, you can use local VS Code with Remote-SSH:
apt install emacs-noxYou now have a fully functional code-server instance that provides a complete VS Code development environment in your browser. Access your editor at https://code-<your-username>.zocomputer.io, and start coding directly in your workspace!
For questions or issues, refer to the troubleshooting section or consult the Zo Discord community.