EBC Exercise 06 Setting Up Visual Studio Code

From eLinux.org
Jump to: navigation, search

thumb‎ Embedded Linux Class by Mark A. Yoder

Here's how to install a browser version of Visual Studio Code.


bone$ sudo apt update
bone$ sudo apt install bb-code-server

Changing port number

VS Code defaults to listening to port 3000, the same port as cloud9. To change the port

bone$ cd /opt/bb-code-server/

and change the 3000 in start.sh to 3001. Then

bone$ ./start.sh

You can also modify start.sh so that it opens with cloud9 examples. Here's my start.sh

/opt/bb-code-server/app/bin/code-server --auth none --disable-telemetry --disable-update-check --user-data-dir /var/lib/cloud9 --config /var/lib/bb-code-server/config/config.yaml --extensions-dir /var/lib/bb-code-server/extensions/ --bind-addr

Updating with apt

If you try doing an apt upgrade to update VS Code from the VSC terminal things will get into an unknown state. Therefore bb-code-server is on hold by default and won't upgrade. Here's how to unhold and update. Login via ssh (not through the VSC terminal) and run:

bone$ sudo systemctl stop bb-code-server.service
bone$ sudo apt-mark unhold bb-code-server
Canceled hold on bb-code-server.
bone$ sudo apt upgrade

Then set things back.

bone$ sudo apt-mark hold bb-code-server
bb-code-server set on hold.
bone$ sudo systemctl start bb-code-server.service

Working with wsl

You can run visual Studio Code on your host computer and edit files in wsl. Do this by installing the Remote - WSL extension in VS Code.

Once installed you can go to your window and open a directory.

host$ code .

This will open VS Code on the current direcotry.

thumb‎ Embedded Linux Class by Mark A. Yoder