Modes of C/C++ Remote Development in the IDE
October 2013 [Revision number: V7.4-1]
This article describes the remote development features available in the NetBeans IDE when you have the C/C++ module installed, and how to choose the best way to use them in your development environment.
What Remote Development Is
Remote development is a feature of the NetBeans IDE that allows you to run the IDE on a computer running Microsoft Windows, Mac OS X, Oracle Solaris, or Linux; and build, run, and debug your program on another computer running Oracle Solaris or Linux.
When to Use Remote Development
You might want to use remote development if some of the following circumstances are true for you:
How Remote Development Works
The IDE provides features for managing remote hosts. You can configure a remote host to use for building, running, and debugging your C, C++, and Fortran projects. The remote host must meet the following conditions:
You can manage your remote hosts in the Services window of the IDE.
Once you have configured the remote host and connected to it, you can build, run, and debug projects just as you do on your local system. Remote IDE commands are executed over SSH.
When you use a remote development host, the local and remote hosts both need to access the project files. This access can be accomplished through file sharing or securely copying the files. Before the IDE can use file sharing between the local and remote systems, the shared filesystem or folder must be set up and accessible to both systems. Remote files are accessed through SFTP or another file sharing mechanism available in the operating system the host is running (for example, Network File System (NFS), Samba, or WebDAV).
If file sharing is not possible, you can use Automatic Copying to copy the files to the server using SSH.
Benefits of Remote Development
Remote development provides the following benefits:
In simple mode, the source files reside primarily on your local host. When you build your project, the source files are delivered on demand to the remote host using SSH File Transfer Protocol (SFTP).
In mixed or shared mode, the source files reside in a location that is shared between the local host and remote host using NFS, Samba, WebDAV, or another file sharing system.
In full remote mode, the source files reside on the remote host. The IDE accesses the files using SFTP.
Deciding Which Remote Development Mode to Use
Which development mode is best for your specific situation depends on the development environment in which you work. Each of the following sections describes an example of a development environment in which one development mode provides the most benefits.
Simple mode might be the best remote mode for your needs if the following diagram describes your development environment.
In this environment, simple mode provides these benefits:
Mixed (Shared) Mode
Mixed or shared mode might be a good choice if your development environment resembles the one shown in the following diagram.
The benefits of using mixed mode in this environment are:
Full mode might be the best mode for you if your development environment resembles the one shown in the following diagram.
In this environment, the benefits of using full remote mode are:
Selecting Your Remote Development Mode
The remote development mode that you use is determined by the way you configure a remote build host, but also by the way you access the project in the IDE.
For each mode, you must first configure a remote build host, as described in the C/C++ Remote Development tutorial and in the IDE help.
You can select simple mode or mixed mode for your remote host in the IDE using the Host Properties dialog box to specify how project files should be accessed when you use the host.
Open the Services window, expand the C/C++ Build Hosts node, right click a remote host, and select Properties.
For simple mode, set Access project files via to Automatic copying.
You can right-click a project, select Set Build Host, and select the remote host that you have configured to access project files via automatic copying. Then you are using simple remote development mode. When you build the project, the project files will be copied automatically to your NetBeans user directory on the remote host.
For mixed mode, set Access project files via to System level file sharing.
You can right-click a project, select Set Build Host, and select the remote host that you have configured to access project files via system level file sharing. Then you are using mixed remote development mode. When you build the project, the project files stay where they are because they can be accessed from the local host and the remote build host.
Full remote mode
To use full remote mode in the IDE, use the Remote Development tool bar described in the following section.
Full Remote Development Using the Tool Bar
In full remote mode, you can use the IDE running on your local host to work on projects that are located on a remote host by using the remote development tool bar.
The tool bar is shown in the following figure.
If you do not see the tool bar in the IDE, you can display it by choosing View > Toolbars > Remote.
You can use the remote tool bar to select a remote host you have already configured and work on projects and files on the remote host the same as if they were local.
Use the icons as described in the following table.
Caches and Security
To provide fast access to remote files, the IDE uses a disk cache on the local system.
The cache is located in
See a description of the
When using remote development in simple and shared modes, only system headers will be accessed through the local cache so there is no security risk.
In full remote mode, although the files are located on the remote host, the project is parsed on the local computer.
As the source files are accessed for parsing, they are cached on the local host in
On mobile computers this might be considered a security risk. For increased security, the cache directory can be encrypted or can be deleted on a regular basis.
Caches that reside at
For More Information
See the following locations for more information: