|
|
# 3.1. Configure VSCode and Connect to the VM
|
|
|
# 2.1. Configure VSCode and Connect to the VM
|
|
|
|
|
|
|
|
|
## 3.1.1. Install VSCode and the required extensions
|
|
|
## 2.1.1. Install VSCode and the required extensions
|
|
|
If not already done, install [VSCode](https://code.visualstudio.com/) and the "Remote SSH" extension on your local
|
|
|
machine, not in the VM.
|
|
|
|
|
|
__Note__: "Python" extension is not required here. It will be installed later on the VSCode server running on the VM.
|
|
|
|
|
|
|
|
|
## 3.1.2. Configure the "Remote SSH" extension
|
|
|
## 2.1.2. Configure the "Remote SSH" extension
|
|
|
- Go to left icon "Remote Explorer"
|
|
|
- Click the "gear" icon next to "SSH TARGETS" on top of "Remote Explorer" bar
|
|
|
- Choose to edit "<...>/.ssh/config" file (or equivalent)
|
... | ... | @@ -24,7 +24,7 @@ Host TFS-VM |
|
|
- An entry "TFS-VM" should appear on "SSH TARGETS".
|
|
|
|
|
|
|
|
|
## 3.1.3. Connect VSCode to the VM through "Remote SSH" extension
|
|
|
## 2.1.3. Connect VSCode to the VM through "Remote SSH" extension
|
|
|
- Right-click on "TFS-VM"
|
|
|
- Select "Connect to Host in Current Window"
|
|
|
- Reply to the questions asked
|
... | ... | @@ -39,7 +39,7 @@ __Note__: if you get a connection error message, the reason might be due to wron |
|
|
and retry connection.
|
|
|
|
|
|
|
|
|
## 3.1.4. Add SSH key to prevent typing the password every time
|
|
|
## 2.1.4. Add SSH key to prevent typing the password every time
|
|
|
This step creates an SSH key in the VM and installs it on the VSCode to prevent having to type the password every time.
|
|
|
|
|
|
- In VSCode (connected to the VM), click menu "Terminal > New Terminal"
|
... | ... | @@ -77,7 +77,7 @@ Host TFS-VM |
|
|
- From now, VSCode will use the identity file to connect to the TFS-VM instead of the user's password.
|
|
|
|
|
|
|
|
|
## 3.1.5. Install VSCode Python Extension (in VSCode server)
|
|
|
## 2.1.5. Install VSCode Python Extension (in VSCode server)
|
|
|
This step installs Python extensions in VSCode server running in the VM.
|
|
|
|
|
|
- In VSCode (connected to the VM), click left button "Extensions"
|
... | ... | @@ -89,7 +89,7 @@ This step installs Python extensions in VSCode server running in the VM. |
|
|
- Click "Ctrl+Alt+P" and type "Python: Select Interpreter". Select option "Python: 3.9.13 64-bit ('tfs')"
|
|
|
|
|
|
|
|
|
## 3.1.6. Define environment variables for VSCode
|
|
|
## 2.1.6. Define environment variables for VSCode
|
|
|
The source code in the TFS controller project is hosted in folder `src/`. To help VSCode find the Python modules and
|
|
|
packages, add the following file into your working space root folder:
|
|
|
|
... | ... | |