VMware Communities
cookieme
Enthusiast
Enthusiast

Disconnecting wifi on Mac without removing host access to VM?

I need my VM to have internet access through my Mac's network connection (wifi in my case) and I get this with "Share with my Mac" which uses NAT.

When I **disconnect** my Mac from a wifi network (note: wifi is still **on**), the VM is naturally disconnected from the LAN, however the VM is also **disconnected** from the host. This means that I'm no longer able to, for example SSH into the VM from my Mac host, which is a **major** problem when I'm in a location (e.g. airplane) where I don't want to connect to a wifi network.

My setup:

* MBA with wifi only

* macOS 12.3

* Linux VM

* VM's network adapter configured as "Share with my Mac"

How can I achieve a NAT connection, but when the host wifi is off or disabled I still have the **local host to VM** connection?

0 Kudos
16 Replies
cookieme
Enthusiast
Enthusiast

This surely can't be an unusual situation and there must be users who work on an airplane without wifi and use VMs for development or other technical work.

Maybe something has changed in later versions of macOS because I don't recall the requirement to be connected to a wifi network for a VM to be accessible from the Mac host when using "Share with my Mac" 🤔

0 Kudos
ColoradoMarmot
Champion
Champion

I believe you'll need to change the VM to be 'host only' networking in that case.

0 Kudos
cookieme
Enthusiast
Enthusiast

That's not very convenient. I don't understand why using "Share with my mac" stops working when wifi is disconnected.Terrible user-experience 😞

 

0 Kudos
RDPetruska
Leadership
Leadership

Well, the other option is to use a full-duplex loopback dongle in your RJ45 port, and point to that "NIC".

If your computer doesn't have network access, then why would you expect a setting which SHARES that access to work?

If it's something you encounter frequently, it's probably easier to add a second virtual NIC to the VM as host-only, and toggle which NIC is disabled (via the toolbar icons) to tell the guest which NIC to use.

0 Kudos
cookieme
Enthusiast
Enthusiast

> If your computer doesn't have network access, then why would you expect a setting which SHARES that access to work?

I don't think it unreasonable to expect that **disconnecting** from a wifi network doesn't **also** disconnect the VM from your Mac host. I mean logically the VM is getting an IP lease from the internal DHCP server, so why wouldn't host-VM communication continue?

0 Kudos
RDPetruska
Leadership
Leadership

No, no it isn't.  If you are using bridged mode, then the VM is getting it's IP, etc., from your external source.  If that external source goes away, how would you expect the networking to continue to work?

0 Kudos
ColoradoMarmot
Champion
Champion

Exactly, the network stack that the shared access connects to is the Mac's stack.  When the wifi network drops, that stack no longer exists.

0 Kudos
Technogeezer
Immortal
Immortal

But NAT is different than bridge networking.

I can see @cookieme 's thought here. If you think of NAT as a network router that's got connectivity to a  "local" network (the NAT network segment) and "remote" connectivity (the Mac's external network), one could expect that if the "remote" side is unavailable, the "local" network should still work. The Mac has an address on that "local" segment, and it should theoretically still be accessible. 

If you have a wireless router, you don't lose your internal network should the external uplink go offline, do you? No. You just lose the gateway to the outside world.

 

- Paul (Technogeezer)
Editor of the Unofficial Fusion Companion Guides
RDPetruska
Leadership
Leadership

Ahh, sorry.  As a power user, the nomenclature on Macs still confuses me, as they try to dumb down the user interface.  I thought OP was using bridged mode.   

Yes, I would agree that I would also expect a NAT connection to still maintain the internal networking connection if the external interface goes down.

0 Kudos
ColoradoMarmot
Champion
Champion

I wonder if this is because it uses the apple networking stack now for external access, and the host OS brings it down when the connection is lost?

 

 

0 Kudos
Technogeezer
Immortal
Immortal

Just ran a test. There didn't appear to be any change in the macOS networking status (examined through ifconfig) of the bridge or associated vmenet interfaces created by Fusion between when I had the WiFi on or off. The IP address of the Mac on the NAT network also is able to be ping'ed.

- Paul (Technogeezer)
Editor of the Unofficial Fusion Companion Guides
0 Kudos
cookieme
Enthusiast
Enthusiast

@Technogeezer you explained it perfectly!

I also did some more testing with an older macOS (10.14.6) and VMware Fusion (11.5.7) version. Disconnecting from a wifi network on the host or turning off wifi altogether **does not** disable the host-VM network connection.

Something has definitely changed and unless I've missed an announcement or known issue in a newer VMware Fusion release, this is a pretty big deal IMO.

Maybe as @ColoradoMarmot suggests the recent behaviour change is due to VMware using Apple's Hypervisor framework. Regardless, there should be a workaround or known issue explaining that disconnecting from a wifi network or turning off wifi will render the VM isolated from the host!

@Mikero can you please comment?

0 Kudos
cookieme
Enthusiast
Enthusiast


@Technogeezer wrote:

Just ran a test. There didn't appear to be any change in the macOS networking status (examined through ifconfig) of the bridge or associated vmenet interfaces created by Fusion between when I had the WiFi on or off. The IP address of the Mac on the NAT network also is able to be ping'ed.


I observed the same on the macOS side, I can ping the NAT gateway, however the VM's network adapter does not receive an IP lease from the macOS DHCP server.

Did you see the same @Technogeezer?

I thought I'd try and set a static IP in the VM (same ip as DHCP lease) and then bring up the interface. Bringing up the interface fails in the linux VM. Nothing in the linux logs indicates any errors.

0 Kudos
cookieme
Enthusiast
Enthusiast

Bumping this.

It seems that things changed when VMware moved to using Apple's DHCP server and AFAIK there's no official known issue about how the "Share with my Mac" network connection has changed from previous macOS and VMware Fusion versions! 

It would be great to hear from VMware on this issue which I regard as quite critical to many users' workflows. cc @Mikero 

0 Kudos
cookieme
Enthusiast
Enthusiast

Bumping this thread again in the hope that someone from VMware might respond with a solution to what it is a really frustrating issue.

0 Kudos
continuum
Immortal
Immortal

If NAT does not work - use a second hostonly network to connect host and VM.

Ulli

 


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos