C/C++ Development pack tutorials: Remote Development
Under construction, this is draft.
This tutorial demonstrates how to use new feature of NetBeans 6.5: remote development for of C/C++ projects.
Did you ever wanted to develop Solaris or Linux application from you Windows Vista laptop? To test application on different Operating Systems without even leaving IDE? Or just to compile your large applications on fast multicore server rather then on your regular workstation. As the answer to all that needs the new Remote Development functionality is coming with new NetBeans 6.5 release.
Please, take a look at this tutorial to find out how to use this feature.
- Conceptions and requirements:
- connectivity: hosts/passwords/ssh
- sharing sources
- code model
- Setting up system
- Samba, SFU, shares
- Setting up IDE
- Creating new host
- Checking compiler sets, adding custom ones
- Code Model
- Creating new project and changing it to new host
- The End
Conceptions and requirements
Remote development works next way:
NetBeans IDE is run on your client machine and you can create projects, edit files, use Code Assistance features the same way as you do for local projects.
But if you start Build, Run or Debug routines they all will be run on remote server with output and input transfered to client machine. So, ideally, you shouldn't see any difference in workflow between doing local and remote development once you've set up remote host.
Both of your devices have to know about your sources. There are two best ways of making this possible:
- put sources on the shared network path
- keep sources on client machine and copy them to server if there are any changes
In NetBeans 6.5 we support only first option, but we are looking into support both. In the next section (Setting up system) you can find more details about ways to set up shared folders for different systems.
For all other data transfer between client and server is used SSH protocol. SSH (Secure Shell) is common protocol for secure communications between two networked devices.
Thus, your server has to have SSH server installed and run and SSH connection between client and server should be allowed.
Toolchains and Code Model
For correct support of all editor features like code completion, semantic highlighting, class view and others your project has to be used in the correct environment (which means system includes, macro definitions, platform, etc). All this information is gathered from remote server and stored locally for each server. You can manage toolchains for remote machine mostly the same way as for local one and Code Model will use corresponding environment.
Setting up system
Secure Shell server is usually included in Linux and Solaris packages and SSH server is run by default in most cases. If not, you can find information about installing and managing SSH here: http://en.wikipedia.org/wiki/Secure_Shell
Also SSH connection should be allowed between your client and server machines. Which usually means port 22 is open on both machines and firewall is set up to allow NetBeans to perfrom such connections. You may need root access or help of your system administrator if 22th port is disabled.
For Windows to Unix configuration there are two major way of sharing sources:
- Samba server on Unix system
- Windows Services for Unix (SFU) package installed on Windows system
Samba server allows Windows user to map shared NFS folders as network drives. It is included into most Linux and Solaris packages. If it's not your case you can download it from www.samba.org
Setting up Samba server is easy, although you'll need root access for this.
- Solaris setup: http://blogs.sun.com/timthomas/entry/enabling_and_configuring_samba_as
- Linux setup: http://www.linux.com/articles/58593
After starting Samba you can map folders from server the same way as you can do it from Windows.
Another option is Services For Unix. This is the set of utilities provided by Microsoft to access NFS filesystems from Windows. You can download them here: http://technet.microsoft.com/en-us/interopmigration/bb380242.aspx
Unfortunately for Windows Vista users this package is not available (except Vista Ultimate, which has it by default).
For connection between Unix/Linux boxes you don't need any special set up. You just need to have shared folder on one of the boxes or you can use your homedir.
Setting up IDE
1. Run IDE and go to Tools->Options->C/C++
You can find "Development Host:" combobox here. This is a list of servers you can use. For now there is only "localhost" there. Press "Edit" to add new one.
2. Type "Add" and setup new server there.