Last week during lunch I learned about a cool little project that my colleague Alan Renouf was working on in his spare time at night. He was interested in learning more about Docker and thought the best way to learn about something new was by using it, which is normally how I learn as well. He came up with a nifty idea to create a Docker Image that would house a bunch of useful VMware tools which included several VMware open source projects as well.

Some customers in the past have built similar offerings by using a free VMware Appliance called vMA (vSphere Management Assistance). vMA is nothing more than a stripped down version of SLES that has the vSphere CLI (vCLI) pre-installed. In my opinion, vMA is pretty limited and you can not install additional packages without voiding official support. Even if you decide to ignore support and install custom packages, I have often seen this break existing dependencies. When I talk to customers about their use of vMA, most used it because it was just there, but the majority prefer to use their own harden distribution of Linux and install their own admin utilities and packages which may also include non-VMware tools.

I personally have no problem building my own VM appliance that contains the various VMware packages, utilities and scripts that I use on a daily basis. However, not everyone is comfortable with this idea. Wow could this be further simplified and automated? Well, enter vmware-utils a Docker Image that allows you to automatically build a new image that contains some of the most popular and widely used VMware Utilities.

I wanted to enhance the awesome work that Alan had done with couple more VMware open source tools that I thought might be useful to VMware Administrators, which I actually wrote about here in my List of VMware CLIs, SDKS and DevOps Tools article. I have already submitted a pull request for my changes here. If there are other tools or packages you think that are useful and wish to contribute back, feel free to clone the repository and submit a pull request!

The latest vmware-utils now contains the following (highlighted in blue are the utilities I have added):

  • VMware vSphere vCLI
  • VMware OVF Tool
  • William Lam's vGhetto Script Repository
  • vSphere SDK for Ruby (rbVmomi)
  • vSphere SDK for Python (pyVmomi)
  • vSphere SDK for Go (goVmomi)
  • govc CLI
  • vSphere Ruby Console (RVC)
  • vSphere Virtual Disk Manager (VDDK)
  • vCloud Air CLI (vca-cli)
  • vCloud Air Recovery as a Service CLI (RaaS)
  • vCloud SDK for Python
  • vCloud Tools
  • vRealize Cloud Client

For those of you who are new to Docker, a great way to quickly get started is by using an awesome tool called boot2docker which allows you to run Docker Containers on either a Windows or Mac OS X system. This also helps remove any barriers if you do not want to setup a Linux machine to get Docker of if you are like me, running on Mac OS X and rather not have to spin up a VM just to use Docker. Below are the steps on getting boot2docker working and building your own vmware-utils Docker Image.

Step 1 - Download and install boot2docker

Step 2 - Take a look at the vmware-utils README, I spent some time updating it to make it more consumable for new users of Docker and follow the "How" section which will have you download the 4 VMware utilities as well as the vmware-utils DockerFile which we will need to build the Docker Container.

Step 3 - Create a directory and place all 5 files into that directory. In this example, I have called the directory "vmware-utils".

vmware-utils-docker-container-0
Step 4 - We need to now initialize boot2docker by running the following command:

boot2docker init

vmware-utils-docker-container-2
Step 5 - We can confirm the operation was successful by running the following command and we should see the details of our Docker VM:

boot2docker info

vmware-utils-docker-container-1
Step 6 - We will now start our Docker VM by running the following command:

boot2docker start

vmware-utils-docker-container-3
If this is your first time using boot2docker, you will be asked to set several environment variables. Go ahead and just copy and paste it back into the console.

Step 7 - We are now ready to build our vmware-utils Docker Image. Change into the "vmware-utils" directory that contains the files you downloaded earlier we will need to specify a "tag" for our image as part of the build command. In this example, I have called my image "lamw/vmware-utils" and to start the build process run the following command:

docker build -t lamw/vmware-utils .

Step 8 - The build itself may take some time depending on the speed of your internet connection. You will know when it has successfully completed when it states "Successfully built X" where X will be some unique ID as seen in the screenshot below.

vmware-utils-docker-container-4
Step 9 - Once the Docker Image has finished building, you can then run and connect to the Container by running the following command:

docker run --rm -it lamw/vmware-utils

vmware-utils-docker-container-5
At this point, you are now logged into the vmware-utils Docker Container that you have just built! It contains all the VMware Utilities that I have listed earlier and for more details on what has been installed and the location of the utilities, take a look at the vmware-utils Github documentation. If there are other tools you would like to see, feel free to contribute back by cloning the repository and submitting a pull request. I am definitely looking forward to seeing how this project evolves and providing a more dynamic way of creating a vMA-like experience without the current limitations. Keep up the awesome work Alan!

9 thoughts on “Cool Docker Container for VMware Utilities

  1. Hey William, I’m getting an odd error while trying to get this running the initial docker build. Any ideas?

    Step 16 : RUN go get github.com/vmware/govmomi/govc
    —> Running in 00478e442e4f
    # github.com/vmware/govmomi/vim25/soap
    src/go/src/github.com/vmware/govmomi/vim25/soap/client.go:68: unknown net.Dialer field ‘KeepAlive’ in struct literal
    src/go/src/github.com/vmware/govmomi/vim25/soap/client.go:74: c.t.TLSHandshakeTimeout undefined (type *http.Transport has no field or method TLSHandshakeTimeout)
    2015/04/08 21:46:39 The command [/bin/sh -c go get github.com/vmware/govmomi/govc] returned a non-zero code: 2

  2. Step 23 : RUN gem install –no-rdoc –no-ri vcloud-tools
    —> Running in 89a31d05672f

    I wonder if this is broke as well now ?

    as I get this…

    —> Running in 89a31d05672f
    ERROR: While executing gem … (Gem::DependencyError)
    Unable to resolve dependencies: vcloud-tools requires vcloud-core (>= 0); vc
    loud-walker requires vcloud-core (~> 1.0.0); vcloud-net_launcher requires vcloud
    -core (~> 1.1.0); vcloud-launcher requires vcloud-core (~> 1.1.0); vcloud-edge_g
    ateway requires vcloud-core (~> 1.0.0)
    The command ‘/bin/sh -c gem install –no-rdoc –no-ri vcloud-tools’ returned a n
    on-zero code: 1

Thanks for the comment!