Skip to content

driver: Fix the detection of VM IP using prlctl command#440

Merged
legal90 merged 2 commits intomasterfrom
fix-ip-detection
Mar 23, 2023
Merged

driver: Fix the detection of VM IP using prlctl command#440
legal90 merged 2 commits intomasterfrom
fix-ip-detection

Conversation

@legal90
Copy link
Collaborator

@legal90 legal90 commented Mar 23, 2023

It completes the fix introduced in #434

The previous statement with || operator always returned empty string if it was returned by read_guest_ip_dhcp. Now we are checking the result properly.
Also, I added the loop to make sure that we wait for the real IP instead of returning '' expecting the SSH client to retry.

Previous statement with || operator always returned empty string if it was returned by read_guest_ip_dhcp.
Now we are checking the result properly.
Also, I added the loop to make sure that we wait for the real IP instead of returning '' expecting the SSH client to retry.
@bineesh-n
Copy link
Contributor

Still it can't detect IP from macvms. See the result of ssh-config :

testing vagrant ssh-config
Host default
  HostName
  User vagrant
  Port 22
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /Users/bineeshnadukkalam/.vagrant.d/boxes/mac13/0/parallels/vagrant_private_key
  IdentitiesOnly yes
  LogLevel FATAL

@legal90 I'm no ruby/vagrant expert, I think as per the implementation, 5 times trying for ip & wait 2 seconds, is not enough for macvms. Instead of ' ' you can try returning nil which will trigger vagrant's retry mechanism

@bineesh-n
Copy link
Contributor

bineesh-n commented Mar 23, 2023

Hi @legal90 I think this has some additional code, which are not required. I've commented it. I can do the changes if you want.

IP came correctly with these changes though.

@legal90 legal90 merged commit 858dd51 into master Mar 23, 2023
@legal90
Copy link
Collaborator Author

legal90 commented Mar 23, 2023

Thank you for the review, @bineesh-n !
Released as v2.3.1

@legal90 legal90 deleted the fix-ip-detection branch March 23, 2023 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants