Managing VMware Tools on Linux, Part II: Fixing "An error occurred while mounting" During Boot-up
Bill Malchisky July 15 2013 11:00:00 PM
Two common errors VMware Workstation Linux guest VMs, which I also experience occasionally include: (1) "An error occurred while mounting {mount_point}" or (2) "The disk drive for {mount_point} is not ready yet". Depending upon your configuration, the solution is either the fault of the OS or VMware Tools and the related drivers. This post defines a way to ascertain if the root cause is VMware Tools and if so, how to quickly and easily remedy the situation.Problem Background
My production VMs have at least one VMware Shared Folder back to the host OS, so that I can access downloaded files in a normalized manner. As these links stopped working one day, started investigating a solution. What was clear though, in all cases each Shared Folder mount point displayed nothing when accessed.
After extensively searching forums, blogs, and wikis for answers, I learned there is a complete lack of consistency in what they suggest. No clear-cut solution worked unanimously for commenters. Most suggestions assumed either: (1) you were in a dual-boot scenario sans explicitly stating it most of the time (and where VMware would usually be out-of-scope); (2) other comments and posts utilized VMware specific jargon (e.g. Shared Folders, guest OS) and the suggestions therein did not work if applied across non-VMware configurations; or (3) included untested suggestions best for non-production systems. It is also important to know what you are trying to mount and how. For example, in a dual-boot configuration that also happens to run VMware Workstation locally, you can easily create another problem while never addressing the original; the device error can throw you if you are looking for a solution with the incorrect device. I discuss this in more detail later in this post.
In testing further on my systems, I found a way that worked on three VMs at the time of this writing.
Isolating The Root Cause
Here is how you can isolate the underlying cause. We will test how well VMware Tools is working. That is the easiest and best path to success.
First, we need to restart VMware Tools and test for any startup errors.
$sudo /etc/vmware-tools/services.sh restart
VM communication interface: [FAILED]
if you see any failed entries, then the kernel hooks and tools need proper configuration and it is an VMware issue that is simple to fix.
N.B. I included the restart output errors for both Ubuntu and CentOS below in the Examples section at the bottom, to minimize scrolling in this section
On Red Hat, I observed that VMware Tools was running, but the Shared Folders displayed nothing. On Ubuntu 12.04 LTS, VMware Tools was NOT running, and the Shared Folders displayed nothing. Thus, complicating matters a bit, and negating the VMware Tools status test effectiveness at this time in the process (hence my omitting it). Fortunately, the solution for both systems was identical.
Fixing The Core Problem
At this point, what you have is a system with VMware hooks into a kernel that is not being utilized, or kernel hooks that are malfunctioning when accessing the respective device's file system.
What is causing the errors is most likely your upgrading the Linux kernel on your guest OS system and not re-configuring the VMware tools and drivers for the new code. To address this situation, Try these four steps:
1. $sudo /usr/bin/vmware-config-tools.pl
You will be quick to notice that the cited service script below is not in /etc/init.d or in the /usr/bin directories on Ubuntu systems (See notation below for Red Hat syntax).
2. $sudo /etc/vmware-tools/services.sh restart
Stopping VMware Tools services in the virtual machine:
Guest operating system daemon: done
VMware User Agent (vmware-user): done
Blocking file system: done
Unmounting HGFS shares: done
Guest filesystem driver: done
VM communication interface socket family: done
VM communication interface: done
Checking acpi hot plug done
Starting VMware Tools services in the virtual machine:
Switching to guest configuration: done
Guest vmxnet fast network device: done
VM communication interface: done
VM communication interface socket family: done
Guest filesystem driver: done
Mounting HGFS shares: done
Blocking file system: done
VMware User Agent: done
Guest operating system daemon: done
3. $sudo /etc/vmware-tools/services.sh status -> ensures VMware Tools is still running
vmtoolsd is running
4. Check your mount points
N.B.
1. If you are utilizing a Red Hat based Linux flavor, use the #services vmware-tools syntax instead; the 'services.sh' script's location is where you would expect it -- under /etc/init.d
2. When addressing the above commands, if you lack 'sudo' access, then perform a $su - to gain root access--presuming you have the password
The Final Solution in Four Easy Steps
1. Reconfigure the VMware drivers for your new kernel
2. Restart VMware tools
3. Be sure VMware Tools remains running
4. Check your mount points.
Nice and easy. You just need to remember to run through this process whenever you upgrade your kernel file and you should have no problems. If ever in doubt, you can just restart your VMware Tools service and see if you have any errors. If the return text is clean, you are all set.
Reviewing a Few Public Forum Solutions -- What Not To Do
If you are utilizing VMware Shared folders, you do not want to modify your local /etc/fstab file. If you do, you will receive one of several errors when mounting the appended drives.
With this suggested excerpt included in your /etc/fstab file:
UUID=1d5153eb-9d9e-43e6-b473-57d9e8442d11 /mnt/hgfs/HostDownloads vmhgfs ...
yields this error when attempting to mount the Shared Folder:
[root@localhost ~]# mount -a
Error: cannot canonicalize mount point: No such file or directory
Another common suggestion observed indicates utilizing the .host/{mount_point_object} {local directory} syntax. This is preferable for dual-boot systems when accessing the dark side of the HD in your current system. The excerpt below provides a populated /etc/fstab entry:
.host:/home/bill/Downloads/ /mnt/hgfs vmhgfs ...
With VMware Workstation in use, the OS generates a descriptive error when mounting, regardless of whether the Shared Folders process is enabled:
Error: cannot mount filesystem: No such device
Conclusion
In the end, VMware Tools is quite useful and provides significant capabilities, not fully appreciated until the process stops working. When you upgrade your guest OS kernel, you will most likely not be prompted to reconfigure your VMware Tools, as you are with your host OS. Know that VMware is experimenting with auto-upgrading drivers in future releases, but I know not of a timetable for that. Now you know what to do and how to fix it, reliably. Please do ask any questions.
APPENDIX
Examples
The output segments are included for further comprehension, to be used with the Isolating The Root Cause section above.
Ubuntu - VMware Tools Restart Kernel Hook Errors
bill@ubuntu:~$ sudo /etc/vmware-tools/services.sh restart
Stopping VMware Tools services in the virtual machine:
Guest operating system daemon: done
VMware User Agent (vmware-user): done
Blocking file system: done
Unmounting HGFS shares: done
Guest filesystem driver: done
VM communication interface socket family: done
VM communication interface: done
Checking acpi hot plug done
Starting VMware Tools services in the virtual machine:
Switching to guest configuration: done
Guest vmxnet fast network device: failed
VM communication interface: failed
VM communication interface socket family: failed
Guest filesystem driver: done
Mounting HGFS shares: failed
Blocking file system: done
VMware User Agent: done
Guest operating system daemon: done
CentOS - VMware Tools Restart Kernel Hook Errors
[root@localhost ~]# service vmware-tools restart
Stopping VMware Tools services in the virtual machine:
Guest operating system daemon: [ OK ]
VMware User Agent (vmware-user): [ OK ]
Blocking file system: [ OK ]
Unmounting HGFS shares: [ OK ]
Guest filesystem driver: [ OK ]
VM communication interface socket family: [ OK ]
VM communication interface: [ OK ]
Checking acpi hot plug [ OK ]
Starting VMware Tools services in the virtual machine:
Switching to guest configuration: [ OK ]
VM communication interface: [FAILED]
VM communication interface socket family: [FAILED]
Guest filesystem driver: [ OK ]
Mounting HGFS shares: [FAILED]
Blocking file system: [ OK ]
VMware User Agent: [ OK ]
Guest operating system daemon: [ OK ]
.
- Comments [0]