Remote development vscode: Difference between revisions
No edit summary |
No edit summary |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
=Introduction= | <seo title="Remote development | vscode | RidgeRun" titlemode="replace" keywords=" GStreamer, Linux SDK, Linux BSP, Embedded Linux, Device Drivers, NVIDIA, Jetson, TX1, TX2, Jetson TX1, Jetson TX2, Xavier, NVIDIA Jetson Xavier, NVIDIA Jetson Xavier NX, Jetson Xavier, Xilinx, TI, NXP, i.MX8, i.MX6, Jetson Xavier NX, Jetson Nano, NVIDIA Jetson Orin, Embedded Linux driver development, Linux Software development, Embedded Linux SDK, Embedded Linux Application development, GStreamer Multimedia Framework, remote target, docker container, vscode, remote development" description="This page shows how to use vscode to develop remotely on a target"></seo> | ||
==Introduction== | |||
This page shows how to use vscode to develop remotely on a target using ssh or in a docker container. | This page shows how to use vscode to develop remotely on a target using ssh or in a docker container. | ||
=Steps= | ==Steps== | ||
Install the | Install the [https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack remote development extension for vscode] | ||
This extension includes support for ssh and docker, although, separate extensions for each exist. | This extension includes support for ssh and docker, although, separate extensions for each exist. | ||
Line 9: | Line 11: | ||
[[File:vs_square.png]] | [[File:vs_square.png]] | ||
Click that icon then, "Connect to host..." -> "+ Add new ssh host" -> then input the ssh connection string, i.e. ssh user@host -A, input the password if needed | Click that icon then, "Connect to host..." -> "+ Add new ssh host" -> then input the ssh connection string, i.e. ssh user@host -A, and input the password if needed, you should be able to open any folder in the target and a terminal. | ||
=Inception= | ==Inception== | ||
Sometimes you may need to connect to a remote server, which has a docker container in it. Interestingly enough, you can use vscode to connect to the server, and then inside the server, attach vscode to the running container | Sometimes you may need to connect to a remote server, which has a docker container in it. Interestingly enough, you can use vscode to connect to the server, and then inside the server, attach vscode to the running container | ||
To do it, click on the green icon, which now should indicate that you are connected to the target via ssh. [[File:vs_ssh.png]] | To do it, click on the green icon, which now should indicate that you are connected to the target via ssh. [[File:vs_ssh.png]] | ||
Then, click on attach to running container: | Then, click on attach to the running container: | ||
[[File:attach_cont.png]] | [[File:attach_cont.png|500px]] | ||
Now select the running container you want to attach to. | |||
Of course you could also attach to a local container | Of course, you could also attach it to a local container on your PC. | ||
[[Category: | [[Category:Tools]][[Category:Debug]] |
Latest revision as of 16:27, 23 May 2023
Introduction
This page shows how to use vscode to develop remotely on a target using ssh or in a docker container.
Steps
Install the remote development extension for vscode This extension includes support for ssh and docker, although, separate extensions for each exist.
Once installed a green icon will appear on the lower left corner of the window.
Click that icon then, "Connect to host..." -> "+ Add new ssh host" -> then input the ssh connection string, i.e. ssh user@host -A, and input the password if needed, you should be able to open any folder in the target and a terminal.
Inception
Sometimes you may need to connect to a remote server, which has a docker container in it. Interestingly enough, you can use vscode to connect to the server, and then inside the server, attach vscode to the running container
To do it, click on the green icon, which now should indicate that you are connected to the target via ssh.
Then, click on attach to the running container:
Now select the running container you want to attach to.
Of course, you could also attach it to a local container on your PC.