-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Guest IP doesn't get resolved if first network interface is not Shared #185
Comments
This is really strange case :) |
Tell me about it :) I redefine the first adapter and add shared network with provider customizations. I could then forward any ports using prlctl as well. But since I don't need to forward any ports I think DHCP private network would work equally as well, but I am wary of any dependencies on shared networking. Example: config.vm.provider :parallels do |prl, config_override|
config_override.vm.network :public_network, adapter: 0
# on of the two bellow
prl.customize ["set", :id, "--device-add", "net", "--type", "shared"]
config_override.vm.network :private_network
end |
In some custom cases shared adapter can have an index different from "0" #185
I've added the workaround for cases like yours in v1.3.13. Now MAC of "Shared" adapter will be properly detected even if it is not the first. But please be aware that such adapter re-ordering is not a supported case, because Vagrant configures only P.s. @alh84001 So, if you really need this trick, you can use these lines in Vagrantfile instead of mentioned above: config.vm.provider :parallels do |prl, config_override|
config_override.vm.network :public_network, adapter: 0
prl.network_adapter(1, :shared)
end |
Sorry for the late reply, saw it before, but stuff got in the way. Many, many thanks for adding the option. |
Now I know this goes contrary to all the docs, but unfortunately I have a requirement which I can't get around of, where I must have a bridged adapter defined as the first guest network adapter. This causes the guest IP to never be resolved even if I add Shared network as a second adapter. I have this successfully running with VirtualBox so it would be nice to have it supported in Parallels as well.
The root cause is in the VagrantPlugins::Parallels:Driver:PD_8.read_mac_address which takes the first adapter MAC which it assumes belongs to the Shared network adapter and which is later used to look into Parallels DHCP leases to get the IP. However, bridged adapters don't get IP address assigned from Parallels, and their IP won't be listed there.
The fix with the least impact to any existing code out there would be to filter out any bridge MACs (e.g. prlctl ..... --info) before returning the first one.
The text was updated successfully, but these errors were encountered: