c718333
Contributor
Contributor

VMWare Tools/Ubuntu 9.04 issue - "Unable to build the vmhgfs module."

Jump to solution

Because vmhgfs did not built correctly during the VMWare tools installation, I am unable to access my VMWare "Shared Folders".

I tried to create a new virtual machine in VMWare Fusion 2.0.4 (159196) running Ubuntu 9.04 (Jaunty Jackalope) using the ubuntu-9.04-desktop-i386.iso installer. During the creation of the VM I DID NOT use the "Linux Easy Install".

Once the installation was complete I attempted to install the VMWare Tools. Everything was going along fine, until the VMWare tools installer gave the error "Unable to build the vmhgfs module". Now I am unable to access the "Shared Folders" through VMWare.

This is the relevant output from the VMWare Tools installation:

Extracting the sources of the vmhgfs module.
Building the vmhgfs module.
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmhgfs-only'
make -C /lib/modules/2.6.28-11-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.28-11-generic'
CC /tmp/vmware-config0/vmhgfs-only/backdoor.o
CC /tmp/vmware-config0/vmhgfs-only/backdoorGcc32.o
CC /tmp/vmware-config0/vmhgfs-only/bdhandler.o
CC /tmp/vmware-config0/vmhgfs-only/cpName.o
CC /tmp/vmware-config0/vmhgfs-only/cpNameLinux.o
CC /tmp/vmware-config0/vmhgfs-only/cpNameLite.o
CC /tmp/vmware-config0/vmhgfs-only/dentry.o
CC /tmp/vmware-config0/vmhgfs-only/dir.o
CC /tmp/vmware-config0/vmhgfs-only/file.o
CC /tmp/vmware-config0/vmhgfs-only/filesystem.o
CC /tmp/vmware-config0/vmhgfs-only/fsutil.o
CC /tmp/vmware-config0/vmhgfs-only/hgfsBd.o
CC /tmp/vmware-config0/vmhgfs-only/hgfsEscapeLinux.o
CC /tmp/vmware-config0/vmhgfs-only/hgfsUtil.o
CC /tmp/vmware-config0/vmhgfs-only/inode.o
CC /tmp/vmware-config0/vmhgfs-only/kernelStubsLinux.o
CC /tmp/vmware-config0/vmhgfs-only/link.o
CC /tmp/vmware-config0/vmhgfs-only/messageBackdoor.o
CC /tmp/vmware-config0/vmhgfs-only/message.o
CC /tmp/vmware-config0/vmhgfs-only/module.o
CC /tmp/vmware-config0/vmhgfs-only/page.o
/tmp/vmware-config0/vmhgfs-only/page.c: In function ‘HgfsDoWriteBegin':
/tmp/vmware-config0/vmhgfs-only/page.c:763: warning: ISO C90 forbids mixed declarations and code
/tmp/vmware-config0/vmhgfs-only/page.c: In function ‘HgfsWriteBegin':
/tmp/vmware-config0/vmhgfs-only/page.c:867: error: implicit declaration of function ‘__grab_cache_page'
/tmp/vmware-config0/vmhgfs-only/page.c:867: warning: assignment makes pointer from integer without a cast
make[2]: *** Error 1
make[1]: *** \[_module_/tmp/vmware-config0/vmhgfs-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.28-11-generic'
make: *** \[vmhgfs.ko\] Error 2
make: Leaving directory `/tmp/vmware-config0/vmhgfs-only'
Unable to build the vmhgfs module.
The filesystem driver (vmhgfs module) is used only for the shared folder
feature. The rest of the software provided by VMware Tools is designed to work
independently of this feature.
If you wish to have the shared folders feature, you can install the driver by
running vmware-config-tools.pl again after making sure that gcc, binutils, make
and the kernel sources for your running kernel are installed on your machine.
These packages are available on your distribution's installation CD.
\[ Press Enter key to continue \]

A blog post at addresses this issue, and the solution is to edit a line in the page.c file, re-tar the modified folder, and then re-run the VMWare tools installation. When I try to re-run the VMWare tools installation, however, I get the following error:

The following VMware kernel modules have been found on your system that were
not installed by the VMware Installer. Please remove them then run this
installer again.
vmxnet
vmblock
vmci
vmmemctl
I.e. - 'rm /lib/modules/2.6.28-11-generic/misc/<ModuleName>.{o,ko}'
Execution aborted.

Any help would be appreciated.

0 Kudos
1 Solution

Accepted Solutions
smunnings
Contributor
Contributor

The blog instructions worked fine to fix the hgfs problems.

However, I would suggest the following sequence:

a. Run vmware-uninstall-tools.pl (so you don't get that other message about the installed modules)

b. create the vmware-tools-distrib directory

c. Apply the fix as per the blog page

d. run vmware-install.pl

If all else fails, follow the suggestion of the error message to remove the modules "by hand" and then re-run the install

View solution in original post

0 Kudos
19 Replies
cgc
Contributor
Contributor

I did exactly what you did using the same distro and had the exact same error message. Very interested in how to fix this...

0 Kudos
smunnings
Contributor
Contributor

The blog instructions worked fine to fix the hgfs problems.

However, I would suggest the following sequence:

a. Run vmware-uninstall-tools.pl (so you don't get that other message about the installed modules)

b. create the vmware-tools-distrib directory

c. Apply the fix as per the blog page

d. run vmware-install.pl

If all else fails, follow the suggestion of the error message to remove the modules "by hand" and then re-run the install

View solution in original post

0 Kudos
c718333
Contributor
Contributor

Thanks, uninstalling VMWare tools, following the instructions in the blog and then reinstalling VMWare tools fixed the issue. I can see my shared folders again. Thanks again.

0 Kudos
vanduenkel
Contributor
Contributor

Could anyone of those who managed to fix the issue please give some more details where exaclty in file page.c they did the fixes? Was not clear to me reading the blog post.

Thanks,

vanduenkel

0 Kudos
smunnings
Contributor
Contributor

The blog uses a kind of shorthand (based on patch lines)

\- page = __grab_cache_page(mapping, index);

+ page = grab_cache_page_write_begin(mapping, index, flags);

it means:

find the line:

page = __grab_cache_page(mapping, index);

remove it and replace it with the following line:

page = grab_cache_page_write_begin(mapping, index, flags);

or you could read it as - make changes to the first line to make it look like the second line.

So, just search (in an editor) for "__grab_cache_page"

You should then just be able to make the suggested change to the line.

0 Kudos
WoodyZ
Immortal
Immortal

Could anyone of those who managed to fix the issue please give some more details where exaclty in file page.c they did the fixes? Was not clear to me reading the blog post.

I think the directions are self explanatory however maybe the following will make it clearer.

It is line 867 in the page.c file that is in the vmhgfs.tar tarball as shown in the attached image that needs to be patched.

I have also attached a page.c.patch.zip file that contains a diff patch created under Fusion 2.0.4 and have verified it will work with 2.0.2 and 2.03 and was not applicable to 2.0.1 or 2.0.0. Note: The is for the page.c file that is in the vmhgfs.tar tarball in the VMwareTools.tar.gz file in the "/Library/Application Support/VMware Fusion/isoimages/linux.iso" file that is the VMware Tools for Linux when installing from the tar.gz installer.

The syntax to use the patch is: patch page.c page.c.patch

Message was edited by: WoodyZ - Updated the Fusion versions the page.c.patch file works with.

0 Kudos
ginswizzle
Contributor
Contributor

I think I made the page.c change and did the VMware Tools install/uninstall correctly, but I'm not seeing my shared folders. I've restarted and checked that shared folders are active in the VM settings. how do I fix this? where should the shared folders be showing up in Ubuntu?

0 Kudos
WoodyZ
Immortal
Immortal

where should the shared folders be showing up in Ubuntu?

Look in: /mnt/hgfs

0 Kudos
WoodyZ
Immortal
Immortal

For those looking for an automated solution to installing VMware Tools in Ubuntu 9.04 Desktop Edition which incorporates information found in this thread and additional changes that need to be made have a look at:

0 Kudos
bobcov
Contributor
Contributor

Woody, slightly off topic, but you may be able to help. I installed 8.0.4 JeOS which started life at about 100 megs. After install, it was about 455 megs. Then I did a minimal install of gnome-core synaptic, firefox and a few other things. This brought it up to 937 meg..Not so ideal, but I could live with that.

However, after doing build-essential and get the headers and stuff to load and install vmware-tools, I end up at 1.79 GB! I was wondering if you can think of any way I can get back down to a lower number. I've tried the deborphan thing, the dead packages thing, etc. I just don't get why everything would bloat by 700 meg just because I took the steps to install vmware tools.

Can I get rid of all of the build tools? I don't think they took up that much. The vmware tar was 200 meg. That's gone. I just don't get what happened. This can't be all necessary code.

-Bob

0 Kudos
admin
Immortal
Immortal

The vmware tar was 200 meg. That's gone. I just don't get what happened. This can't be all necessary code.

A lot of the space taken up by Linux Tools is for prebuilt kernel modules, most of which you will probably never use. You can probably go through and prune them (though I forget where they end up), or even skip Tools installation entirely, which is what I do on my minimal installs.

0 Kudos
bobcov
Contributor
Contributor

Hi,

All I want is cut and paste between the XP host and the Ubuntu guest and automatic resizing of the guest when the vm window is resized. Are you saying I can get away with no install or a smaller install of tools? If so, please give me a few tips on how to do that.

Also, how do you go about removing the unneeded stuff? What are the file suffixes?

I just also noticed a nasty bug with player: It always stays on top. I built the VM in workstation, so I hadn't seen the problem. I'm guessing the solution is to roll back to an earlier version of vmplayer. I have 2.5.2 right now.

0 Kudos
admin
Immortal
Immortal

This is the Fusion forum, so if you're using Player, that's important to know.

All I want is cut and paste between the XP host and the Ubuntu guest and automatic resizing of the guest when the vm window is resized.

Oh, I skimmed your post and based on the JeOS mention assumed that you had a minimal command-line installation (in which case you don't care about things like this because they won't work anyway).

Also, how do you go about removing the unneeded stuff?

Just sudo rm them, the tricky part is knowing which files you can get rid of safely. Like I said, I don't recall this off the top of my head.

0 Kudos
bobcov
Contributor
Contributor

Whoops! Sorry about being in the Fusion forum! Yeah, I'm running vmware player on XP, though I got an invite in email to beta fusion so I'll be doing that soon.

I did find a HUGE file in my install which I deleted. I think when I did build-essential, the os made a backup copy of some core kernel file which was 400 meg. I deleted that on another build just to be sure nothing bad would happen, then deleted it on my normal system and all was well...until I used fslint to delete things. Not a good idea. But I had a backup, so I was able to recover from that, too.

Biggest problem now: VMware Player 2.5.x has a bug relating to focus. If you click on another window, Player stays in the foreground unless you click on the title bar of the other window. This is not good.

0 Kudos
codfather
Contributor
Contributor

I came across exactly the same problem when trying to install Ubuntu 9.04 on a Windows XP machine and VMware workstation 6.5.2 and VmwareTools-7.8.5-156735.tar.gz.

I fixed the problem by using the tools supplied with the latest VMware Workstation 7 beta , VMwareTools-8.1.0-169612.tar.gz. It also fixed a few other issues with the mouse.

Does anyone know of a link to the latest VMwareTools files to download without having to drag them out of a beta ? The only links I can find on the web point to open-vm, and they won't compile on this image as the version of glibc is too down level.

Cheers

Nick

0 Kudos
admin
Immortal
Immortal

As a reminder, the first rule of private betas is that you're not allowed to talk about private betas (in public forums). If you had been using the right forum, you might have noticed there's already a thread about this.

0 Kudos
codfather
Contributor
Contributor

My goodness, what charm school did you go too? Enlighten me as to the correct forum that I should discuss such secret matters. The beta forum links I have in the testing emails don't work, and the email I sent with feedback has been ignored, great customer service.

As the VMware tools are built on open-vm tools, what exactly are you being so secretive about? I'm not exactly dissecting the latest innovations in your VMM.

The real issue here is why there isn't an easily accessible download site for customers to go and get the latest released and beta builds of these tools. It is ridiculous the lengths paying customers like me have to go to to get their vm's working. I'm afraid this smacks of amateurism.

I don't have any of this nonsense with Virtualbox or Xen, it is all open and easily accessible.

Nick

0 Kudos
bobcov
Contributor
Contributor

Um, I am thinking there's not an easier way to say it other than how he did say it and he is right that betas do come with some restrictions. On the otherhand, I can understand the frustration of not being able to find a link that works. Maybe he'll help you out through private mail with further discussion of this issue.

0 Kudos
MarcioAB
Contributor
Contributor

Thank you and the blog post. The workaround works fine.

I just wonder how mortal users can survive in such environment ...

0 Kudos