-
Notifications
You must be signed in to change notification settings - Fork 2k
VMware Fusion can't find IP address on Big Sur #4846
Comments
Well, this did the trick: diff --git a/drivers/vmwarefusion/fusion_darwin.go b/drivers/vmwarefusion/fusion_darwin.go
index fb22c96a..b1dcff5e 100644
--- a/drivers/vmwarefusion/fusion_darwin.go
+++ b/drivers/vmwarefusion/fusion_darwin.go
@@ -194,6 +194,11 @@ func (d *Driver) GetIP() (string, error) {
return "", err
}
+ // attempt to find the address from vmrun
+ if ip, err := d.getIPfromVmrun(); err == nil {
+ return ip, err
+ }
+
// attempt to find the address in the vmnet configuration
if ip, err := d.getIPfromVmnetConfiguration(macaddr); err == nil {
return ip, err
@@ -535,6 +540,18 @@ func (d *Driver) getIPfromVmnetConfiguration(macaddr string) (string, error) {
return "", fmt.Errorf("IP not found for MAC %s in vmnet configuration files", macaddr)
}
+func (d *Driver) getIPfromVmrun() (string, error) {
+ vmx := d.vmxPath()
+
+ ip := regexp.MustCompile(`(\d+\.\d+\.\d+\.\d+)`)
+ stdout, _, _ := vmrun("getGuestIPAddress", vmx)
+ if matches := ip.FindStringSubmatch(stdout); matches != nil {
+ return matches[1], nil
+ }
+
+ return "", fmt.Errorf("could not get IP from vmrun")
+}
+
func (d *Driver) getIPfromVmnetConfigurationFile(conffile, macaddr string) (string, error) {
var conffh *os.File
var confcontent []byte |
Since there is no more vmnet devices on Big Sur, there's no DHCP lease update either. Find ip using vmrun's own feature first, falling back to the legacy ones next. Fixes docker#4846
is there a work for this right now? do you have a compiled binary you could share? |
Compiled with go 1.13 from my branch at #4847. |
awesome, very much appreciated!!! |
your binary doesn't work for me, it just sits looping over the legacy files. |
i found another way around this in my setup.
|
I just created a new one with It seemed to fail to work right away, blocking when waiting for the VM to come up, and ultimately bailing out after 120s of not getting an IP (which But a stop+start made it show the proper IP:
It still failed though:
|
it's interesting you can get a machine to create using default driver, i have to use in any case, if you edit update the lease file by hand, doing a |
Just created a machine successfully from A to Z: Open a first terminal window:
Then, open a second terminal window:
It looks like VMware tools don't come up properly at this stage, but it does run
Notice how the IP is correctly detected: rebooting the VM allowed the tools to start correctly this time, but there is a problem with the certificate. Back in the first terminal, notice that the first command proceeded once it found the IP, only to fail later on, apparently because it could not
But now that we have an IP address we can proceed from there again and complete the crucial missing step:
To have
And while I do get errors such as the above and the ones below, it does appear to work:
Note that barring from the IP issue which is a Big Sur thing, I've had all of those errors on Catalina as well. |
interesting. i can't get a vm to come up using your steps and the also just as an unrelated fyi, vpn routing is broken in big sur/fusion 12 as well, just in case you use it and haven't encountered it yet. i can provide a link to a work around if you need it. hopefully some fix will arise. i am not a fan of |
I'm not sure why, but instead of using
vmrun
, thevmwarefusion
driver attempts to find the guest IP through roundabout ways by looking into DHCP lease files.With the advent of Big Sur, this doesn't work anymore as
vmnet1
/vmnet8
have disappeared in favour of a nativebridge100
interface.Comparatively,
vmrun getGuestIPAddress
just works:I suppose it might just be a case of writing a
getIPfromVmrun()
or something.The text was updated successfully, but these errors were encountered: