open-vm-tools icon indicating copy to clipboard operation
open-vm-tools copied to clipboard

Updated NetworkManager calls in suspend/resume scripts.

Open eerykitty opened this issue 7 months ago • 4 comments

The org.freedesktop.NetworkManager.Enable method used by the suspend/resume scripts changes the NetworkEnabled state in NM, which is persisted to disk in the state file (typically at /var/lib/NetworkManager/NetworkManager.state).

If the resume script fails for any reason at all, the system will be left with NetworkManager in a disabled state, where the service is running, but all interfaces are ignored by NM, and most GUI interfaces will show the network as simply disappeared, as opposed to indicating it is disabled.

This code was added in commit 13ab4cc0a376993ac8b946a3a1f22126a4a36635, which indicates that Enabled is tried first due to a bug in NM 0.9 on Ubuntu 11.10. I have confirmed that at least NM 0.9.1 on Ubuntu 11.10 correctly responds to Sleep, and several modern Linux distributions with modern copies of NM appear to respond correctly.

Use of the Sleep method is preferred, as the change does not persist a cold (re)boot, and avoids potentially leaving the system in state that's confusing to users.

I believe this to be the cause of a problem I've recently encountered, as well as a possible culprit of #426, along with many reports of similar problems across the web. A Google search for vmware "nmcli networking on" or just "nmcli networking on" shows many reports where networking "disappears" from guests, where the nmcli command is able to "fix" the problem.

With the exception of the nmcli tool itself, this network script appears to be the only widespread user of the Enabled dbus method. Outside of manually editing the state file, this is the only way to toggle the NetworkEnabled state, which is not really represented in the UI, especially in GUI frontends for NetworkManager. Since nothing else will ever toggle the NetworkEnabled state automatically, I believe the issue has to be the resume script not running for whatever reason, and leaving NM disabled.

eerykitty avatar Dec 07 '23 06:12 eerykitty

@eerykitty, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

vmwclabot avatar Dec 07 '23 06:12 vmwclabot

@eerykitty, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed.

vmwclabot avatar Dec 07 '23 06:12 vmwclabot

@eerykitty, VMware has approved your signed contributor license agreement.

vmwclabot avatar Dec 07 '23 09:12 vmwclabot

@eerykitty Thanks for your contribution. Your contribution will go through a review process at VMware. An update will be provided once the review is completed.

Hi Joseph, I will file an internal problem report (PR) to track updating the Newtork Manager calls in the Linux "network" script. We will need to test the change in other Linux versions with various versions of the Network Manager.

You can help with this by providing additional details on what specific Linux distributions and versions and the specific version of Network Manager used in each.

Thanks.

johnwvmw avatar Dec 08 '23 21:12 johnwvmw