Official provider for VMware desktop products: Fusion, Player, and Workstation.

Overview

Vagrant VMware Desktop Providers

This is the common codebase for the official providers for VMware desktop products: Fusion, Player, and Workstation. This therefore works on Windows, Mac, and Linux.

Box Format

All the desktop plugins share a common box format known as vmware_desktop. The plugins also all support the formats vmware_fusion, vmware_workstation, and vmware_player.

Developing

There are two separate parts which work together to provide the vagrant-vmware-desktop functionality. The first is the vagrant-vmware-desktop RubyGem. This does the bulk of the work for the plugin. The second part is a vagrant-vmware-utility service that the vagrant-vmware-desktop plugin interacts with. The purpose of this part of the plugin is to do operations which require privleged access on the host. This includes network operations and verification of fusion/workstation.

RubyGem - Desktop plugin

Using bundler allows for local development. If you need to test the RubyGem plugin on another system you can build a gem by building directly:

gem build vagrant-vmware-desktop.gemspec

Utility Service

This part fo the plugin lives in the go_src directory and is required to be running when using the vagrant-vmware-desktop plugin. To build and start it:

cd go_src/vagrant-vmware-utility
go build
./vagrant-vmware-utility certificate generate
sudo ./vagrant-vmware-utility api

Certificates

The plugin interacts with the utility service via a REST API. The utility service creates these certificates with the certificate generate command:

./vagrant-vmware-utility certificate generate

This will output the path to certificates directory. Because a development build is in use, the plugin will be unable to locate the certificates to communicate with the API. The plugin can be configured with the directory path:

Vagrant.configure("2") do |config|
  config.vm.provider :vmware_desktop do |vmware|
    vmware.utility_certificate_path = "PATH"
  end
end

Another option is to link the certificates directory to the location the plugin expects to find them:

$ sudo mkdir /opt/vagrant-vmware-desktop
$ sudo ln -s PATH /opt/vagrant-vmware-desktop/certificates

Releasing

This repository contains two separate projects:

  • Vagrant VMware Desktop
  • Vagrant VMware Utility

The release process for these projects are similiar but slightly different based on the project.

See the release documentation in the Vagrant confluence page

Comments
  • Vagrant vmware provider fails to work with Fusion Tech Preview

    Vagrant vmware provider fails to work with Fusion Tech Preview

    Hi, I am running an Apple Silicon Macbook (ARM) and found out that VirtualBox does not work on that platform. I then learned that VMWare released a Tech Preview of Fusion for ARM last month, and so I was hopeful in getting that to work with Vagrant, as you provide a VMWare provider.

    I followed all the steps for installing the provider and you can see from the output that it seems to work. I then proceeded to follow the Getting Started guide (skipping the install of VirtualBox). You could also see my own notes when doing this. All seemed fine up until the last steps:

    $ vagrant init hashicorp/bionic64
    
    $ vagrant up --provider vmware_desktop
    Vagrant encountered an unexpected communications error with the
    Vagrant VMware Utility driver. Please try to run the command
    again. If this error persists, please contact [email protected]
    

    When running with the debug output, it seems as if it could not find any image matching the supplied image. I am not that familiar with Vagrant, but I assumed it might have to do with the image needing to specifically work with VMWare? So I searched vagrant images for anything support vmware and tried both "generic/ubuntu2104" and "roboxes/ubuntu2104" which both were tagged vmware. No luck there either; they all erred with something like this in the debug output

     WARN vagrantfile: Performing lookup with initial values roboxes/ubuntu2104 with version
     INFO box_collection: Box not found: roboxes/ubuntu2104 (vmware_desktop, vmware_fusion, vmware_workstation)
    

    The following is info following the Bug template

    $ vagrant -v
    Vagrant 2.2.18
    
    carlerik at carl-eriks-air in ~/dev/dotfiles (master)
    $ vagrant plugin list
    vagrant-vmware-desktop (3.0.1, global)
      - Version Constraint: > 0
    
    carlerik at carl-eriks-air in ~/dev/dotfiles (master)
    $ /opt/vagrant-vmware-desktop/bin/vagrant-vmware-utility -v
    1.0.20
    
    carlerik at carl-eriks-air in ~/dev/dotfiles (master)
    $ uname -a
    Darwin carl-eriks-air.lan 21.1.0 Darwin Kernel Version 21.1.0: Sat Sep 11 12:27:45 PDT 2021; root:xnu-8019.40.67.171.4~1/RELEASE_ARM64_T8101 arm64
    

    Debug output

    https://gist.github.com/fatso83/7da6c48debb4b48333feab90b44964d8

    Expected behavior

    That it fired up a vm as described in getting started

    Actual behavior

    It erred with

    Vagrant encountered an unexpected communications error with the
    Vagrant VMware Utility driver.
    

    Steps to reproduce

    1. Use a M1 Mac (arm)
    2. Install the Fusion Tech Preview
    3. vagrant init hashicorp/bionic64
    4. vagrant up --provider vmware_desktop
    opened by fatso83 28
  • Enhancement Request: Env variable to override default install path

    Enhancement Request: Env variable to override default install path

    Is your feature request related to a problem? Please describe. From issue #22 it seems like the vmware provider is unable to find the vmware fusion install when it is installed in non-standard locations. It is only when you move it to /Application/VMWare Fusion.app that it can find the files. As the Tech Preview installs itself under a different path, this means official fusion versions do not work without manually renaming the application. This of course also makes it hard to test out different versions of vmware that might be installed at the same time.

    Describe the solution you'd like Support an environment variable for overriding the location the provider will try and look up the vmware files. Something like export VAGRANT_VMWARE_INSTALL_DIR="/Applications/VMWare Fusion Tech Preview.app".

    Describe alternatives you've considered As described in https://github.com/hashicorp/vagrant-vmware-desktop/issues/22#issuecomment-952819799, one can manually rename the version currently installed at the default location and then make symlinks:

    ln -s /Applications/VMWare\ Fusion\ Tech\ Preview.app /Applications/VMWare\ Fusion.app
    

    That's a bit of a chore, though.

    Additional context See #22.

    enhancement 
    opened by fatso83 5
  • Hanging getting IP on VMWare Fusion 12.2 provider

    Hanging getting IP on VMWare Fusion 12.2 provider

    Vagrant version

    ❯ vagrant -v
    Vagrant 2.2.18
    
    ❯ vagrant plugin list
    vagrant-libvirt (0.6.3, global)
      - Version Constraint: > 0
    vagrant-parallels (2.2.4, global)
      - Version Constraint: > 0
    vagrant-vbguest (0.30.0, global)
      - Version Constraint: > 0
    vagrant-vmware-desktop (3.0.1, global)
      - Version Constraint: > 0
    

    VMWare Fusion Pro: Professional Version 12.2.0 (18760249)

    Host operating system

    macOS BigSur 11.6 (20G165)

    Guest operating system

    Vagrant Cloud's generic/debian11 ... also same issue with generic/centos7.

    Vagrantfile

    This exhibits the bug:

    Vagrant.configure("2") do |config|
      config.vm.box = "generic/debian11"
    end
    

    The bug goes away with this change:

    Vagrant.configure("2") do |config|
      config.vm.box = "generic/debian11"
      config.vm.provider "vmware_fusion" do |v|
        v.gui = true
      end
    end
    

    Debug output

    Here's the debug output with the bug. This one just hangs so I have to Ctrl-C it.

    Here's the debug output without the bug when gui is enabled.

    Destroyed VM and deleted the .vagrant folder before each to keep it clean.

    Expected behavior

    Expecting it to not hang.

    Actual behavior

    Hangs indefinitely waiting for IP when the GUI is not enabled.

    Steps to reproduce

    1. Create a free generic/debian11 minimal Vagrantfile on same versions provided
    2. Bring up the VM
    3. See it hang indefinitely

    References

    Nothing I could find.

    opened by akarasulu 4
  • Waiting for the VM to receive an address

    Waiting for the VM to receive an address

    I've been using virtualbox as my provider of choice for a while now, to avoid the $79 charge, which no longer applies. Now my vagrant gets stuck on Waiting for the VM to receive an address pretty much every time. I followed the installation steps for both the utility and the plugin, and the machine creates fine. But it appears that Vagrant is unable to provision an IP, in spite of the fact that the network has been created in VMware Workstation.

    Here's the Vagrant file:

    # vi: set ft=ruby :
    Vagrant.configure("2") do |config|
      config.vm.box = "bento/ubuntu-20.04"
      config.vm.provider "vmware_desktop" do |v|
        v.gui = true
        v.vmx["memsize"] = "2048"
        v.vmx["numvcpus"] = "2"
      end
    end
    

    And the command output:

    Bringing machine 'default' up with 'vmware_desktop' provider...
    ==> default: Cloning VMware VM: 'bento/ubuntu-20.04'. This can take some time...
    ==> default: Checking if box 'bento/ubuntu-20.04' version '202012.23.0' is up to date...
    ==> default: Verifying vmnet devices are healthy...
    ==> default: Preparing network adapters...
    ==> default: Starting the VMware VM...
    ==> default: Waiting for the VM to receive an address...
    ==> default: Waiting for cleanup before exiting...
    

    If it's any help, I've run this in Git Bash, CMD and Powershell, both privileged and unprivileged, a total of at least 6 times today. Do I need to downgrade/reinstall VMware? I'll appreciate any help.

    opened by agmt5989 4
  • synced_folder ignores provided mount_options uid and gid value

    synced_folder ignores provided mount_options uid and gid value

    Vagrant version

    2.2.18

    Vagrant VMware plugin version

    vagrant-vmware-desktop (3.0.1, global)

    Vagrant VMware utility version

    1.0.20

    Host operating system

    macOS 11.6

    Guest operating system

    Debian Stretch

    Vagrantfile

    require 'etc'
    pwent = Etc.getpwuid
    puts "uid=#{pwent.uid}, gid=#{pwent.gid}"
    
    Vagrant.configure("2") do |config|
      config.vm.box = "mydebian9"
      config.vm.provider "vmware_desktop" do |v|
        v.gui = true
        v.allowlist_verified = true
        config.vm.synced_folder '/Users/choeger/devel_choeger', '/Users/choeger', mount_options: ["uid=#{pwent.uid},gid=#{pwent.gid}"], create: true
      end
      config.vm.provision :shell do |shell|
        shell.inline = "useradd -u #{pwent.uid} -g #{pwent.gid} -d #{pwent.dir} -M #{pwent.name}"
      end
    end
    

    Debug output

    https://gist.github.com/c-hoeger/7e84aa329237558fdb49a0db20f73c8a

    Looks like vmhgfs-fuse is always executed with fixed uid/gid numbers:

    vmhgfs-fuse -o allow_other,default_permissions,uid=1000,gid=1000,uid=501,gid=20 .host:/ '/mnt/vagrant-mounts/1000-1000'
    

    Expected behavior

    Mounted directory should be mounted with provided uid and uid

    Actual behavior

    $ vagrant up --provider vmware_desktop
    uid=501, gid=20
    Bringing machine 'default' up with 'vmware_desktop' provider...
    ==> default: Cloning VMware VM: 'mydebian9'. This can take some time...
    ==> default: Verifying vmnet devices are healthy...
    ==> default: Preparing network adapters...
    ==> default: Starting the VMware VM...
    ==> default: Waiting for the VM to receive an address...
    ==> default: Forwarding ports...
        default: -- 22 => 2222
    ==> default: Waiting for machine to boot. This may take a few minutes...
        default: SSH address: 127.0.0.1:2222
        default: SSH username: vagrant
        default: SSH auth method: private key
        default:
        default: Vagrant insecure key detected. Vagrant will automatically replace
        default: this with a newly generated keypair for better security.
        default:
        default: Inserting generated public key within guest...
        default: Removing insecure key from the guest if it's present...
        default: Key inserted! Disconnecting and reconnecting using new SSH key...
    ==> default: Machine booted and ready!
    ==> default: Configuring network adapters within the VM...
    ==> default: Waiting for HGFS to become available...
    ==> default: Enabling and configuring shared folders...
        default: -- /Users/choeger/devel_choeger/vagrant-vmware: /vagrant
        default: -- /Users/choeger/devel_choeger: /Users/choeger
    ==> default: Running provisioner: shell...
        default: Running: inline script
    choegbook:vagrant-vmware choeger$ vagrant ssh
    uid=501, gid=20
    Linux debian9 4.9.0-16-amd64 #1 SMP Debian 4.9.272-2 (2021-07-19) x86_64
    
    The programs included with the Debian GNU/Linux system are free software;
    the exact distribution terms for each program are described in the
    individual files in /usr/share/doc/*/copyright.
    
    Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
    permitted by applicable law.
    Last login: Fri Oct 22 10:03:52 2021 from 172.16.210.1
    [email protected]:~$ id choeger
    uid=501(choeger) gid=20(dialout) groups=20(dialout)
    [email protected]:~$ ls -al /Users/
    total 12
    drwxr-xr-x  3 root    root    4096 Oct 22 14:57 .
    drwxr-xr-x 24 root    root    4096 Oct 22 14:57 ..
    drwxr-xr-x  1 vagrant vagrant 3616 Oct 21 13:47 choeger
    

    Steps to reproduce

    Run vagrant up with a Vagrantfile like the one in this issue.

    opened by c-hoeger 2
  • Vagrant for Windows Crashing VMware NAT Service

    Vagrant for Windows Crashing VMware NAT Service

    Summary

    Using Vagrant causes the VMware NAT Service to crash, and once crashed, it cannot easily be restarted. Because of this, any VM created/started via Vagrant has no network access. The only known solution is to reset the virtual network adapters to default via the Virtual Network Editor

    Vagrant version

    Vagrant 2.2.18

    Vagrant VMware plugin version

    vagrant-vmware-desktop (3.0.0, global)

    Vagrant VMware utility version

    1.0.20

    Host operating system

    Microsoft Windows 10 Pro (Version 10.0.19043 Build 19043) VMware® Workstation 16 Pro (16.1.2 build-17966106)

    Guest operating system

    centos/7

    Vagrantfile

    Vagrant.configure("2") do |config|
      config.vm.box = "centos/7"
    end
    

    Debug output

    https://gist.github.com/rothman857/5ac5eb3a2e3b36f1d0e4f8977734f12c

    Expected behavior

    running vagrant up should start the VM and it should have external network connectivity (via NAT network adapter).

    Actual behavior

    The VM starts, but VMware NAT services stops, and cannot be restarted. Attempts to restart the service result in an error:

    Windows could not start the VMware NAT Service service on Local Computer.  
    Error 1067: The process terminated unexpectedly.
    

    The VM has no IP connectivity (because the NAT service isn't running).

    Steps to reproduce

    1. vagrant init centos/7
    2. vagrant up

    Workaround

    1. In VMware Workstation, shut off all running VM's
    2. Navigate to Edit >> Virtual Network Editor >> Change Settings >> Restore Defaults
    3. Verify the VMware NAT Service is now running
    4. Manually power on VM's, DO NOT USE 'VAGRANT UP' AS THIS WILL RE-CRASH THE NAT SERVICE
    5. Ping 8.8.8.8 to verify connectivity
    opened by rothman857 2
  • VM customisation not applying

    VM customisation not applying

    I am trying to configure a basic virtual machine for development - I am trying to create a full clone VM with 8GB ram and 4 vCPUs. Any properties I update in the provider do not seem to be applied in the created VM. My changes are also not reflected in the debug log attached below

    VMWare version

    VMWare Workstation 16.2.1 Pro Build 18811642

    Vagrant version

    Vagrant 2.2.19

    Vagrant VMware plugin version

    vagrant-bindfs (1.1.9, global) vagrant-vmware-desktop (3.0.1, global)

    Vagrant VMware utility version

    1.0.21

    Host operating system

    Windows 11 Pro Build 22000

    Guest operating system

    bento/debian-10

    Vagrantfile

    Vagrant.configure(2) do |config|
            config.ssh.forward_agent = true
    
            config.vm.define 'wisp_development'
            config.vm.box = 'bento/debian-10'
            config.vm.hostname = 'wisp'
    
            config.vm.provider 'vmware-desktop' do |v|
                v.linked_clone = false
    
                v.vmx['displayName'] = 'development'
                v.vmx['memsize'] = '8192'
                v.vmx['numvcpus'] = '4'
                v.vmx["cpuid.coresPerSocket"] = '1'
            end
    end
    

    Debug output

    https://gist.github.com/victiondev/80dc0b66b4904855d0ecf3914a8fd95f

    Expected behavior

    A full clone VM should have been made with 4 vCPUs and 8GB ram.

    Actual behavior

    A linked clone VM was created, with the default settings of 2 vCPUs and 1GB ram.

    Steps to reproduce

    1. vagrant up
    2. Open vmx file or look at configuration in VMWare
    3. See desired changes have not been applied
    opened by victiondev 1
  • Release documentation is not public

    Release documentation is not public

    The bottom of the README.md file for this project says

    See the release documentation in the Vagrant confluence page

    and has a link to https://hashicorp.atlassian.net/wiki/spaces/vagrant/pages/1039532466/Vagrant+VMware. That Confluence space is not open to public, demanding authorization, and so it has no place on a public open source project, unless that space is either opened up for public or the docs are moved/copied into some public wiki.

    opened by fatso83 1
  • Setting virtual machine name does not work

    Setting virtual machine name does not work

    Vagrant version

    2.2.18

    Vagrant VMware plugin version

    vagrant-vmware-desktop (3.0.1, global)

    Vagrant VMware utility version

    1.0.20

    Host operating system

    macOS 11.6

    Guest operating system

    Debian Stretch

    Vagrantfile

    Vagrant.configure("2") do |config|
      config.vm.box = "mydebian9"
      config.vm.provider "vmware_desktop" do |v|
        v.gui = true
        v.allowlist_verified = true
        v.name = "My VM"
      end
    end
    

    Debug output

    https://gist.github.com/c-hoeger/045899df07f913c5f58aca389ae45a0e

    Expected behavior

    Setting the vm name should work as described here: https://www.vagrantup.com/docs/providers/virtualbox/configuration Since according to https://www.vagrantup.com/docs/providers/vmware/configuration, the "Vagrant VMware Desktop provider is a drop-in replacement for VirtualBox".

    Actual behavior

    $ vagrant up
    Bringing machine 'default' up with 'vmware_desktop' provider...
    There are errors in the configuration of this machine. Please fix
    the following errors and try again:
    
    VMware Desktop Provider:
    * The following settings shouldn't exist: name
    

    Steps to reproduce

    Run vagrant up with a Vagrantfile like the one in this issue.

    opened by c-hoeger 1
  • Access to the release documentation in the Vagrant confluence page

    Access to the release documentation in the Vagrant confluence page

    While the confluence page is referenced in the README.md text it does not seem to be published as a public page and so can not be accessed.

    As I can not access the page I have no way to tell if it holds important info.

    Thanks

    enhancement 
    opened by rit001 1
  • Update MacOS lease file detection

    Update MacOS lease file detection

    Fusion version 12 on Big Sur started using the Apple native vmnet framework. However, issues with transiting VPNs is requiring VMware to move back to the VMware DHCP implementation.

    Changes:

    • Use Apple networking with Big Sur and Fusion versions 12.0 and 12.1
    • Switch back to using VMware networking in Fusion version 12.2+
    • All other cases will use VMware networking
    • Additionally, handle pre-release "experimental" builds that show a build number of "e.x.p" with VMware networking

    Signed-off-by: Mark Peek [email protected]

    opened by markpeek 1
  • Failed to locate the vmrest executable

    Failed to locate the vmrest executable

    I'm unable to run vagrant box with VMWare Fusion Tech.

    Vagrant version

    Vagrant 2.3.3
    

    Vagrant VMware plugin version

    vagrant-vbguest (0.30.0, global)
    vagrant-vmware-desktop (3.0.1, global)
    

    Vagrant VMware utility version

    vagrant-vmware-utility -v
    1.0.21
    

    Host operating system

    Darwin Kernel Version 22.1.0: Sun Oct  9 20:15:09 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000
    

    Guest operating system

    debian/buster64
    

    Vagrantfile

    Vagrant.configure("2") do |config|
      # The most common configuration options are documented and commented below.
      # For a complete reference, please see the online documentation at
      # https://docs.vagrantup.com.
    
      # Every Vagrant development environment requires a box. You can search for
      # boxes at https://vagrantcloud.com/search.
      config.vm.box = "debian/buster64"
      config.vm.hostname = "devbox-01"
      config.vm.define "devbox-01"
      config.vagrant.plugins = ['vagrant-vbguest']
    
      config.vm.network "private_network", ip: "192.168.33.10"
    
      config.vm.synced_folder "./", "/home/vagrant/project"
    
      config.vm.provider "vmware_desktop" do |vd|
        vd.cpus = 4
        vd.memory = "2048"
        vd.gui = true
      end
    
      config.vm.provision "shell", inline: <<-SHELL
        apt-get update
        apt-get install -y curl git cmake tmux vim  # ...
      SHELL
    
      config.vm.provision "docker" do |d|
        d.run "nginx"
      end
    

    Debug output

    Here is the sample log details from vagrant-vimware-utility/service.log

    Halting the Vagrant VMware API service
    2022-11-18T01:28:40.769+0100 [INFO]  vagrant-vmware-utility.api: created: vmx=<nil>
    2022-11-18T01:28:40.848+0100 [INFO]  vagrant-vmware-utility.api: attempting to upgrade to vmrest driver
    2022-11-18T01:28:40.848+0100 [WARN]  vagrant-vmware-utility.api.vmrest: failed to create vmrest driver: error="Failed to locate the vmrest executable"
    2022-11-18T01:28:40.848+0100 [INFO]  vagrant-vmware-utility.api.vmrest: using fallback driver
    2022-11-18T01:28:40.848+0100 [INFO]  vagrant-vmware-utility.api: enabling internal port forwarding service
    Starting the Vagrant VMware API service
    2022-11-18T01:28:41.269+0100 [INFO]  vagrant-vmware-utility.api.api: api service start: host=127.0.0.1 port=9999
    

    Expected behavior

    What should have happened?

    Actual behavior

    What actually happened?

    Steps to reproduce

    Some of the steps I have followed are from the Stackoverflow thread https://stackoverflow.com/questions/72112571/vagrant-vmware-utility-driver

    References

    https://stackoverflow.com/questions/72112571/vagrant-vmware-utility-driver

    https://github.com/hashicorp/vagrant-vmware-desktop/issues/22

    opened by manjufy 0
  • Enhancement Request: Apple Silicon build for vagrant-vmware-utility

    Enhancement Request: Apple Silicon build for vagrant-vmware-utility

    Is your feature request related to a problem? Please describe.

    • vagrant-vmware-utility is one of very few programs I have on my Apple Silicon Mac that still requires Rosetta

    Describe the solution you'd like

    • Universal binary build for both Intel and Apple Silicon

    Describe alternatives you've considered

    • Not sure there's an alternative -- at some point there needs to be an arm64 build

    Additional context

    • Attached screenshot:
    Screen Shot 2022-10-24 at 1 09 44 PM enhancement 
    opened by fredngo 0
  • [COMPLIANCE] Update MPL-2.0 LICENSE

    [COMPLIANCE] Update MPL-2.0 LICENSE

    Hi there 👋

    This PR was auto-generated as part of an internal review of public repositories that are not in compliance with HashiCorp's licensing standards.

    Frequently Asked Questions

    Why am I getting this PR? This pull request was created because one or more of the following criteria was found:
    • This repo did not previously have a LICENSE file
    • A LICENSE file was present, but had a non-conforming name (e.g., license.txt)
    • A LICENSE file was present, but was missing an appropriate copyright statement

    More info is available in the RFC

    How do you determine the copyright date? The copyright date given in this PR is supposed to be the year the repository or project was created (whichever is older). If you believe the copyright date given in this PR is not valid, please reach out to:

    #proj-software-copyright

    I don't think this repo should be licensed under the terms of the Mozilla Public License 2.0. Who should I reach out to? If you believe this repository should not use an MPL 2.0 License, please reach out to [email protected] Exemptions are considered on a case-by-case basis, but common reasons include if the project is co-managed by another entity that requires differing license terms, or if the project is part of an ecosystem that commonly uses a different license type (e.g., MIT or Apache 2.0).

    Please approve and merge this PR in a timely manner to keep this source code compliant with our OSS license agreement. If you have any questions or feedback, reach out to #proj-software-copyright.

    Thank you!


    Made with :heart: @HashiCorp

    automated legal 
    opened by hashicorp-copywrite[bot] 0
  • Vagrant confused between two virtual boxes with SSH | Mac OS Big Sur | VMWare Fusion

    Vagrant confused between two virtual boxes with SSH | Mac OS Big Sur | VMWare Fusion

    Debug output

    [email protected] uvagrant % vagrant port
    The forwarded ports for the machine are listed below. Please note that
    these values may differ from values configured in the Vagrantfile if the
    provider supports automatic port collision detection and resolution.
    
        22 (guest) => 2222 (host)
    ---
    [email protected] uvagrant % pwd
    /-------/uvagrant
    
    ---
    [email protected] uvagrant % vagrant ssh
    [email protected]'s password:
    [email protected]:~
    
    
    [email protected] demoMachine % vagrant port
        22 (guest) => 2200 (host)
    ---
    [email protected] demoMachine % pwd
    /-----/demoMachine
    ---
    [email protected] demoMachine % vagrant ssh
    Last login: Fri Sep 23 17:29:08 2022 from 192.168.103.1
    [email protected]:~$
    

    Expected behavior

    I have two Boxes running in different directories uvagrant and demoMachine (as shown in the output), when both of my boxes are running vagrant confuses while doing ssh even if I run from their respective directories. If I ssh in uvagrant machine it will go to demomachine, above is the output in debug log.

    Screen Shot 2022-09-23 at 1 30 09 PM

    Normally it should go to their respective machines, even if I use the machine names it still goes into different machines.

    Actual behavior

    Whenever I am trying to ssh into machine located in uvagrant directory will ssh into Machine located in demoMachine. Looks like ssh runs in conflict.

    Reproduction information

    • Spin up two vagrant machine on Mac OS Big Sur v11.6.5 using VMware fusion
    • Try ssh into them using port, name or simply using vagrant ssh and it will fail

    Vagrant version

    [email protected] uvagrant % vagrant -v
    Vagrant 2.3.0
    

    Host operating system

    [email protected] demoMachine % uname -a
    Darwin Rushikeshs-MacBook-Air.local 20.6.0 Darwin Kernel Version 20.6.0: Tue Feb 22 21:10:42 PST 2022; root:xnu-7195.141.26~1/RELEASE_ARM64_T8101 arm64
    [email protected] demoMachine % sw_vers
    ProductName:	macOS
    ProductVersion:	11.6.5
    BuildVersion:	20G527
    [email protected] demoMachine %
    

    Guest operating system

    • Ubuntu 20.04 box : bytesguy/ubuntu-server-20.04-arm64
    • VMware Fusion Version : Player Version e.x.p (20191287)
    • VM run Version : vmrun version 1.17.0 build-20191287

    Steps to reproduce

    1. Install vmware fusion on mac os big sure
    2. Get the above guest os and spin up two instance of this machine
    3. Try SSH into them

    Vagrantfile

    Machine-1

    [email protected] demoMachine % cat Vagrantfile
    Vagrant.configure("2") do |config|
      config.vm.box = "bytesguy/ubuntu-server-20.04-arm64"
      config.vm.box_version = "1.0.0"
      config.vm.hostname = "build"
      config.vm.define "buildServer"
      config.vm.provider :vmware_fusion do |v, o|
        v.gui = true
        v.memory = 4024
        v.cpus = 4
       end
      config.vm.synced_folder "/---/sharedFolder","/home/vagrant/shared"
    end
    
    

    Machine-2

    [email protected] demoMachine % cat Vagrantfile
    Vagrant.configure("2") do |config|
      config.vm.box = "bytesguy/ubuntu-server-20.04-arm64"
      config.vm.box_version = "1.0.0"
      config.vm.hostname = "build"
      config.vm.define "buildServer"
      config.vm.provider :vmware_fusion do |v, o|
        v.gui = true
        v.memory = 4024
        v.cpus = 4
       end
      config.vm.synced_folder "/---/sharedFolder","/home/vagrant/shared"
    end
    
    

    Port host op :

    [email protected] uvagrant % sudo lsof -i -n -P | grep 2200
    Password:
    vagrant-v   642           root   16u  IPv6 0xd60f8eac0f43ea4f      0t0    TCP *:2200 (LISTEN)
    
    [email protected] uvagrant % sudo lsof -i -n -P | grep 2222
    vagrant-v   642           root    9u  IPv6 0xd60f8eac0f7696ef      0t0    TCP *:2222 (LISTEN)
    [email protected] uvagrant %
    
    

    Ref: https://github.com/hashicorp/vagrant/issues/12916

    opened by rushi47 0
  • vagrant connect fails when using vmware-desktop provider on Apply M1

    vagrant connect fails when using vmware-desktop provider on Apply M1

    Trying to use vagrant-share to connect to a vagrant box running on a remote system. When using the plugin on the Apply M1 device (using the vmware-desktop plugin) we fail with the error:

    /Users/.../.vagrant.d/gems/2.7.4/gems/vagrant-vmware-desktop-3.0.1/lib/vagrant-vmware-desktop/action/set_display_name.rb:16:in `call': undefined method `basename' for nil:NilClass (NoMethodError)
    

    Vagrant version

    Vagrant 2.2.19

    Vagrant VMware plugin version

    vagrant-share (2.0.0, global)
      - Version Constraint: > 0
    vagrant-vmware-desktop (3.0.1, global)
      - Version Constraint: > 0
    

    Vagrant VMware utility version

    1.0.21

    Host operating system

    macOS Monterey v12.4

    Guest operating system

    the official hashicorp/vagrant-share box

    Vagrantfile

    Target Vagrantbox:

    Vagrant.configure("2") do |config|
      config.vm.box = "generic/fedora33"
    end
    

    Debug output

    vagrant connect debug log: https://gist.github.com/268ee835ca6fc3c555320098cdae4fbd

    Expected behavior

    Successfully connected to remote vagrant box

    Actual behavior

    Error during connection

    Steps to reproduce

    1. On remote box: run vagrant up
    2. On remote box: run vagrant share --ssh --disable-http
    3. <record output of vargrant share address>
    4. On local box: run vagrant connect --ssh <share address>
    opened by ryanschaaf-dmc 0
  • Use named snapshots when making a clone.

    Use named snapshots when making a clone.

    This prevents the vmrun clone command from duplicating the default clone name of "Clone" multiple times. By having a uniquely named snapshot, it is easier to manually clean up the snapshots with vmrun deleteSnapshot box.vmx <snapshotname> [andDeleteChildren]

    Relates to hashicorp/vagrant-vmware-desktop#38

    Snapshots and clones being cleaned up after vagrant destroy should still be investigated and fixed, but this helps in the short term.

    Before PR

    % vmrun listSnapshots box.vmx
    Total snapshots: 3
    Clone
    Clone
    Clone
    % vmrun deleteSnapshot box.vmx Clone andDeleteChildren
    Error: The name does not uniquely identify one snapshot
    

    After PR

    % vmrun listSnapshots box.vmx
    Total snapshots: 3
    clone-0
    clone-1
    clone-2
    % vmrun deleteSnapshot box.vmx clone-0 andDeleteChildren
    % vmrun listSnapshots box.vmx
    Total snapshots: 0
    
    opened by n8felton 1
Owner
HashiCorp
Consistent workflows to provision, secure, connect, and run any infrastructure for any application.
HashiCorp
Tool (in Go!) to compare and diff container and host environments. Dinosaur fun!

Compe compare environments and other things between containers, and host ??️ This is a simple tool to compare environments and other features of conta

Vanessasaurus 1 Sep 24, 2022
Go Cheat Sheet - An overview of Go syntax and features.

Go Cheat Sheet - An overview of Go syntax and features.

Ariel Mashraki 7.1k Nov 22, 2022
An online book focusing on Go syntax/semantics and runtime related things

Go 101 is a book focusing on Go syntax/semantics and all kinds of runtime related things. It tries to help gophers gain a deep and thorough understanding of Go. This book also collects many details of Go and in Go programming. The book is expected to be helpful for both beginner and experienced Go programmers.

Go101 4.8k Nov 28, 2022
This slide deck and supporting material is part of the Introduction to Go training course by Dave Cheney

This slide deck and supporting material is part of the Introduction to Go training course by Dave Cheney.

Dave Cheney 85 Nov 14, 2022
📖 Build a RESTful API on Go: Fiber, PostgreSQL, JWT and Swagger docs in isolated Docker containers.

?? Tutorial: Build a RESTful API on Go Fiber, PostgreSQL, JWT and Swagger docs in isolated Docker containers. ?? The full article is published on Marc

Vic Shóstak 219 Nov 24, 2022
Assert your Go code is inlined and bounds-check eliminated

gcassert gcassert is a program for making assertions about compiler decisions in Golang programs, via inline comment directives like //gcassert:inline

Jordan Lewis 178 Oct 27, 2022
1000+ Hand-Crafted Go Examples, Exercises, and Quizzes

A Huge Number of Go Examples, Exercises and Quizzes Best way of learning is doing. Inside this repository, you will find thousands of Go examples, exe

İnanç Gümüş 16.4k Nov 19, 2022
A complete guide to undersatnd golang programming language, web requests, JSON and creating web APIs with mongodb

Golang series A complete guide to undersatnd golang programming language, web requests, JSON and creating web APIs with mongodb LearnCodeonline.in 01

HItesh Choudhary 88 Nov 20, 2022
Golang Clean Architecture based on Uncle Bob's Clean Architecture and Summer internship in 2021

clean-architecture-api Description This is an example of implemention of Clean Architecture in Golang projects. This project has 4 layer : Infrastruct

daiki sakuma 4 Feb 20, 2022
Learning and Practice - Go Lang

Go Lang - Learning and Practice All the code stored here is provided by Tour of Go Basics Packages, variables, and functions Flow control statements:

Carlos López 1 Jan 14, 2022
Comparison of Pixel and Ebiten API on the trees tutorial

Rewriting the trees tutorial of Pixel with Ebiten for API comparison I tried Pixel and really liked the clean API but the dev seems to be on pause sin

null 4 Dec 7, 2021
Example skills and a cli utility written in Go for interacting with Webex Assistant Skills

Webex Assistant Skills - Go This repository holds example skills and a cli utility written in Go for interacting with Webex Assistant Skills. It is in

Darren Parkinson 0 Oct 29, 2021
Cook amazing genetic parts using our cookbook. Recipes and synthetic biology tools to take your breath away.

friendzymes-cookbook Friendly tools for a friendly community. A collection of tutorials and genetic tools for synthetic biology. This cookbook is a su

iGEM Software 2021 8 Aug 19, 2022
A go blog demo by gin and gorm!

A go blog demo by gin and gorm!

halo_young 1 Dec 30, 2021
I will be uploading some basic programming in Golang so if you want to contribute please Fork this repo and contriute.

Go-language I will be uploading some basic programming in Golang so if you want to contribute please Fork this repo and contriute. This repo is for pr

Sahitya Roy 3 Jan 21, 2022
This is an example of a keep-it-simple directory layout for Go projects that was created using DDD principles, please copy and share if you like it.

DDD Go Template This project was created to illustrate a great architectural structure I developed together with @fabiorodrigues in the period I was w

Vinícius Garcia 38 Nov 10, 2022
Simple boilerplate code to get started with building and deploying a serverless CRUD API

Simple boilerplate code to get started with building and deploying a serverless CRUD API with Go, MongoDB and Netlify

Brian Min 2 Jan 20, 2022
How to work with channels, goroutines, tickers, mutexes and context cancelation

Concurrency tasks This page holds 4 concurrency practical tasks to help you to understand how to write concurrent code. They will help you to understa

Hlib Terentiev 0 Nov 9, 2021
Tutorial and sample codes for Go language

Tutorial and sample codes for Go language

Chih-fan Hsin 1 Jan 4, 2022