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
Copy file name to clipboardExpand all lines: docs/build/get-started-linux-cmake.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -149,7 +149,7 @@ In this step, we'll debug an example program that demonstrates the Bullet Physic
149
149
150
150
If you've already added a remote connection, you can open this window by navigating to **Tools > Options > Cross Platform > Connection Manager**.
151
151
152
-
1. Provide the [connection information to your Linux machine](connect-to-your-remote-linux-computer.md) and choose **Connect**. Visual Studio adds that machine as to CMakeSettings.json as your default connection for **Linux-Debug**. It also pulls down the headers from your remote machine, so you get [IntelliSense specific to that remote connection](/cpp/linux/configure-a-linux-project?view=vs-2019#remote_intellisense). Next, Visual Studio sends your files to the remote machine and generates the CMake cache on the remote system. These steps may take some time, depending on the speed of your network and power of your remote machine. You'll know it's complete when the message "Target info extraction done" appears in the CMake output window.
152
+
1. Provide the [connection information to your Linux machine](/cpp/linux/connect-to-your-remote-linux-computer.md) and choose **Connect**. Visual Studio adds that machine as to CMakeSettings.json as your default connection for **Linux-Debug**. It also pulls down the headers from your remote machine, so you get [IntelliSense specific to that remote connection](/cpp/linux/configure-a-linux-project?view=vs-2019#remote_intellisense). Next, Visual Studio sends your files to the remote machine and generates the CMake cache on the remote system. These steps may take some time, depending on the speed of your network and power of your remote machine. You'll know it's complete when the message "Target info extraction done" appears in the CMake output window.
Copy file name to clipboardExpand all lines: docs/linux/connect-to-your-remote-linux-computer.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,6 @@ description: "How to connect to a remote Linux machine or WSL from inside a Visu
4
4
ms.date: "09/04/2019"
5
5
ms.assetid: 5eeaa683-4e63-4c46-99ef-2d5f294040d4
6
6
---
7
-
8
7
# Connect to your target Linux system in Visual Studio
9
8
10
9
::: moniker range="vs-2015"
@@ -15,7 +14,7 @@ Linux support is available in Visual Studio 2017 and later.
15
14
16
15
::: moniker range=">=vs-2017"
17
16
18
-
You can configure a Linux project to target a remote machine or the Windows Subsystem for Linux (WSL). For remote machines, and for WSL on Visual Studio 2017, you need to set up a remote connection.
17
+
You can configure a Linux project to target a remote machine or the Windows Subsystem for Linux (WSL). For remote machines, and for WSL on Visual Studio 2017, you need to set up a remote connection.
19
18
20
19
## Connect to a remote Linux computer
21
20
@@ -43,17 +42,17 @@ To set up this remote connection:
43
42
| **Private key file** | Private key file created for ssh connection
44
43
| **Passphrase** | Passphrase used with private key selected above
45
44
46
-
You can use either a password or key file and passphrase for authentication. For many development scenarios, password authentication is sufficient. If you prefer to use a public/private key file, you can create a new one or [reuse an existing one](https://security.stackexchange.com/questions/10203/reusing-private-public-keys). Currently only RSA and DSA keys are supported.
47
-
45
+
You can use either a password or key file and passphrase for authentication. For many development scenarios, password authentication is sufficient. If you prefer to use a public/private key file, you can create a new one or [reuse an existing one](https://security.stackexchange.com/questions/10203/reusing-private-public-keys). Currently only RSA and DSA keys are supported.
46
+
48
47
You can create a private RSA key file by following these steps:
49
48
50
-
1. On the Windows machine, create the ssh key pair with `ssh-keygen -t rsa`. This will create a public key and a private key. By default the keys are placed under `C:\Users\%USERNAME%\.ssh` with names `id_rsa.pub` and `id_rsa`.
49
+
1. On the Windows machine, create the ssh key pair with `ssh-keygen -t rsa`. This will create a public key and a private key. By default the keys are placed under `C:\Users\%USERNAME%\.ssh` with names `id_rsa.pub` and `id_rsa`.
51
50
52
-
1. From Windows, copy the public key to the Linux machine: `scp -p C:\Users\%USERNAME%\.ssh\id_rsa.pub user@hostname`.
51
+
1. From Windows, copy the public key to the Linux machine: `scp -p C:\Users\%USERNAME%\.ssh\id_rsa.pub user@hostname`.
53
52
54
-
1. On the Linux system, add the key to the list of authorized keys (and ensure the file has the correct permissions): `cat ~/id_rsa.pub >> ~/.ssh/authorized_keys; chmod 600 ~/.ssh/authorized_keys`
53
+
1. On the Linux system, add the key to the list of authorized keys (and ensure the file has the correct permissions): `cat ~/id_rsa.pub >> ~/.ssh/authorized_keys; chmod 600 ~/.ssh/authorized_keys`
55
54
56
-
1. Click the **Connect** button to attempt a connection to the remote computer.
55
+
1. Click the **Connect** button to attempt a connection to the remote computer.
57
56
58
57
If the connection succeeds, Visual Studio will begin configuring IntelliSense to use the remote headers. For more information, see [IntelliSense for headers on remote systems](configure-a-linux-project.md#remote_intellisense).
59
58
@@ -74,7 +73,7 @@ To set up this remote connection:
74
73
Logs include connections, all commands sent to the remote machine (their text, exit code and execution time), and all output from Visual Studio to the shell. Logging works for any cross-platform CMake project or MSBuild-based Linux project in Visual Studio.
75
74
76
75
You can configure the output to go to a file or to the **Cross Platform Logging** pane in the Output Window. For MSBuild-based Linux projects, commands issued to the remote machine by MSBuild are not routed to the **Output Window** because they are emitted out-of-process. Instead, they are logged to a file with the "msbuild_" prefix.
77
-
76
+
78
77
## TCP Port Forwarding
79
78
80
79
Visual Studio's Linux support has a dependency on TCP port forwarding. **Rsync** and **gdbserver** will be affected if TCP port forwarding is disabled on your remote system.
@@ -87,9 +86,9 @@ Rsync is also used by Visual Studio's CMake support to copy source files to the
Gdbserver can be used for debugging on embedded devices. If you're not able to enable TCP port forwarding then you will need to use the gdb for all remote debugging scenarios. Gdb is used by default when debugging projects on a remote system.
89
+
Gdbserver can be used for debugging on embedded devices. If you're not able to enable TCP port forwarding then you will need to use the gdb for all remote debugging scenarios. Gdb is used by default when debugging projects on a remote system.
91
90
92
-
::: moniker-end
91
+
::: moniker-end
93
92
94
93
## Connect to WSL
95
94
@@ -101,13 +100,14 @@ In Visual Studio 2017, you connect to WSL by using the same steps as connecting
101
100
102
101
::: moniker range="vs-2019"
103
102
104
-
Visual Studio 2019 version 16.1 added native support for using C++ with the [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/windows/wsl/about). This means that you no longer need to add a remote connection or configure SSH in order to build and debug on your local WSL installation. You can find details on [how to install WSL](https://docs.microsoft.com/windows/wsl/install-win10) here.
103
+
Visual Studio 2019 version 16.1 added native support for using C++ with the [Windows Subsystem for Linux (WSL)](/windows/wsl/about). This means that you no longer need to add a remote connection or configure SSH in order to build and debug on your local WSL installation. You can find details on [how to install WSL](/windows/wsl/install-win10) here.
105
104
106
-
To configure your WSL installation to work with Visual Studio you need the following tools installed: gcc or clang, gdb, make, rsync, and zip. You can install them on distros that use apt by using this command, which also installs the g++ compiler:
105
+
To configure your WSL installation to work with Visual Studio you need the following tools installed: gcc or clang, gdb, make, rsync, and zip. You can install them on distros that use apt by using this command, which also installs the g++ compiler:
107
106
108
107
```bash
109
108
sudo apt install g++ gdb make rsync zip
110
109
```
110
+
111
111
For more information, see [Download, install, and set up the Linux workload](download-install-and-setup-the-linux-development-workload.md).
112
112
113
113
To configure your project for WSL, see [Configure a Linux project](configure-a-linux-project.md) or [Configure a Linux CMake project](cmake-linux-project.md) depending on which kind of project you have. 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/).
@@ -116,7 +116,7 @@ To configure your project for WSL, see [Configure a Linux project](configure-a-l
116
116
117
117
## See Also
118
118
119
-
[Configure a Linux project](configure-a-linux-project.md)<br />
120
-
[Configure a Linux CMake project](cmake-linux-project.md)<br />
121
-
[Deploy, run and debug your Linux project](deploy-run-and-debug-your-linux-project.md)<br />
119
+
[Configure a Linux project](configure-a-linux-project.md)\
120
+
[Configure a Linux CMake project](cmake-linux-project.md)\
121
+
[Deploy, run and debug your Linux project](deploy-run-and-debug-your-linux-project.md)\
0 commit comments