WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • Apple

How to configure shared folders in VMware AppCatalyst?

10.02.2015 by William Lam // Leave a Comment

A widely used feature in VMware's hosted products (Fusion & Workstation) is the shared folders capabilities which allows you to easily share files between the host system and your Virtual Machines. With the latest release of VMware's AppCatalyst TP2, shared folders is now officially supported and can be configured using the AppCatalyst's REST API. Below are the instructions on setting up shared folders for your VMs running in AppCatalyst. Thanks to Fabio for sharing the details.

I will assume that you already have a VM that is running under AppCatalyst. If you do not, you can run the following commands to quickly deploy a new VM called "photon" from the default VMware Photon OS template and retrieve the IP Address assigned to the VM (which we will make use later).

/opt/vmware/appcatalyst/bin/appcatalyst vm create photon
/opt/vmware/appcatalyst/bin/appcatalyst vmpower on photon
/opt/vmware/appcatalyst/bin/appcatalyst guest getip photon

If you have not used AppCatalyst before, be sure to check out this getting started guide here.

Step 1 - Open a terminal and start the AppCatalyst Daemon by running the following command:

/opt/vmware/appcatalyst/bin/appcatalyst-daemon

Step 2 - Open a browser to connect to the following URL https://localhost:8080 to access the REST API explorer provided by Swagger.

Step 3 - Expand the POST /vms/{id}/folders which is the API to configure shared folders for a particular VM. You will need to fill in the id property which specifies the name of the VM and the state property defines the shared folder configuration.

Here is an example for creating a shared folder in the guest called "shared-folder" and mapping that to the host folder under /Users/lamw/Development. The flags property specifies how the folder will be accessed by the VM. Currently, there is only one flag implemented which is "4" and means read/write access. In the future there maybe more flags implemented for different types of access.

{
"guestPath":"shared-folder",
"hostPath":"/Users/lamw/Development",
"flags":4
}

Once you have entered the information into the UI, to execute the API request you just need to click on the "Try it out" button at the bottom. If the operation was successful, you should get back a 200 response from the UI.

Screen Shot 2015-10-02 at 9.33.31 AM
Note: The guestPath property is not actually a path in the VM but rather the name of the directory which will map to the host shared folder.

Step 4 - We can now login to our VM to confirm that the shared folder has been configured. If you are using the default Photon template, you can login by specifying the default SSH keys included with AppCatalyst and the IP Address of the Photon VM we deployed earlier.

Here is the command to login (be sure to replace with the IP Address from your enviornment):

ssh -i /opt/vmware/appcatalyst/etc/appcatalyst_insecure_ssh_key [email protected]

Step 5 - Once logged in, if we now look under /mnt/hgfs directory, we should now see the shared directory automatically created and mapped to the host shared folder we created earlier.

Screen Shot 2015-10-02 at 9.35.13 AM
If you wish to remove shared folders from a VM, you can do so by executing the DELETE /vms/{id}/folders/{folderId} API and specifying the id for both the VM and folder. Hopefully in the future, shared folders can also be easily consumed through the simple AppCatalyst CLI, but for now you can do so using the REST API.

Categories // Apple, Automation, Cloud Native Tags // appcatalyst, cloud native apps, DevOps, Docker, hgfs, Photon, shared folder

Quickly getting started with VMware AppCatalyst & AppCatalyst Vagrant Plugin

06.24.2015 by William Lam // 5 Comments

At Dockercon this week, the Cloud-Native Apps team at VMware introduced two new Tech Previews: VMware AppCatalyst and Project Bonneville. In addition, I also found out today that Fabio Rapposelli who works over in the CNA team has also released a Vagrant Plugin for VMware Catalyst as well. Having spent a couple of days playing with AppCatalyst before it was released, I thought this would be a good opportunity to show how to quickly get started with AppCatalyst but also to try out the new Vagrant Plugin that had just been released.

Before jumping in, What exactly is VMware AppCatalyst? It is a slimmed down desktop Hypervisor based on VMware Fusion that has been optimized for Developers who want to be able to quickly spin up Virtual Machines to run Docker Containers. Included with AppCatalyst is also VMware Photon, an open-source lightweight Linux container host that is used to quickly instantiate new VMs that are ready for running and building Docker Containers. Instead of a traditional GUI like VMware Fusion, AppCatalyst's is consumed completely via a REST API or CLI, which is also ideal for integrating with other 3rd Party Automation tools like Vagrant. Best of all, both VMware AppCatalyst & AppCatalyst Vagrant Plugin is completely Free!

Requirements:

  • Mac OS X 10.9.4 or 10.10
  • VMware Fusion must not be running

Quick INFO:

  • The AppCatalyst configuration file is located in ~/.appcatalyst.conf (if you wish to change system defaults)
  • The CLI to AppCatalyst is located at /opt/vmware/appcatalyst/bin/appcatalyst
  • The daemon for the AppCatalyst REST API is located at /opt/vmware/appcatalyst/bin/appcatalyst-daemon
  • SSH keys to the Photon VM is located in /opt/vmware/appcatalyst/etc/appcatalyst_insecure_ssh_key
  • Additional AppCatalyst Documentation can be found here

Exploring Appcatalyst CLI:

Step 1 - Download and install VMware AppCatalyst from here

Step 2 - Once AppCatalyst has been installed, you can explore the CLI and view the list of operations by running the following command:

/opt/vmware/appcatalyst/bin/appcatalyst

vmware-appcatalyst-vagrant-plugin-1
Step 3 - To create our first VM using AppCatalyst, run the following command:

/opt/vmware/appcatalyst/bin/appcatalyst vm create vGhetto1

vmware-appcatalyst-vagrant-plugin-2
Note: You will see that all VMs created by AppCatalyst will be stored in /Users/[USER]/Documents/AppCatalyst and you can change this by editing DEFAULT_VM_PATH in AppCatalyst configuration file

Step 4 - To power on our VM, run the following command:

/opt/vmware/appcatalyst/bin/appcatalyst vmpower on vGhetto1

vmware-appcatalyst-vagrant-plugin-3
Note: If you run into problems powering on your VM, there is a good chance that you may still have a VM that is running in VMware Fusion (also check docker-machine in case you are using that to power off any VMs provisioned using that tool)

Step 5 - Once the VM is powered on, we will probably want to retrieve the IP Address which could take a few seconds to be displayed by running the following command:

/opt/vmware/appcatalyst/bin/appcatalyst guest getip vGhetto1

Step 6 - Once we have the IP Address of our VM, we can then SSH to it using the SSH keys included with AppCatalyst by running the following command:

ssh -i /opt/vmware/appcatalyst/etc/appcatalyst_insecure_ssh_key [email protected]

vmware-appcatalyst-vagrant-plugin-5
At this point, you have successfully deployed a VM based on VMware Photon image using the AppCatalyst's CLI. You can now login and start running and building Docker Containers as Docker is already pre-installed on Photon. Next we will take look at using the AppCatalyst API.

Exploring Appcatalyst API:

UPDATE (01/22/16) - For the complete cheatsheet of using AppCatalyst API using cURL, check out this article here for more examples.

Step 1 - To use the AppCatalyst REST API, you will need to run the AppCatalyst Daemon by running the following command:

/opt/vmware/appcatalyst/bin/appcatalyst-daemon

vmware-appcatalyst-vagrant-plugin-6
Note: You can also run the AppCatalyst daemon in the background by adding '&' to the command

Step 2 - You can easily view the AppCatalyst API by opening a browser to http://localhost:8080 (assuming you did not change the port) which is built using Swagger. You can explore and even test the API using this interface if you have not worked with a Swagger interface before.

vmware-appcatalyst-vagrant-plugin-7
Step 3 - Lets quickly test the GET /vms operation which will list the VMs that are being managed by AppCatalyst. We will be using cURL by running the following command:

curl http://localhost:8080/api/vms

vmware-appcatalyst-vagrant-plugin-8
As long as the AppCatalyst daemon is running, you will be able to interact with the REST API using a variety of methods including the examples I have shown above.

Note: A known issue is that VMs powered on using the AppCatalyst API can not be managed by the CLI until they have been powered down using the API. Hopefully this issue will be resolved in a future update.

Exploring Appcatalyst Vagrant Plugin:

Step 1 - Ensure you have Vagrant already installed on your system, if not you can download it here.

Step 2 - Install the Vagrant Plugin by running the following command:

vagrant plugin install vagrant-vmware-appcatalyst

vmware-appcatalyst-vagrant-plugin-9
Step 3 -  You can either run "vagrant init" or manually create a file name Vagrant file that contains the following:

# Set our default provider for this Vagrantfile to 'vmware_appcatalyst'
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'vmware_appcatalyst'

nodes = [
  { hostname: 'gantry-test-1', box: 'vmware/photon' },
  { hostname: 'gantry-test-2', box: 'vmware/photon' }
]

Vagrant.configure('2') do |config|

  # Configure our boxes with 1 CPU and 384MB of RAM
  config.vm.provider 'vmware_appcatalyst' do |v|
    v.vmx['numvcpus'] = '1'
    v.vmx['memsize'] = '384'
  end

  # Go through nodes and configure each of them.j
  nodes.each do |node|
    config.vm.define node[:hostname] do |node_config|
      node_config.vm.box = node[:box]
      node_config.vm.hostname = node[:hostname]
    end
  end
end

The above Vagrant file will create two VMs called gantry-test-{1,2} using the VMware Photon Box hosted on Atlas by HashiCorp.

Step 4 (Optional) - If you decide to use the example above with VMware Photon Box, you will need to install an additional Vagrant Plugin for managing Photon Guest by running the following command:

vagrant plugin install vagrant-guests-photon

Step 5 - Ensure that the AppCatalyst daemon is running before proceeding with the next step as the Vagrant Plugin uses the AppCatalyst REST API.

Step 6 - To start the deployment, run the following command:

vagrant up --provider=vmware_appcatalyst

Screen Shot 2015-06-24 at 2.11.20 PM
Step 7 - To login to one of the VMs that have been created by Vagrant, simply run the following command and specify the name of the VM to SSH to:

vagrant ssh gantry-test-1

vmware-appcatalyst-vagrant-plugin-11
Step 8 - Finally, we can also confirm that the VMs created by the AppCatalyst Vagrant Plugin is also visible using just the AppCatalyst REST API and we can perform another "GET" operation to verify the two VMs that we had just created.

vmware-appcatalyst-vagrant-plugin-12
Hopefully this quick primer has been useful in getting you introduced and started with VMware AppCatalyst as well as the new AppCatalyst Vagrant Plugin. If you have any feedback or questions, feel free to leave a comment in the VMware AppCatalyst Forum and for feedback/questions on AppCatalyst Vagrant Plugin, you can file issues here.

Categories // Apple, Automation, Cloud Native, Docker Tags // appcatalyst, cloud native apps, DevOps, Docker, Photon, Vagrant

Collection of VMware Project Photon & Lightwave Resources/Links

04.20.2015 by William Lam // 1 Comment

Today is a very exciting day for VMware and later this morning, the new Cloud Native Apps team under Kit Colbert will be hosting an online event (replayed of the event will be posted here) to talk more about Next-Generation Apps on VMware as well as diving into more details on two specific initiatives that have recently been open sourced: Project Photon and Lightwave. In anticipation of the flood of information, I thought it would be useful to aggregate all the resources, links and articles in a single place for ease of consumption. This page will be updated through out the day, let me know if there is anything I am missing.

Cloud Native Apps Team

  • Official Blog Announcement: Cloud-Native Apps: Making the Developer a First-Class User of the Datacenter
  • Official Twitter: @cloudnativeapps
  • Follow Cloud Native Apps members on Twitter using this CNA List: https://twitter.com/lamw/lists/vmware-cloud-native-apps1
  • VMware Open Source GitHub: http://vmware.github.io/

 Photon

vmware-photon
Photon is an open-source lightweight Linux container host runtime optimized for running containers optimized for VMware’s hypervisor.

  • VMware Official Blog Announcement: http://blogs.vmware.com/cloudnative/introducing-photon/
  • YouTube Demo: https://www.youtube.com/watch?v=ZA6flb7otNg
  • Github: https://vmware.github.io/photon/
    • Instructions to deploy on vSphere 5.5 & 6.0
    • Instructions to deploy on Workstation/Fusion
    • Instructions to deploy on vCloud Air
    • Instructions to deploy on Google Compute Engine
  • Twitter: @vmwarephoton
  • VMTN Community Forum: https://communities.vmware.com/community/vmtn/devops/project-photon
  • Google Group for Developers: https://groups.google.com/forum/#!forum/vmware-photon-dev
  • Google Group for Announcements: https://groups.google.com/forum/#!forum/vmware-photon-announce
  • FAQ: https://github.com/vmware/photon/wiki/Frequently-Asked-Questions

 Lightwave

vmware-lightwave
Lightwave is an open-source container identity and access control solution.

  • VMware Official Blog Announcement: http://blogs.vmware.com/cloudnative/introducing-lightwave
  • YouTube Demo: https://www.youtube.com/watch?v=CWmE_Rl3ELc
  • Github: https://vmware.github.io/lightwave/
  • Twitter: @vmwarelightwave
  • VMTN Community Forum: https://communities.vmware.com/community/vmtn/devops/project-lightwave

Partner Integration News:

  • CoreOS - VMware Ships rkt and Supports App Container Spec
  • HashiCorp - Vagrant Up and Running with VMware’s Project Photon
  • Mesosphere - We’re tackling container security at scale with VMware
  • Pivotal - Lattice – Container Clustering Simplified

Community Blog Articles

  • Josh Gray - Introducing VMware Project Photon
  • Andrew Mauro - VMware cloud-native applications vision
  • Vladan SEGET - VMware Cloud-Native Applications: Lightwave, Photon and more…
  • Forbes - VMware Introduces New Open Source Projects To Enable The Microservices Future
  • Chris Mutcher - Thoughts on the VMware Project Photon Announcement
  • Eric Wright - Fire Photon Torpedoes! Getting Started with VMware Photon Linux
  • The Register - VMware fires Photon torpedo – a homegrown Linux for microservices
  • Virtualization Review  - VMware Launches Two Open Source Container Projects
  • TechRepublic - New VMware open-source tools make Docker safe for the enterprise
  • ComputerWorld - VMware preps its virtualization stack for Docker
  • InformationWeek - VMware Rides Container Wave With Open Source Projects
  • ITWorld - VMware prepares its virtualization stack for Docker
  • SDX Central - VMware Creates Its Own Linux OS for Containers
  • MartijnBaeck - Project Photon and Lightwave, the start of a new VMware era
  • Scott Lowe - Running Photon on Fusion via Vagrant
  • Anthony Spiteri - VMware Photon: vCloud Air Network Deployment
  • Melissa Palmer - Lightwave and Photon Measured from a Rocket, VMware Enhances Cloud-Native Apps
  • Jacob Ludriks - Trying out Docker with VMWare Photon and Docker CLI for Windows
  • Romain Decker - Getting Started with VMware Project Photon

Categories // Automation, Cloud Native, Docker Tags // cloud native apps, container, DevOps, LightWave, Photon

  • 1
  • 2
  • Next Page »

Search

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • Self-Contained & Automated VMware Cloud Foundation (VCF) deployment using new VLC Holodeck Toolkit 03/29/2023
  • ESXi configstorecli enhancement in vSphere 8.0 Update 1 03/28/2023
  • ESXi on Intel NUC 13 Pro (Arena Canyon) 03/27/2023
  • Quick Tip - Enabling ESXi Coredumps to be stored on USB 03/26/2023
  • How to disable the Efficiency Cores (E-cores) on an Intel NUC? 03/24/2023

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2023

 

Loading Comments...