Latest updates for C++ Remote Linux Development in Visual Studio: Remote File Explorer, Integrated Terminal, and more…
Visual Studio allows you to target your remote Linux machines so that you can still use Visual Studio’s build and debugging suite for all your remote workflows just like how you would develop locally without having to leave the IDE. To further enhance your ability to develop remotely for C++ from Visual Studio, we have added a new Remote File Explorer to perform file operations on your remote machine, an integrated SSH terminal to access your remote targets, and an automated experience to install Windows Subsystem for Linux (WSL) and build tools. Additionally, we have added support to run remote Linux tests from the Test Explorer.
To access the full Linux support for C++ in Visual Studio, download it via the Linux and embedded development with C++ workload.
Remote File Explorer
The Remote File Explorer allows you to access your files and folders on your remote machines that you are connected to through the Connection Manager without having to leave the IDE. In C++ projects, Visual Studio will automatically detect all WSL connections when you use CMake Presets to build your project. To add a new remote connection to a machine that isn’t WSL through the Connection Manager, please see our documentation.
To access the Remote File Explorer, navigate to View > Remote File Explorer in Visual Studio after downloading it through the Linux and Embedded Workflow in the VS Installer.
You can perform file operations from here such as:
- Viewing your files
- Editing your files
- Searching for your files and navigating to the remote path
- Uploading files
- Downloading files
- Viewing the output of file operations
To learn more about the Remote File Explorer’s capabilities, please see our blog post announcements: View files on your Remote Machines using the new Remote File Explorer in Visual Studio – C++ Team Blog (microsoft.com) and What’s New for the Remote File Explorer in Visual Studio – C++ Team Blog (microsoft.com). If there is anything you would like to see added to this view, please comment on our open feedback ticket here.
Users can now leverage the Visual Studio’s integrated terminal to access their remote targets when developing for remote machines from Windows, via an interactive SSH shell. It can be accessed by going to View>Terminal.
Instead of having to start a separate SSH session inside of PowerShell or WSL and having to re-authenticate, you can select one of your existing connections from the Connection Manager or WSL. You only have to authenticate once when you add a stored connection. To add a new remote connection to a machine that isn’t WSL through the Connection Manager, please see our documentation. In the upper-left corner of the integrated terminal, you can click on the SSH connection and see the options enumerated from your Connection Manager.
Additionally, the new integrated terminal now supports manipulating files, running background tasks, configuring your remote system, and testing your deployed code all from inside of VS instead of having to use an external SSH client. This terminal also supports color and command sequences, so for example, copy, paste, and find shortcuts will work, as well as interactive programs like vim.
For more information, please see our blog post here.
Automatically Install WSL from Visual Studio
Downloading WSL and its associated dev tools is now easier than ever, so you can get started with Linux development and spin up a new WSL instance with a few simple clicks.
All you need to do is navigate to Project > Install WSL For Me.
From there, an installation dialog will pop up that will automatically check the status of the pre-requisites on your machine. After the pre-requisites are run and all pass, the installation process will kick off.
At the end, you can select “Finish” and the new WSL machine will be installed with all the build tools you need for development after you complete a reboot. You can then target this machine from your existing project to get started with Linux development or provision a new machine.
Added support for remote Linux unit tests in Test Explorer
In partnership with some of our customers such as the Azure Networking team, we have added support for remote Linux unit tests to be run and debugger from the Test Explorer in CMake projects. Now, when you target Linux, you can use the Test Explorer in Visual Studio like you would locally. To open this view, you can navigate to Test > Test Explorer.
Read more about our partnership in our blog post.
We appreciate the time you’ve spent reporting issues/suggestions and hope you continue to give us feedback when using Visual Studio on what you like and what we can improve. Your feedback is critical to help us make Visual Studio the best tool it can be! You can share feedback with us via Developer Community: report any bugs or issues via report a problem and share your suggestions for new features or improvements to existing ones.