Skip to content

Latest commit

 

History

History
124 lines (89 loc) · 6.72 KB

File metadata and controls

124 lines (89 loc) · 6.72 KB
tag
codenvy
title Using Desktop IDEs
excerpt
layout docs
permalink /:categories/using-desktop-ides/

{% include base.html %}

Standard SSH Connection

It's possible to establish SSH connection between your desktop IDE and a remote Codenvy workspace.

In Codenvy create a new workspace, open it in the IDE and import any project in there. On the Consoles panel click Connect via SSH:

user-using-desktop-ides-ssh.png{:style="width:400px"}

You will see the following instr

You can connect your SSH client to 'default' with:

[LINUX | OSX]
ssh user@${hostname} -p ${port} [-i /path/to/your/private/ssh/key]

[WINDOWS]
putty -ssh -l user -P ${port} ${hostname} [-i /path/to/your/private/ssh/key]

USERNAME: user
PASSWORD: secret

NOTES:
1. You can login with user / password, but it is not recommended.
2. Use an SSH key pair to securely authenticate.
3. You can generate new SSH key pairs at `Profile -> Preferences -> SSH -> Machine`
4. Or, you can upload your own public key.
5. You must restart your workspace for the keys to take affect.
6. You can verify your key by opening a terminal and viewing `/home/user/.ssh/authorized_keys`

WINDOWS USERS:
1. Download Putty and add it to your %PATH% environment.
2. Use PuttyGen to convert SSH keys generated by Che to putty PPK files.
3. Use the Putty .ppk file as the key reference.

Follow the below steps to connect to a remote Codenvy workspace from the local IDE on Linux:

  1. When in the Codenvy IDE, go to Profile > Preferences > Machine > SSH and upload your local public key there. Restart a workspace.

  2. Open your local Terminal and execute sshfs user@${hostname}:/projects /your/local/directory/ -p ${port}, where ${port} is a random port from the ephemeral port range, to which 22 port is mapped (you can find it on the Consoles panel > SSH or at the Operations Perspective > Servers tab). This command will mount /projects folder to your local directory.

  3. Check the local directory to verify if your Codenvy projects are there.

  4. Open your favorite local IDE and import your Codenvy project.

  5. Make some edits in the project.

  6. Go to a Codenvy workspace to verify changes are there.

Video - SSH Export Eclipse IDE

Mount and Sync

Beta

This method uses a Docker container with a sync mechanism inside to keep the Codenvy workspace and local filesystems aligned. If going offline the Docker container will have to be stopped and then restarted when back online. If you experience issues please let us know at: https://github.com/codenvy/codenvy/issues.

##HOW We provide a Docker container which acts as a bridge between your workspace and the local host file system. Inside of the che-mount Docker container, we will create an sshfs connection to the remote workspace using your user name, password, and workspace port number. Inside of that Docker container, we then use unison, a high performance file system synchronizer to synchronize the contents of the remote workspace with a directory within the container. Your local host will then volume mount the synchronized directory, for which those files appear. The unison synchronizer is run every minute, and will capture both changes made locally on your host and any changes made in the remote workspace. You can perform a mount on any operating system that supports Docker. However, if you are on Windows using Boot2Docker, then you can only mount directories in %userprofile%.

This particular approach is fast because your local IDE has local I/O performance for all file actions. The synchronizer runs in the background asynchronously, and synchronizes your local changes into the workspace. The reverse course is true as well. This asynchronous approach provides a non-blocking I/O performance that is essential.

##USE In the IDE, open the “Consoles” panel and press “SSH”. Here you will find information you will need:

  • The default user name / password
  • The IP of the codenvy server = <codenvy-server-ip> in the Docker command below
  • The ephemeral port for SSH = <codenvy-server-ssh-port> in the Docker command below

Capture all three of these items. ScreenShot2016-08-02at8.18.23AM.png Using Docker launch the che-mount container, pass in the information you captured from the SSH screen:

# Launch the Che mount container with your Codenvy instance
docker run --rm -it \
					 --cap-add SYS_ADMIN \
           --device /dev/fuse \
           --name codenvy-mount \
           -v /c/Users/%USERNAME%/mount:/mnthost \
           codenvy/che-mount <codenvy-server-ip> <codenvy-server-ssh-port>

# Verify directories in Docker container
docker exec -ti che-mount sh
>ls /mnthost
>ls /mntssh
>exit

# Verify host directory
bash
> ls /c/Users/%USERNAME%/mount

# where <your-docker-host-ip> is the IP address your Docker daemon is bound to.
# You can determine this IP by
docker run - -rm - -net host \
            alpine sh -c \
            “ip a show <network-if>"

# where <network-if> is ‘eth0’, or if using boot2docker, then ‘eth1’.

Once started the container will ask for the username and password.

Once started you can connect your IDE to the mounted directory on your local filesystem.

Video - Mount Local Desktop Directory to Codenvy IDE

Mount Without Sync

If you just want to mount the remote workspace to a local directory, you can do so with sshfs. Mounting will allow all file system writes to take place immediately. However, all changes are sent over the network. If the workspace and desktop IDE are both on the same machine or local network, then this method may be preferred. However, the greater the network latency, the slower the sync will be.

You can still use your local IDE with the local file mount. You may want a local file mount instead of a sync if you want to eliminate the risk of any synchronization conflicts from clients accessing the same file system locally and remotely within the workspace at the same time.

Windows users can use sshfs by installing free software win-sshfs for Window versions up to 7 or by purchasing software such as SFTP Net Drive for Windows 8.0, 8.1 or 10. Mac users can use sshfs by installing free open source software FUSE and associated sshfs extension. Linux has sshfs built into it kernel so most Linux distributions require a small sshfs package to be installed.

# On Linux & Mac - first install sshfs.  Then:
sshfs -p <ws-ssh-port> user@<che-ws-ip-address>:/projects /mnt/che