Stark & Wayne
  • by Dr Nic Williams

The primary purpose of TryCF is to have a dedicated Cloud Foundry running inside an AWS m3.xlarge VM.

But there is so much more you can do with it:

To kick start you along your exploration, this post will introduce some getting started tips for advanced TryCF usage!

Basic usage

First, kick off the TryCF provisioning with your AWS credentials, wait 15 minutes or so and look for the "getting started" email.

To recap, the basic usage for the included Cloud Foundry (as documented in the email you receive).

$ cf api --skip-ssl-validation
$ cf login

Email> admin
Password> admin

You will now be able to push/deploy Ruby/Java/Go/Node/Python/PHP apps (Python/PHP available with v175 onwards).

Target bosh-lite

The same VM running Cloud Foundry via above is also directly accessible as bosh-lite:

$ bosh target PUBLICIP trycf
Target set to `Bosh Lite Director'
Your username: admin
Enter password: admin

You may now be working with multiple BOSH targets, so your TryCF is aliased trycf. Retarget it anytime:

$ bosh target trycf

Newer stemcells

Since the TryCF AMI was last created a couple months ago, there is a new stemcell available.

Currently you have the following stemcell installed:

| Name                        | Version | CID                  |
| bosh-warden-boshlite-ubuntu | 53      | stemcell-07b2be32... |

To install newer Cloud Foundry or services you will need a new warden/bosh-lite stemcell.

To get the latest stemcell URL (which isn't as easy as it could be), you need to search through the BOSH stemcell artifacts website:


Pass the Download url to bosh upload stemcell command:

bosh upload stemcell

Edit Cloud Foundry deployment

You can also access the deployment manifest used to deploy Cloud Foundry, edit it and deploy the changes!

$ bosh deployments
| Name      | Release(s) | Stemcell(s) |
| cf-warden | cf/170     | ...         |

To download, edit and deploy:

$ bosh download manifest cf-warden cf.yml
$ bosh deployment cf.yml
$ bosh edit deployment
$ bosh deploy

Setup SSH

You can jump inside the TryCF VM and have a look around. This is also required for running bosh ssh commands to investigate deployments' jobs (see BOSH SSH section below)

You can now SSH:

$ ssh ubuntu@PUBLICIP -i ~/.ssh/trycf.pem

This is long and unwieldy. Instead, let's setup an alias:

$ ssh trycf

To do this, open/create ~/.ssh/config and add:

Host trycf
  Hostname PUBLICIP
  User ubuntu
  IdentityFile ~/.ssh/trycf.pem

Persistent SSH with MOSH

MOSH is better than the standard SSH client.

Remote terminal application that allows roaming, supports intermittent connectivity, and provides intelligent local echo and line editing of user keystrokes

In otherwords - a persistent SSH session.

To set it up:

$ ssh trycf
ubuntu$ sudo apt-get install python-software-properties
ubuntu$ sudo add-apt-repository ppa:keithw/mosh -y
ubuntu$ sudo apt-get update
ubuntu$ sudo apt-get install mosh -y
ubuntu$ exit

Next, download/install MOSH on your local machine - see list of options.

Finally, login into the AWS console and edit the trycf security group [direct link]


You can now use mosh instead of ssh:

$ mosh trycf

Test that the SSH connection self-heals by disabling internet access...


And then restoring it.



Now that you are inside the TryCF VM you also have access to the BOSH CLI and can now SSH into job VMs:

ubuntu$ rm -f ~/.ssh/known_hosts
ubuntu$ bosh login
ubuntu$ bosh download manifest cf-warden cf.yml
ubuntu$ bosh deployment cf.yml
ubuntu$ bosh ssh
1. ha_proxy_z1/0
2. nats_z1/0
3. postgres_z1/0
4. uaa_z1/0
5. login_z1/0
Find more great articles with similar tags trycf author-drnic