vmware / open-vm-tools

Official repository of VMware open-vm-tools project
http://sourceforge.net/projects/open-vm-tools/
2.26k stars 427 forks source link

Shared folders lose mount points when exiting suspend mode #539

Closed denji closed 3 years ago

denji commented 3 years ago

If the machine is suspended and then resume again, the drives will be unmounted and need to be turned off and on again in "Settings" - "Options" ("Shared Folder" - "Disabled" and only then "Always enabled").

Host: 5.13.13-arch1-1

  $ grep -E '(\S*NAME|VERSION|ID|ID_LIKE|\S*_CODENAME)=' /etc/os-release
  NAME="Ubuntu"
  VERSION="20.04.3 LTS (Focal Fossa)"
  ID=ubuntu
  ID_LIKE=debian
  PRETTY_NAME="Ubuntu 20.04.3 LTS"
  VERSION_ID="20.04"
  VERSION_CODENAME=focal
  UBUNTU_CODENAME=focal
lousybrit commented 3 years ago

If the machine is suspended and then resumes again, the drives will be unmounted and need to be turned off and on again in "Settings" - "Options" ("Shared Folder" - "Disabled" and only then "Always enabled").

Yes, any files opened in the VM after a suspend where the host (and server component) goes away all handles will be stale and will require opening again from the client.

One reason that the client does not make the open handles reconnect in the server is that the files could and are likely to have been modified while the VM was suspended. For these cases, it would be dangerous to have the client keep going with the prior handles and any content that it has read or needs to write out. This could entail losing updates on the files on the host and corrupting it.

With this in mind, the client will return stale handle errors to applications' next use of the filehandle after the resume. This should cause the application to open the file anew.

Steve

denji commented 3 years ago

@lousybrit Another problem that occurs is that when the machine comes out of sleep it starts cyclically consuming host resources with temporary freezes.

VMware® Workstation 16 Pro (16.1.2 build-17966106) Host: 5.13.13-arch1-1

  hgfsWorkerThread| I005: VTHREAD ... "hgfsWorkerThread" tid ...
  hgfsWorkerThread| I005: VTHREAD .... "hgfsWorkerThread" tid ...
  vcpu-0| I005: HgfsThreadpool_Activate: count of worker threads: 10.
  vcpu-0| I005: HgfsServerAllocateSession: init session ... id ...
  vmx| I005: GuestRpcSendTimedOut: message to toolbox-dnd timed out.
  vmx| I005: GuestRpcSendTimedOut: message to toolbox-dnd timed out.
  vmx| I005: TOOLS: appName=toolbox-dnd, oldStatus=1, status=2, guestInitiated=0.
  vcpu-1| I005: TOOLS: appName=toolbox-dnd, oldStatus=2, status=1, guestInitiated=0.
  vmx| I005: GuestRpcSendTimedOut: message to toolbox-dnd timed out.
  vmx| I005: TOOLS: appName=toolbox-dnd, oldStatus=1, status=2, guestInitiated=0.
  vmx| I005: GuestRpcSendTimedOut: message to toolbox-dnd timed out.
  vcpu-1| I005: TOOLS: appName=toolbox-dnd, oldStatus=2, status=1, guestInitiated=0.
  vmx| I005: GuestRpcSendTimedOut: message to toolbox-dnd timed out.
  vmx| I005: TOOLS: appName=toolbox-dnd, oldStatus=1, status=2, guestInitiated=0.
  vcpu-1| I005: TOOLS: appName=toolbox-dnd, oldStatus=2, status=1, guestInitiated=0.
  vmx| I005: GuestRpcSendTimedOut: message to toolbox-dnd timed out.
  vmx| I005: TOOLS: appName=toolbox-dnd, oldStatus=1, status=2, guestInitiated=0.
  vmx| I005: GuestRpcSendTimedOut: message to toolbox-dnd timed out.
  vcpu-1| I005: TOOLS: appName=toolbox-dnd, oldStatus=2, status=1, guestInitiated=0.
  vmx| I005: GuestRpcSendTimedOut: message to toolbox-dnd timed out.
  vmx| I005: TOOLS: appName=toolbox-dnd, oldStatus=1, status=2, guestInitiated=0.
  vcpu-1| I005: TOOLS: appName=toolbox-dnd, oldStatus=2, status=1, guestInitiated=0.
  vmx| I005: GuestRpcSendTimedOut: message to toolbox-dnd timed out.
  vmx| I005: GuestRpcSendTimedOut: message to toolbox-dnd timed out.
  vmx| I005: TOOLS: appName=toolbox-dnd, oldStatus=1, status=2, guestInitiated=0.
  vmx| I005: GuestRpcSendTimedOut: message to toolbox timed out.
  vmx| I005: Tools: [AppStatus] Last heartbeat value 205 (last received 13s ago)
  vmx| I005: TOOLS: appName=toolbox, oldStatus=1, status=2, guestInitiated=0.
  vcpu-0| I005: Tools: [AppStatus] Last heartbeat value 205 (last received 17s ago)
  vcpu-0| I005: TOOLS: appName=toolbox, oldStatus=2, status=1, guestInitiated=0.
  vcpu-0| I005: TOOLS: appName=toolbox-dnd, oldStatus=2, status=1, guestInitiated=0.

Tested on the latest stable versions of Windows 10 Pro N for Workstations and Windows 11 Pro N for Workstations. And the result is always the same, after restoring the machine from sleep the error log above and intermittent freezes without stopping.

It helps to shut down the machine and start up again (resuming the machine after sleep causes cyclic errors GuestRpcSendTimedOut / Tools: [AppStatus] Last heartbeat & cpu overload )

Once have done this, everything is back to normal:

  I005: TOOLS: appName=toolbox-dnd, oldStatus=1, status=2, guestInitiated=0.
  I005: GuestRpcSendTimedOut: message to toolbox-dnd timed out.
  ...

  1. "Settings" - "Options" ("Shared Folder" - "Disabled").
  vcpu-1| I005: VMCIDatagram: Destination resource 13 unsupported.
  vcpu-1| I005: VMCIDatagram: Destination resource 13 unsupported.
  vmx| I005: GuestRpc: Got RPCI vsocket connection 8, assigned to channel 3.
  vmx| I005: GuestRpc: Closing channel 3 connection 8
  vmx| I005: HgfsServer_InitState: initialized notification inactive.

  2. "Settings" - "Options" ("Shared Folder" - "Always enabled").
  vmx| I005: HgfsServer_InitState: initialized threadpool active.
  vmx| I005: HgfsChannelActivateChannel: HGFS [backdoor] channel ACTIVATED.
  vmx| I005: HgfsChannelActivateChannel: HGFS [vmci] channel ACTIVATED.
  vmx| A000: ConfigDB: Setting isolation.tools.hgfs.disable = "FALSE"
  vmx| I005: TOOLS received request in VMX to set option 'synctime' -> '0'
  vmx| A000: ConfigDB: Setting tools.syncTime = "FALSE"
  vmx| I005: VMXVmdb_SetCfgState: cfgReqPath=/vm/#_VMX/vmx/cfgState/req/#e/, remDevPath=/vm/#_VMX/vmx/vigor/setCfgStateReq/#64/in/
  vmx| I005: TOOLS received request in VMX to set option 'synctime' -> '0'
  vmx| A000: ConfigDB: Setting tools.syncTime = "FALSE"
  vmx| A000: ConfigDB: Setting tools.upgrade.policy = "manual"
  vmx| I005: Tools: State change status with no pending request.
  vcpu-0| I005: HgfsChannelVmciConnectInternal: VMCI HGFS server session init complete and opened.
  vcpu-0| I005: HgfsChannelVmciRecvMsgCB: VMCI HGFS server session started: header version: 2.
  hgfsWorkerThread| I005: VTHREAD 14042..."hgfsWorkerThread" tid 759.....
  hgfsWorkerThread| I005: VTHREAD 14042... "hgfsWorkerThread" tid 759.....
  hgfsWorkerThread| I005: VTHREAD 14042... "hgfsWorkerThread" tid 759.....
  hgfsWorkerThread| I005: VTHREAD 14042... "hgfsWorkerThread" tid 759.....
  hgfsWorkerThread| I005: VTHREAD 14042... "hgfsWorkerThread" tid 759.....
  hgfsWorkerThread| I005: VTHREAD 14042... "hgfsWorkerThread" tid 759.....
  hgfsWorkerThread| I005: VTHREAD 14042... "hgfsWorkerThread" tid 759.....
  hgfsWorkerThread| I005: VTHREAD 14042... "hgfsWorkerThread" tid 759.....
  hgfsWorkerThread| I005: VTHREAD 14042... "hgfsWorkerThread" tid 759.....
  hgfsWorkerThread| I005: VTHREAD 14042... "hgfsWorkerThread" tid 759.....
  vcpu-0| I005: HgfsThreadpool_Activate: count of worker threads: 10.
  vcpu-0| I005: HgfsServerAllocateSession: init session 7FB6D..... id a571....