If you’ve been following the EclipseCon these days you‘ve read a new web IDE called Eclipse Che has been launched. As it could not be otherwise, I‘ve been playing with it, seeing how it would be possible to host it on Microsoft Azure. In this post I tell you how to do it.
For now the new IDE does not use any credential for access, so you should be careful so that it is not exposed to the Internet. After thinking of different solutions I have chosen to take advantage of the virtual network, which the Linux virtual machine belongs, to make a VPN connection point to site access. Here are all the steps:
First you need to create a Virtual Network (classic) through the portal. For my demo, I have used a reduced range.
As Eclipse Che relies on Docker to manage its architecture, you can use one of the images of the gallery that already have everything you need. Click on New > search Docker > select Docker on Ubuntu Server.
This is the configuration of my machine:
- I’ve selected the network that I’ve just created, eclipse-che-vnet.
- Changed the type of machine to A3 (4 Cores and 7 GB of RAM).
- Selected the same group of resources that I used for the vNet, in my case Eclipse-Che.
Now you must update the vNet to allow connections using point to site, in order to be able to connect to the same network as this machine, and not have to expose all the ports required by Eclipse to the world. Access to the Virtual Networks (classic) section, select the new VNet and click on You don’t have any existing VPN connections. Click here to get started.
Add a range for the clients that will access the network. You can also take this step to create a gateway during the creation through the option Create gateway immediately.
From the server’s point of view, the last step is to create a container with Eclipse Che on your machine with Docker. For this purpose you can use PuTTY, which lets you connect via SSH to the machine, using the DNS name or the public IP assigned.
Use any of them in PuTTY, port 22, and the credentials that you set when you created the machine.
Thanks to Eclipse Che documentation you can get the parameters you need to configure the server. For this example are as follows:
docker run -ti --net=host -v /var/run/docker.sock:/var/run/docker.sock -v /home/user/che/lib:/home/user/che/lib-copy -v /home/user/che/workspaces:/home/user/che/workspaces -v /home/user/che/tomcat/temp/local-storage:/home/user/che/tomcat/temp/local-storage -e CHE_DOCKER_MACHINE_HOST=192.168.0.4 codenvy/che
As you can see in the above command, I am using the environment variable CHE_DOCKER_MACHINE_HOST that allows me to indicate what the IP address is of the Eclipse Che’s host. If you run it you‘ll see that it will download the image and, once the installation is complete, start the Tomcat which hosts the environment.
The process is complete when the Tomcat is up and running.
Ok, so now you have your environment ready to start playing. The only outstanding point is to connect to the same vNet from your local machine through the point to site that you generated. You can generate a certificate by yourself through the following makecert command (if you have installed Vistual Studio you can use this command from the Developer Command Prompt):
makecert -sky exchange -r -n "CN=RootCertificateName" -pe -a sha1 -len 2048 -ss My "RootCertificateName.cer"
Upload the certificate you’ve just generated.
Now, you need to generate the client certificate that you must install on your machine to gain access. You can do so via this command:
makecert.exe -n "CN=ClientCertificateName" -pe -sky exchange -m 96 -ss My -in "RootCertificateName" -is my -a sha1
Finally, install the VPN client on your machine to access the network.
Access the Windows VPN section and connect to which you just installed.
To access the Eclipse Che Dashboard, simply use the VM’s IP followed by port 8080 in your browser.
To check that everything works correctly, try to create a new project, where you can choose the stacks of Java, Node, PHP, ASP.NET or a blank project.
Depending on the type of project you choose, during the creation it will download and configure an image with everything you need for that workspace.
Once Eclipse Che has finished generating the workspace and project you can access the IDE via the OPEN PROJECT IN IDE option.