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/linux/download-install-and-setup-the-linux-development-workload.md
+39-16Lines changed: 39 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,20 +15,14 @@ Linux projects are supported in Visual Studio 2017 and later.
15
15
16
16
::: moniker range=">=vs-2017"
17
17
18
-
You can use the Visual Studio IDE in Windows to create, edit and debug C++ projects that execute on a Linux physical computer, virtual machine, or the [Windows Subsystem for Linux](/windows/wsl/about).
18
+
You can use the Visual Studio IDE on Windows to create, edit and debug C++ projects that execute on a remote Linux system, virtual machine, or the [Windows Subsystem for Linux](/windows/wsl/about).
19
19
20
-
You can work on your existing code base that uses CMake or any other build system without having to convert it to a Visual Studio project. If your code base is cross-platform, you can target both Windows and Linux from within Visual Studio. For example, you can edit, debug and profile your code on Windows using Visual Studio, then quickly retarget the project for Linux to do further testing. The Linux header files are automatically copied to your local machine where Visual Studio uses them to provide full IntelliSense support (Statement Completion, Go to Definition, and so on).
20
+
You can work on your existing code base that uses CMake without having to convert it to a Visual Studio project. If your code base is cross-platform, you can target both Windows and Linux from within Visual Studio. For example, you can edit, build, and debug your code on Windows using Visual Studio, then quickly retarget the project for Linux to build and debug in a Linux environment. Linux header files are automatically copied to your local machine, where Visual Studio uses them to provide full IntelliSense support (Statement Completion, Go to Definition, and so on).
21
21
22
22
For any of these scenarios, the **Linux development with C++** workload is required.
23
23
24
24
::: moniker-end
25
25
26
-
::: moniker range="vs-2019"
27
-
28
-
In Visual Studio 2019 you can specify separate targets for building and debugging. When targeting WSL, it is no longer necessary to add a remote connection or configure SSH.
29
-
30
-
::: moniker-end
31
-
32
26
::: moniker range=">=vs-2017"
33
27
34
28
## Visual Studio setup
@@ -41,39 +35,66 @@ In Visual Studio 2019 you can specify separate targets for building and debuggin
41
35
42
36

43
37
44
-
1. If you are targeting IoT or embedded platforms, go to the **Installation details** pane on the right, under**Linux development with C++**, expand **Optional Components** and choose the components you need. CMake support for Linux is selected by default.
38
+
1. If you are targeting IoT or embedded platforms, go to the **Installation details** pane on the right. Under**Linux development with C++**, expand **Optional Components**, and choose the components you need. CMake support for Linux is selected by default.
45
39
46
40
1. Click **Modify** to continue with the installation.
47
41
48
42
## Options for creating a Linux environment
49
43
50
44
If you don't already have a Linux machine, you can create a Linux Virtual Machine on Azure. For more information, see [Quickstart: Create a Linux virtual machine in the Azure portal](/azure/virtual-machines/linux/quick-create-portal).
51
45
52
-
On Windows 10, you can install and target your favorite Linux distro on the Windows Subsystem for Linux (WSL). For more information, see [Windows Subsystem for Linux Installation Guide for Windows 10](/windows/wsl/install-win10). WSL is a convenient console environment but is not recommended for graphical applications.
46
+
On Windows 10, you can install and target your favorite Linux distro on the Windows Subsystem for Linux (WSL). For more information, see [Windows Subsystem for Linux Installation Guide for Windows 10](/windows/wsl/install-win10). WSL is a convenient console environment, but is not recommended for graphical applications.
53
47
54
48
::: moniker-end
55
49
56
50
::: moniker range="vs-2019"
57
51
52
+
Linux projects in Visual Studio require the following dependencies to be installed on your remote Linux system or WSL:
53
+
-**A compiler** - Visual Studio 2019 has out-of-the-box support for GCC and [Clang](https://docs.microsoft.com/en-us/cpp/build/clang-support-cmake?view=vs-2019).
54
+
-**gdb** - Visual Studio automatically launches gdb on the Linux system, and uses the front-end of the Visual Studio debugger to provide a full-fidelity debugging experience on Linux.
55
+
-**rsync** and **zip** - the inclusion of rsync and zip allows Visual Studio to extract header files from your Linux system to the Windows filesystem for use by IntelliSense.
56
+
-**make**
57
+
-**openssh-server** (remote Linux systems only) - Visual Studio connects to remote Linux systems over a secure SSH connection.
58
+
-**CMake** (CMake projects only) - You can install Microsoft's [statically linked CMake binaries for Linux](https://github.com/microsoft/CMake/releases).
59
+
60
+
The following commands assume you are using g++ instead of clang.
61
+
62
+
::: moniker-end
63
+
64
+
::: moniker range="vs-2017"
65
+
66
+
Linux projects in Visual Studio require the following dependencies to be installed on your remote Linux system or WSL:
67
+
-**gcc** - Visual Studio 2017 has out-of-the-box support for GCC.
68
+
-**gdb** - Visual Studio automatically launches gdb on the Linux system and uses the front-end of the Visual Studio debugger to provide a full-fidelity debugging experience on Linux.
69
+
-**rsync** and **zip** - the inclusion of rsync and zip allows Visual Studio to extract header files from your Linux system to the Windows filesystem to use for IntelliSense.
70
+
-**make**
71
+
-**openssh-server** - Visual Studio connects to remote Linux systems over a secure SSH connection.
72
+
-**CMake** (CMake projects only) - You can install Microsoft's [statically linked CMake binaries for Linux](https://github.com/microsoft/CMake/releases).
73
+
74
+
::: moniker-end
75
+
76
+
::: moniker range="vs-2019"
77
+
58
78
## Linux setup: Ubuntu on WSL
59
79
60
80
When you are targeting WSL, there is no need to add a remote connection or configure SSH in order to build and debug. **zip** and **rsync** are required for automatic syncing of Linux headers with Visual Studio for Intellisense support. If the required applications are not already present, you can install them as follows:
61
81
62
82
```bash
63
83
sudo apt-get install g++ gdb make rsync zip
64
84
```
85
+
65
86
::: moniker-end
66
87
67
88
::: moniker range=">=vs-2017"
68
89
69
90
## Ubuntu on remote Linux systems
70
91
71
-
The target Linux system must have **openssh-server**, **g++**, **gdb**, and **gdbserver** installed, and the ssh daemon must be running. **zip**is required for automatic syncing of remote headers with your local machine for Intellisense support. If these applications are not already present, you can install them as follows:
92
+
The target Linux system must have **openssh-server**, **g++**, **gdb**, and **make** installed, and the ssh daemon must be running. **zip**and **rsync** are required for automatic syncing of remote headers with your local machine for Intellisense support. If these applications are not already present, you can install them as follows:
72
93
73
94
1. At a shell prompt on your Linux computer, run:
74
95
75
96
```bash
76
-
sudo apt-get install openssh-server g++ gdb gdbserver zip
97
+
sudo apt-get install openssh-server g++ gdb make rsync zip
77
98
```
78
99
79
100
You may be prompted for your root password due to the sudo command. If so, enter it and continue. Once complete, the required services and tools are installed.
@@ -83,6 +104,7 @@ The target Linux system must have **openssh-server**, **g++**, **gdb**, and **gd
83
104
```bash
84
105
sudo service ssh start
85
106
```
107
+
86
108
This starts the service and runs it in the background, ready to accept connections.
87
109
88
110
::: moniker-end
@@ -91,10 +113,10 @@ The target Linux system must have **openssh-server**, **g++**, **gdb**, and **gd
91
113
92
114
## Fedora on WSL
93
115
94
-
Fedora uses the **dnf** package installer. To download **g++**, **gdb**, **rsync** and **zip**, run:
116
+
Fedora uses the **dnf** package installer. To download **g++**, **gdb**, **make**, **rsync** and **zip**, run:
95
117
96
118
```bash
97
-
sudo dnf install gcc-g++ gdb rsync zip
119
+
sudo dnf install gcc-g++ gdb rsync make zip
98
120
```
99
121
100
122
**zip** and **rsync** are required for automatic syncing of Linux headers with Visual Studio for Intellisense support.
@@ -105,13 +127,14 @@ Fedora uses the **dnf** package installer. To download **g++**, **gdb**, **rsync
105
127
106
128
## Fedora on remote Linux systems
107
129
108
-
The target machine running Fedora uses the **dnf** package installer. To download **openssh-server**, **g++**, **gdb**, **gdbserver** and **zip**, and restart the ssh daemon, follow these instructions:
130
+
The target machine running Fedora uses the **dnf** package installer. To download **openssh-server**, **g++**, **gdb**, **make**, **rsync**, and **zip**, and restart the ssh daemon, follow these instructions:
109
131
110
132
1. At a shell prompt on your Linux computer, run:
111
133
112
134
```bash
113
-
sudo dnf install openssh-server gcc-g++ gdb gdb-gdbserver zip
135
+
sudo dnf install openssh-server gcc-g++ gdb make rsync zip
114
136
```
137
+
115
138
You may be prompted for your root password due to the sudo command. If so, enter it and continue. Once complete, the required services and tools are installed.
116
139
117
140
1. Ensure the ssh service is running on your Linux computer by running:
0 commit comments