How to use Workstation 16 to run containers with vctl
I recently updated my VMware Workstation to 16 Pro and noticed in the release notes a cool additional feature that included that I will quickly cover to get an ITBODs started.
Within Workstation 16 and added a new Command Line Tool (CTL) “vctl” and support for KIND that's supported on Windows 10 1809 or later and enables Workstation support for container images as started in the “What's New”.
The new vctl tool allows you to build/run/pull/push Open Container Images (OCI) on your desktop and also provides support for kind.
Open Container Images is a Linux Foundation Project that designed industry standard container formats and runtimes.
KIND enables Workstation to use vctl container rather than Docker container as nodes and allows you to create and run local Kubernetes (K8S) clusters. It was designed primarily for testing K8S.
The 101 on Workstation 16 & vctl
Open Command Prompt or PowerShell and Navigate to your VMware Workstation path default is:
C:\Program Files (x86)\VMware\VMware Workstation\
Start by running the command below to list the supported commands:
Now we need to start the Container Runtime with the following command:
vctl system start
Following vctl start you will see the container storage has been setup in the following location:
So lets deploy our first container to test it out. Start with the following command :
vctl pull hello-world
vctl run hello-world
The output from our first container suggested we should try something more ambitious like Ubuntu so lets pull Ubuntu with the following command:
vctl pull ubuntu
vctl run -- name myContainerName -t -d ubuntu
Note: The (-t) Allocates a terminal for the container & (-d) Runs the container in the background
You can use the following commands to show the running containers and details.
vctl describe itbod-ubuntu
To gain access to a shell prompt on this new VM use the following command:
vctl execvm --sh -c myContainerName
Note: The (--sh) Opens shell to VM (-c) allows you to specify the name
When you have finished playing you can run the following command to cleanup and stop all running containers and runtime
vctl system stop -f c
vctl system info
Which will check the runtime has stopped. Finally at this point you can safely remove the .vctl folder mentioned earlier which is where the vctl utility stores its data.
So as you will see this really was a 101 the subject but one I plan to cover further, so for now I wish you all well and will just leave you with some handy links to feed you interest.