0. Why do we need remote development? When developing embedded Linux, for convenience, code is usually edited using a code editor on Windows, and the cross-compilation tool is on a Linux virtual machine or server. During development, the following loop operations need to be performed continuously:
These operations are all based on SSH, but they require terminal software, file transfer software, and constant switching operations, which makes the process very troublesome. If the local editor can directly open the remote server directory, operate files, and execute commands through SSH, this is called remote development. Using remote development can greatly facilitate our development process. 1. Visual Studio Code Remote – SSH extension
These three extensions support using remote computers, containers, or Windows Subsystem for Linux (WSL) as a fully functional background development environment. The local VS Code is just a front-end interface. In this article, we will mainly describe how to use the SSH extension, as shown in the figure: 2. SSH extension installation 2.1. Make sure you can use the ssh command on the command line If the system you are using is If you are using 2.2. Install Visual Studio Code Insiders version Note:
The VS Code remote development extension is still in preview, so you need to download and install 2.3. Install SSH extension Search for 3. Install SSH server on remote host ! ! ! sudo apt-get install openssh-server 4. Use SSH extension 4.1. Set up SSH extension to display login terminal Open the command palette, enter 4.2. Start SSH to connect to the remote host There are two ways to start SSH: Use Simply click the ssh icon in the lower left corner: After startup, enter the username and IP address of the remote host and press Enter to connect: So the SSH login terminal will be displayed, just enter the user's password: After logging in for the first time, VS Code will automatically pop up a new window for remote work and automatically install the VS Code server on the remote host: During the login process, you need to constantly enter the password. Just enter the password when it pops up, as shown in the figure: After successful login, as shown below: 4.3. Open a remote directory as a workspace Click on the File view: Then select the directory to open: Open successfully as follows: 4.4. Using the Remote Terminal Simply click on the new terminal to open Bash: 4.5. Installing extensions Note that in remote development, extensions are divided into local extensions and remote extensions: 5. Remember frequently used hosts As shown in the figure, open the configuration file: Select a profile: Fill in the content in the following format and save: This is the end of this article about using VSCode and SSH for remote development. For more relevant VSCode and SSH remote development content, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: JavaScript to achieve all or reverse selection function
>>: Example analysis of the search function of MySQL regular expressions (regexp and rlike)
Table of contents Linux--File descriptor, file po...
This article example shares the specific code of ...
This article example shares the specific code of ...
1. Introduction to MMM: MMM stands for Multi-Mast...
Table of contents Preface Function Overloading Ma...
This article shares the specific code of JavaScri...
The virtual machine I rented from a certain site ...
When making a form in a recent project, I need to...
Table of contents 1. Create a redis docker base i...
1. Text formatting: This example demonstrates how...
1. Brief introduction of the event An event is a ...
<br />When the page contains <img src=&qu...
Table of contents 1. Download the system image fi...
deepin and Ubuntu are both distributions based on...
This tutorial shares the installation and configu...