Vagrant confused between two virtual boxes with SSH | Mac OS Big Sur | VMWare Fusion
rushi47 opened this issue · 4 comments
rushi47 commented
Debug output
rushi@Rushikeshs-MacBook-Air 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)
---
rushi@Rushikeshs-MacBook-Air uvagrant % pwd
/-------/uvagrant
---
rushi@Rushikeshs-MacBook-Air uvagrant % vagrant ssh
vagrant@127.0.0.1's password:
vagrant@build:~
rushi@Rushikeshs-MacBook-Air demoMachine % vagrant port
22 (guest) => 2200 (host)
---
rushi@Rushikeshs-MacBook-Air demoMachine % pwd
/-----/demoMachine
---
rushi@Rushikeshs-MacBook-Air demoMachine % vagrant ssh
Last login: Fri Sep 23 17:29:08 2022 from 192.168.103.1
vagrant@build:~$
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.
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
rushi@Rushikeshs-MacBook-Air uvagrant % vagrant -v
Vagrant 2.3.0
Host operating system
rushi@Rushikeshs-MacBook-Air 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
rushi@Rushikeshs-MacBook-Air demoMachine % sw_vers
ProductName: macOS
ProductVersion: 11.6.5
BuildVersion: 20G527
rushi@Rushikeshs-MacBook-Air 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
- Install vmware fusion on mac os big sure
- Get the above guest os and spin up two instance of this machine
- Try SSH into them
Vagrantfile
Machine-1
rushi@Rushikeshs-MacBook-Air 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
rushi@Rushikeshs-MacBook-Air 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 :
rushi@Rushikeshs-MacBook-Air uvagrant % sudo lsof -i -n -P | grep 2200
Password:
vagrant-v 642 root 16u IPv6 0xd60f8eac0f43ea4f 0t0 TCP *:2200 (LISTEN)
rushi@Rushikeshs-MacBook-Air uvagrant % sudo lsof -i -n -P | grep 2222
vagrant-v 642 root 9u IPv6 0xd60f8eac0f7696ef 0t0 TCP *:2222 (LISTEN)
rushi@Rushikeshs-MacBook-Air uvagrant %
Ref: #51