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

Using vSphere Guest Operations API on macOS Guests? 

07.05.2017 by William Lam // 2 Comments

I have written a number of articles exploring the usage and some of the cool tricks that the vSphere Guest Operations (GuestOps) feature provides which you can be found here, here, here and here. I have been a huge fan and supporter of GuestOps since the early days where it was formally known as the VIX API. Having used GuestOps across many different GuestOS types including Nested ESXi, I have to admit, I had never tried it against an Apple macOS guests. I recently had a customer reach out who was looking to use the GuestOps API via PowerCLI (Invoke-VMScript) to automate updates against his guestOS templates that span across Windows, Linux and macOS (from 10.7 to latest). The customer was able to get all guestOSes working except for macOS.

Since I had never tried this before, I spun up my Apple Mac Mini which happen to have a macOS 10.11 (El Capitan) guests running. I tried using the vSphere API GuestOps directly to see if this was a PowerCLI and/or API issue. I too ran into issues and after enabling VMware Tools debugging on the guests (which you can find more details below), I found that it hit the following error:

[Jun 28 06:35:42.805] [   debug] [vix] >VixToolsImpersonateUser
[Jun 28 06:35:42.925] [ warning] [vmsvc] Failed to set gid for user root

Reaching out to Engineering regarding the problem, I came to learn that this particular issue was due to a syscall change made by Apple starting with macOS 10.10.3 and newer. Although the change was a positive thing from a security standpoint, it did break the GuestOps functionality. The good news was that this was already resolved with VMware Tools 10.1 or later. When I had initially provisioned the macOS guests, the latest VMware Tools at the time was 9.10.5. After I applied the latest version which is currently 10.1.7, the issue went away and I was able to successfully use the GuestOps API on my macOS guests.

Below are examples of running the system_profiler SPSoftwareDataType command using both the Invoke-VMScript cmdlet as well as the vSphere API and PowerCLI to consume the GuestOps APIs. Both approaches delivers the exact same outcome, the one benefit of using Invoke-VMScript is that if you want to easily return output from a given command, the cmdlet already does the heavy lifting. If you notice in the native vSphere API case, you do not get output but rather just the PID ID. If you want to return the output, you need to first save it into a file and then download the file to your client system, which may not be ideal for interactive usage but it all depends on your use case.

[Read more...]

Categories // Apple, Automation Tags // apple, guest operations, macOS, osx, vix api, vmware tools

VMXNET3 driver now included in Mac OS X 10.11 (El Capitan)+

10.01.2016 by William Lam // 15 Comments

Yesterday I received a pretty interesting comment from one of my Twitter followers @NTmatter who wrote:

@lamw Just noticed that OSX has a VMXNET3 driver. Have to edit the vmx file to actually use it, but it's there! AppleVmxnet3Ethernet.kext

— Thomas Johnson (@NTmatter) September 30, 2016

This is a pretty neat find because currently today, the only network adapter that is functional with an Apple Mac OS X guest running on either VMware vSphere or Fusion is the e1000{e} driver. This update was definitely news to me and after sharing it internally to see if I could find some more details, it turns out this news also came as surprise to the folks internally. Darius, one of the Engineers who I frequently reach out to on Apple related topics did some digging and found out that Apple started to bundle this VMXNET3 driver starting with Mac OS X 10.11 (El Capitan) release. You can find the driver located in /System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleVmxnet3Ethernet.kext

Disclaimer: Given that this VMXNET3 Mac OS X driver was not developed by VMware nor has it been tested by VMware, it currently would not be officially supported by VMware.

If you wish to try out the VMXNET3 driver, you will need to install Mac OS X 10.11 or newer on a VM running on vSphere or Fusion. By default, the only available network adapter type is e1000{e}. To add a VMXNET3 network adapter, you can either manually tweak the .VMX file or you can easily add it by using either the vSphere Web/C# Client or ESXi Embedded Host Client. Below are the instructions on configuring the VMXNET3 network adapter for your Mac OS X guests.

Step 1 - Remove the existing network adapter and then temporarily change the GuestOS type to "Other" (no need to save setting, just update it in VM reconfigure wizard) so that you will be allowed to add a VMXNET3 network adapter. Once you have added it to the VM reconfigure wizard, go ahead and toggle back the GuestOS type to Mac OS X 10.10 and then save the settings as shown in the screenshots below.

mac-os-x-el-capitan-10-11-vmxnet3-driver-0
mac-os-x-el-capitan-10-11-vmxnet3-driver-1
Step 2 - Open a terminal inside of the Mac OS X guest and run the following command to load the VMXNET3 driver:

sudo kextload /System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleVmxnet3Ethernet.kext

Step 3 - You can verify that the VMXNET3 driver was successfully loaded by running the following command:

kextstat | grep -i vmxnet3

mac-os-x-el-capitan-10-11-vmxnet3-driver-2
Once the driver has been loaded, you should now have networking connectivity to your Mac OS X VM using the VMXNET3 network adapter. Below is a screenshot of the system info showing the VMXNET3 network adapter.

mac-os-x-el-capitan-10-11-vmxnet3-driver-3
In addition to having an optimized networking when using the VMXNET3 driver, the other benefit is being able to get a link speed of 10GbE which is something customers have been inquiring about when virtualizing Mac OS X guests. Below is a screenshot of the media link shown in this Mac OS X 10.11 guests.

mac-os-x-el-capitan-10-11-vmxnet3-driver-4
Although this a great development for Apple customers who uses VMware vSphere and Fusion, it also does raise an interesting question on whether Apple would be officially supporting this VMXNET3 driver going forward? If I do receive any more details on this, I will update the article. Until then, you can play with this new capability if you are running Mac OS X 10.11 or greater on VMware. Big thanks to Thomas for this great find and sharing it with the VMware Community!

Categories // Apple, vSphere 6.0 Tags // apple, el capitan, osx, vmware tools, vmxnet3

VMware PowerCLI for Mac OS X, Linux & More? Yes, please!

09.06.2016 by William Lam // 10 Comments

powercli_for_mac_osx_linux_1There were a several announcements at last weeks VMworld US Conference, but one of the most exciting piece of news in my opinion was from Alan Renouf, Product Manager for all things API/SDK/CLI at VMware. During Alan's What's New PowerCLI session, he announced that PowerCLI is finally coming to both Mac OS X as well as Linux! As you can imagine, the news was very well received from customers and partners. In fact, after I had tweeted the update here & here, I literally had folks pinging/IM'ing/DM'ing me non-stop about when they could get access 🙂

UPDATE (10/18/16) - PowerCLI Multi-Platform (MP) for Linux and Mac OS X has now been released as a VMware Fling. Please find the download here and provide any feedback in the comments section.

This exciting update was only possible with the help of our friends over at Microsoft who had recently open sourced both .NET Core & PowerShell. Once that news broke, Alan and the PowerCLI Engineering team have been working hard on porting over the existing PowerCLI code which uses the Windows .NET library over to the new .NET Core which is now open sourced. I have been very impressed at how fast the PowerCLI team have already made available many of the default cmdlets as well as the Get View cmdlet which exposes the entire functionality of the vSphere API.

Now, before you get too excited, this new version of PowerCLI is currently not available yet. As Alan mentioned in his session, we plan to release an early Tech Preview of PowerCLI for both Mac OS X and Linux as a VMware Fling shortly after VMworld. It is also very important to note that Microsoft PowerShell for Mac OS X & Linux which PowerCLI uses is just at an Alpha release milestone. There is still much work to do on both sides but I am really looking forward to enabling our customers with the choice of platform when it comes to consuming PowerCLI.

powercli_for_mac_osx_linux_2
A few of us have been quite fortunate to have been involved in the early development of this new version of PowerCLI. In fact, we even built a simple Docker Container for PowerCLI which will allow you to easily access PowerCLI from any system that can run Docker. Here is a quick screenshot of spinning up a PowerCLI Docker Container which will also be part of the Fling release.

powercli_for_mac_osx_linux_3
Lastly, we want customers to be able to quickly and securely set up a persistent PowerCLI environment in which they can use to manage and configure their VMware-based products that support PowerCLI. With that, we have also built a PowerShell package for Photon OS which is VMware's minimal Linux container host distribution. Not only is it free to download and use, but it literally takes a few seconds to install (tdnf -y install powershell) and even less time to boot up and import the PowerCLI module. This was literally done the week before VMworld by the Photon team and huge kudos for their support! As you can see, not only do we want to provide choice for our customers but also simplifying how you might consume PowerCLI whether its natively on Windows, Mac OS X, Linux, Docker Container or running on top of VMware Photon OS. I hope you are excited as I am and stay tuned for more details on the Fling release!

If you have any feedback or what you are most excited regarding this news, please leave a comment and I will make sure it makes it way back to our Product Manager.

Categories // Apple, Automation, Docker, PowerCLI Tags // Docker, linux, Microsoft, osx, Photon, PowerCLI, PowerCLICore, powershell, vSphere

  • 1
  • 2
  • 3
  • …
  • 11
  • 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...