The Cloud Foundry Blog

Working Offline with Micro Cloud Foundry

While the Micro Cloud Foundry documentation states that you can use its built-in dynamic DNS capabilities to connect to their Cloud Foundry instances from any online environment, it’s possible to use Micro Cloud Foundry in offline mode if you need to work without an internet connection in just a few steps.

First you need to configure the Micro Cloud Foundry VM to use NAT instead of the default bridged mode.

In the Micro Cloud Foundry console, select option 4 and enter ‘’ when it asks you for the token, which will configure it to use the domain that resolves to

It will take a a couple of minutes for the controller to reconfigure the Micro Cloud Foundry VM to use the domain.

Once it is done, the console will display the new domain and admin info on the screen.

After the update is complete, you will need to make some changes on your local system. What you will need to do is to set up an SSH tunnel to access your Micro Cloud Foundry VM (note that you will need to supply the IP address in the command below with the actual IP of your VM, which is displayed in the console).

sudo ssh -L 80: vcap@
vcap@'s password:Â

The first password being prompted is the sudo password for your machine, as it is needed to open port 80 which requires root privileges. The second password is the vcap user password which you entered during the initial configuration of your Micro Cloud Foundry.

When you are working offline, your laptop cannot do a remote DNS lookup for the * domain to return, so you will need to edit your local hosts file and add some entries:  localhost

You will also need one entry per application you deploy into the micro cloud.  For example, if your application is called “foo”, you need to add the following line:

Once you have finished adding the domain name entries, you are ready to use vmc to interact with your instance..

martin@vaccine$ vmc target
Succesfully targeted to []

martin@vaccine$ vmc register --email
Password: *****
Verify Password: *****
Creating New User: OK
Successfully logged into []

martin@vaccine$ vmc push foo -n
Creating Application: OK
Uploading Application:
  Checking for available resources: OK
  Packing application: OK
  Uploading (0K): OK
Push Status: OK
Staging Application: OK
Starting Application: OK

martin@vaccine$ curl
<h1>Hello from the Micro Cloud! via:</h1> 

We are working to streamline these steps even more to make working with Micro Cloud Foundry simple in both online and offline scenarios.  So stay tuned!

– The Cloud Foundry Team

This entry was posted in Cloud Foundry. Bookmark the permalink.

2 Responses to Working Offline with Micro Cloud Foundry

  1. Pingback: Removing the Operating System Barrier with Platform as a Service (PaaS), Part 2 - a guest post from Adron Hall | New Relic blog

  2. Alex De Lara says:

    Almost got it – when I use to open another shell on the MicroCloud, I can login, no problem and I can ping the cloud with “ping “, however, when I switch to the terminal of the laptop instead (running on a MacBook laptop), I keep getting “unknown host”, so I’m not sure where things are stopping, but seems that the Micro Cloud is not passing up to the DNS what I am expecting ( )
    I did a test with “host”, which returns: is an alias for is an alias for
    but none pings back …
    Tried also a “dscacheutil -flushcache” which seemed to work.
    Tried “curl″, it returns:
    So, clearly the Micro Cloud is not available outside the virtual machine.
    And at different stages, tried
    # vmc target
    Host is not available or is not valid: ‘’
    Would you like see the response? [yN]: y
    Cannot access target (getaddrinfo: nodename nor servname provided, or not known)

    What gives ??

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>