You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* add sample connection properties
* add examples
* alphabetize list
* break the examples out into their own section
* adjust examples
* update wording
* more changes to example section and remove a little redundancy
* acrolinx
* tech review
* acrolinx
* change location of troubleshooting step
* wording
* removed connection id
Co-authored-by: TylerMSFT <[email protected]>
Copy file name to clipboardExpand all lines: docs/linux/connect-to-your-remote-linux-computer.md
+22-1Lines changed: 22 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "Connect to your target Linux system in Visual Studio"
3
3
description: "How to connect to a remote Linux machine or Windows Subsystem for Linux from inside a Visual Studio C++ project."
4
-
ms.date: "01/8/2021"
4
+
ms.date: 03/14/2022
5
5
---
6
6
# Connect to your target Linux system in Visual Studio
7
7
@@ -94,6 +94,8 @@ If `ssh` isn't already set up and running on your Linux system, follow these ste
94
94
95
95
If you use key files for authentication, make sure the target machine's SSH server is running and configured properly.
96
96
97
+
If you have trouble connecting to WSL on `localhost`, see [Fix WSL `localhost` connection problems](#fix-wsl-localhost-connection-problems).
98
+
97
99
::: moniker-end
98
100
99
101
::: moniker range=">=msvc-160"
@@ -229,6 +231,25 @@ To configure your WSL installation to work with Visual Studio, you need the foll
229
231
sudo apt install g++ gdb make ninja-build rsync zip
230
232
```
231
233
234
+
### Fix WSL `localhost` connection problems
235
+
236
+
When connecting to Windows Subsystem for Linux (WSL) on `localhost`, you may run into a conflict with the Windows `ssh` client on port 22. In WSL, change the port that `ssh`expects requests from to 23 in `/etc/ssh/sshd_config`:
237
+
238
+
```bash
239
+
Port 23
240
+
```
241
+
242
+
If you're connecting using a password, ensure that the following is set in `/etc/ssh/sshd_config`:
243
+
244
+
```bash
245
+
# To disable tunneled clear text passwords, change to no here!
246
+
PasswordAuthentication yes
247
+
```
248
+
249
+
After making these changes, restart the SSH server (`sudo service ssh restart` on Ubuntu).
250
+
251
+
Then retry your connection to `localhost` using port 23.
252
+
232
253
For more information, see [Download, install, and set up the Linux workload](download-install-and-setup-the-linux-development-workload.md).
233
254
234
255
To configure an MSBuild project for WSL, see [Configure a Linux project](configure-a-linux-project.md). To configure a CMake project for WSL, see [Configure a Linux CMake project](cmake-linux-project.md). To follow step-by-step instructions for creating a simple console application with WSL, check out this introductory blog post on [C++ with Visual Studio 2019 and the Windows Subsystem for Linux (WSL)](https://devblogs.microsoft.com/cppblog/c-with-visual-studio-2019-and-windows-subsystem-for-linux-wsl/).
@@ -31,82 +31,82 @@ The functionality of ConnectionManager.exe is also available in Visual Studio. T
31
31
32
32
Authenticates and adds a new connection. By default, it uses port 22 and password authentication. (You'll be prompted to enter a password.) Use both **-`-password`** and **`--privatekey`** to specify a password for a private key.
Added in Visual Studio 16.10. Updates the host key fingerprint of the specified connection(s).
68
68
69
69
### Options
70
70
71
-
-**`-q`**, **`--quiet`**
71
+
-**`--file`***filename*
72
72
73
-
Prevents output to `stdout` or `stderr`.
73
+
Read connection information from the provided *filename*.
74
74
75
-
-**`--no-prompt`**
75
+
-**`--fingerprint`**
76
76
77
-
Fail instead of prompt, when appropriate.
77
+
The host key fingerprint presented by the server. Use this option with **`list`** to view a connection's fingerprint.
78
78
79
-
-**`--no-verify`**
79
+
-**`-i`**
80
80
81
-
Add or modify a connection without authentication.
81
+
Same as **`--privatekey`**.
82
82
83
-
-**`--file`***filename*
83
+
-**`-n`**, **`--dry-run`**
84
84
85
-
Read connection information from the provided *filename*.
85
+
Does a dry run of the command.
86
+
87
+
-**`--no-prompt`**
88
+
89
+
Fail instead of prompt, when appropriate.
86
90
87
91
-**`--no-telemetry`**
88
92
89
93
Disable sending usage data back to Microsoft. Usage data is collected and sent back to Microsoft unless the **`--no-telemetry`** flag is passed.
90
94
91
-
-**`-n`**, **`--dry-run`**
95
+
-**`--no-verify`**
92
96
93
-
Does a dry run of the command.
97
+
Add or modify a connection without authentication.
94
98
95
99
-**`--p`**
96
100
97
101
Same as **`--password`**.
98
-
99
-
-**`-i`**
100
-
101
-
Same as **`--privatekey`**.
102
102
103
103
-**`--previous`**
104
104
105
105
Indicates that the connection(s) will be read from the previous version of connection manager, updated, and written to the new version.
106
106
107
-
-**`--fingerprint`**
107
+
-**`-q`**, **`--quiet`**
108
108
109
-
The host key fingerprint presented by the server. Use this option with **`list`** to view a connection's fingerprint.
109
+
Prevents output to `stdout` or `stderr`.
110
110
111
111
## Examples
112
112
@@ -122,11 +122,21 @@ This command removes the connection that has ID 1975957870 from the list of conn
122
122
ConnectionManager.exe remove 1975957870
123
123
```
124
124
125
-
This command overrides the choice of shell for the connection with connection ID 21212121. Supported shells are: **`sh, csh, bash, tcsh, ksh, zsh, dash`**. If the shell found on the Linux system isn't supported, then we fall back to explicitly use **`sh`** for all commands.
| authentication type | The type of authentication used for the connection such as: `"password"`, `"privatekey"`.<br/>To create a connection with the authentication type set to `"privatekey"`: `ConnectionManager.exe add [email protected] --privatekey "%USERPROFILE%\.ssh\id_rsa"`|
130
+
|`default`| A boolean indicating whether this is the default connection. The default connection is used when there's more than one connection available and the one to use isn't specified.<br/>To set the specified connection to be the default connection: `ConnectionManager.exe modify -21212121 --property default=true`|
131
+
|`host`| The name or IP address of the remote computer.<br/>To change the host for the specified connection to another machine, in this case, local host: `ConnectionManager.exe modify -21212121 --property host=127.0.0.1`|
132
+
|`isWsl`| Returns true if the remote session is running Windows Subsystem for Linux. |
133
+
|`password`| The password for the connection. Change the password for the specified connection with: `ConnectionManager.exe modify -21212121 --property password="xyz"`|
134
+
|`platform`| The platform of the remote computer such as `"ARM"`, `"ARM64"`, `"PPC"`, `"PPC64"`, `"x64"`, `"x86"`.|
135
+
|`port`| The port used for the connection.<br/>Change the port for the specified connection: `ConnectionManager.exe modify -21212121 --property port=22`|
136
+
|`shell`| The preferred shell to use on the remote system. Supported shells are `sh, csh, bash, tcsh, ksh, zsh, dash`<br/>To set the preferred shell to be zsh for the remote machine on the specified connection: `ConnectionManager.exe modify -21212121 --property shell=zsh`<br/>If the shell found on the Linux system isn't supported, then **`sh`** is used for all commands. |
137
+
|`systemID`| The remote system type, such as `"OSX"`, `"Ubuntu"`. |
138
+
| `timeout` | The connection timeout in milliseconds. Change the timeout for the specified connection with: `ConnectionManager.exe modify -21212121 --property timeout=100`
139
+
|`username`| The name of the user logged into the remote computer.<br/>To add a connection for a user named `"user"` on localhost: `ConnectionManager.exe add [email protected]`|
0 commit comments