Install vSphere Integrated Containers v0.1 via VMware Photon OS TP2

I just wanted to share a few simple steps on how to set up vSphere Integrated Containers (VIC) v0.1 (released on April 4, 2016) on VMware Photon OS. You can follow most steps easily via copy and paste but please be aware that you should not run this in your production environment! I worked with a local installation running in VMware Fusion. The vSphere Integrated Containers Code on GitHub is in a preview state but please read the project status directly on GitHub. It also requires a few environmental variables to be available (e.g. DHCP). You can find the binaries for the install on Bintray as they are available as a pre-packaged .tar.gz file (direct download link).

First we need to install Photon OS TP 2 (fresh install from the ISO) and give it 1 CPU and 2GB of memory. I used the “full” install type while going through the installer. You can find the Photon OS TP2 ISO files on Bintray – I used the full ISO (direct download link). Cormac just told me that you can also use the “smaller” Photon OS or the OVA and add git, wget, tar and go to the OS as prerequisites for the install of VIC.

Why 2GB RAM? I ran into some issues (like “go build github.com/vmware/govmomi/vim25/types: /usr/lib/golang/pkg/tool/linux_amd64/6g: signal: killed”) while installing govmomi with less than 2GB. It was fixed by adding more memory – you should be able to go back to less than 2GB after the install.

After the install, we login via DCUI (e.g. via Fusion) and enable remote SSH access. You can either edit the sshd_config file with the editor of your choice of follow the commands below.

# Enable root login in /etc/ssh/sshd_config
sed -i 's/#PasswordAuthentication/PasswordAuthentication/g' /etc/ssh/sshd_config
sed -i 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config
systemctl restart sshd

Once you noted the IP address of your system, you can connect to it via ssh. I updated tdnf (Photon OS package manager) and the Photon OS system as a first action.

# Upgrade tdnf and Photon packages
tdnf upgrade tdnf -y
tdnf upgrade -y

Then, we set up a working directory for VIC, I called it “VCHmaster”.

# Create working directory /home/VCHmaster
mkdir /home/VCHmaster
cd /home/VCHmaster

Next up is the download and extraction of the VIC artifacts from Bintray (placed in /home/VCHmaster)

# Download files from https://bintray.com/vmware/vic/Download
wget https://bintray.com/artifact/download/vmware/vic/vic_0.1.0.tar.gz
tar -xzf vic_0.1.0.tar.gz
chmod +x vic/install.sh

Before installing govmomi, you need to set some environmental variables (GOPATH and adding the bin directory to your PATH):

# Set Go variables
mkdir /home/VCHmaster/govmw
export GOPATH=/home/VCHmaster/govmw
PATH=$PATH:/home/VCHmaster/govmw/bin

We can then install the vSphere API Go library:

# install Go library for the VMware vSphere API
go get github.com/vmware/govmomi/govc

At this point, we are all set to install the first Virtual Container Host (VCH). The command is pretty straight forward. All you need is a deployment endpoint (in my case my homelab ESXi host) with a datastore.

# install your first VCH
cd vic
./install.sh -g -t 'user:password@IP_ADDRESS' -i ESXi_datastore VCH-name

When we run the install.sh script, this is the output that we are seeing:

root [ /home/VCHmaster ]# ./install.sh -g -t 'root:PASSWORD@ESXi_IP_ADDRESS' -i ESXi_datastore VCH-name
# Generating certificate/key pair - private key in VCH-name-key.pem
# Logging into the target
# Uploading ISOs
[05-04-16 12:00:38] Uploading... OK
[05-04-16 12:00:41] Uploading... OK
# Creating vSwitch
# Creating Portgroup
# Creating the Virtual Container Host appliance
# Adding network interfaces
# Setting component configuration
# Configuring TLS server
# Powering on the Virtual Container Host
# Setting network identities
# Waiting for IP information
#
# SSH to appliance (default=root:password)
# root@VCH_APPLIANCE_IP_ADDRESS
#
# Log server:
# https://VCH_APPLIANCE_IP_ADDRESS:2378
#
# Connect to docker:
docker -H VCH_APPLIANCE_IP_ADDRESS:2376 --tls --tlscert='VCH-name-cert.pem' --tlskey='VCH-name-key.pem'


DOCKER_OPTS="--tls --tlscert='VCH-name-cert.pem' --tlskey='VCH-name-key.pem'"
DOCKER_HOST=APPLIANCE_IP_ADDRESS:2376

To make the variables persistent across multiple sessions, you’ll have to add these e.g. to your bash profile. I’ll keep it simple (edit in /root/.bash_profile):

# Begin ~/.bash_profile
# Written for Beyond Linux From Scratch
# by James Robertson <jameswrobertson@earthlink.net>
# updated by Bruce Dubbs <bdubbs@linuxfromscratch.org>


# Personal environment variables and startup programs.
GOPATH=/home/VCHmaster/govmw
PATH=$PATH:/home/VCHmaster/govmw/bin

At this point in time, there is not much more to explore. You run a few docker commands already but again – this a v0.1 with limited functionality.

(Edits: added the Bintray download links for VIC and Photon OS. Thanks Manuel & Cormac for your feedback!)

4 thoughts on “Install vSphere Integrated Containers v0.1 via VMware Photon OS TP2”

  1. I followed your tutorial and get this

    govc: network ‘VM Network’ not found with ./install.sh -g -t ‘user:password@IP_ADDRESS’ -i ESXi_datastore VCH-name

    Don’t have any clue why ??

    Thanks for help

  2. Sorry Stan, missed your comment in a huge amount of Spam.
    Seems like “VM Network” does not exist as a portgroup in your environment. You can pick another one or create a “VM Network”. Hope this helps!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.