VMware Cloud Community
wheelz311
Contributor
Contributor
Jump to solution

Unable to build vmxnet modules for ClearOS (CentOS based)

I've been playing around with this distro and trying to get VMware tools (open or not) to install. If I use the standard tar file, I get errors on the network driver modules (and vsock) that say it is unable to build them. I've tried a bunch of different methods including the ones in the VMware OS Guest guide, but none have worked so far. Does anyone know how to get vmware tools fully installed?

I'm running this on 4.0 Update 1 and the guest is a 2.6.18 kernel.

Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
mjpcomp
Enthusiast
Enthusiast
Jump to solution

Since it's hard for me to tell in what state your vm began (e.g. NIC settings), and how it was configured/changed since then, it might be troublesome to figure out without lots of back-and-forth. Since I'm assuming you just built the VM, and if you don't mind starting over with a fresh one, then you can follow these steps and be up and running in no time:

Create a new VM - the O.S. type should be RHEL 5 32bit.

Create NICs - make them Flexible.

During setup, the NICs will be detected as PCNet32 and whatnot, so they will work while we do updates and whatnot...

1: After ClearOS is installed, complete the WebConfig to setup networking and device properties. Do not configure or setup anything else, you'll do that after we have VMWare Tools installed.

2: Download PuTTY (www.putty.nl) or your choice of SSH client, and SSH into the IP address of the ClearOS setup. (you can also do this all through the vSphere client console, but PuTTY lets you adjust the screen size and you can copy/paste the commands I'm typing below).

Login with root and the password you typed in during the initial install.

3: type:

yum upgrade

(answer yes)

yum install gcc kernel-devel

(answer yes)

uname -r

rpm -q kernel-devel

(make sure the versions of the above two match exactly)

4: Now, using the vSphere Client, do the "Guest -> Install Vmware tools" fun stuff...

5: Returning back to the SSH / vSphere console session:

mkdir /mnt/cdrom

mount /dev/cdrom /mnt/cdrom/

cd /mnt/cdrom/

cp -rp VM*.tar.gz /tmp

cd /tmp

tar -zxvf VM (hit the TAB key after typing VM (all caps, no space) to fill in the full name, ex: VMwareTools-4.0.0-208167.tar.gz, or just type it yourself)

cd /tmp/vmware-tools-distrib/lib/modules/source/

mkdir 1

cp vmxnet.tar 1

cd 1

tar -xvf vmxnet.tar

nano -w vmxnet-only/compat_netdevice.h

Comment out the line as per: http://bugs.centos.org/view.php?id=3977

(add a /* before, and a */ after:)

struct napi_struct {

int dummy;

};

So it will look like this:

/*

struct napi_struct {

int dummy;

};

*/

Now, hit CTRL-O to save, and CTRL-X to exit nano

rm vmxnet.tar

tar -cvf vmxnet.tar vmxnet-only/

mv vmxnet.tar (answer yes to overwrite)

cd /tmp/vmware-tools-distrib/

./vmware-install.pl --default

And that will build the tools - with all the default choices...

After it's done, you'll see a message about what you need to do to change your networking. You can follow that (if you used an SSH session - copy those lines and type them into the console session, you'll lose your connection). If you are using the console, write the lines down since the second you do the stop networking command, the lines will go off screen...

Let me know if you need any other assistance.

View solution in original post

0 Kudos
7 Replies
Texiwill
Leadership
Leadership
Jump to solution

Hello,

You may wish to post some of the errors, that will help us to help you. Are you sure the compiler, kernel-headers, and kernel-src are installed?


Best regards,
Edward L. Haletky VMware Communities User Moderator, VMware vExpert 2009

Now Available: 'VMware vSphere(TM) and Virtual Infrastructure Security'[/url]

Also available 'VMWare ESX Server in the Enterprise'[/url]

Blogging: The Virtualization Practice[/url]|Blue Gears[/url]|TechTarget[/url]|Network World[/url]

Podcast: Virtualization Security Round Table Podcast[/url]|Twitter: Texiwll[/url]

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos
wheelz311
Contributor
Contributor
Jump to solution

Most of what I found on the web said to use yum to install kernel-devel, gcc, and gcc-c++, so that is what I loaded. Are there other components that I need?

When I run the configure script from the included VMware Tools Install (not open-vm-tools):

vmmemctl builds fine

I say no to vmhgfs as I don't need that component

vmxnet fails to build with these errors:

In file included from /tmp/vmware-config0/vmxnet-only/vmxnet.c:39: /tmp/vmware-config0/vmxnet-only/compat_netdevice.h:299: error: redefinition of 'struct napi_struct'

make[2]: *** Error 1

make[1]: *** Error 2

make[1]: Leaving directory '/usr/src/kernels/2.6.18-164.6.1.v5-i686'

make: *** http://vmxnet.ko Error 2

make: Leaving directory '/tmp/vmware-config0/vmxnet-only'

Unable to build the vmxnet module.

vmblock builds fine

vmci builds fine

vsock builds fine

vmxnet3 failed to build with these errors:

In file included from /tmp/vmware-config1/vmxnet3-only/vmxnet3.c:43: /tmp/vmware-config1/vmxnet3-only/compat_netdevice.h:299: error: redefinition of 'struct napi_struct'

make[2]: *** Error 1

make[1]: *** Error 2

make[1]: Leaving directory '/usr/src/kernels/2.6.18-164.6.1.v5-i686'

make: *** http://vmxnet3.ko Error 2

make: Leaving directory '/tmp/vmware-config1/vmxnet3-only'

Unable to build the vmxnet3 module.

pvscsi builds fine

Any ideas?

Thanks!

Edit: For some reason it keeps formatting my text with strike-outs and an http link (that is supposed to be vmxnet.ko and vmxnet3.ko in square brackets)

0 Kudos
mjpcomp
Enthusiast
Enthusiast
Jump to solution

This should help:

http://bugs.centos.org/view.php?id=3977

You need to comment out those lines in the vmnet source for it to build properly...

Here's some more information regarding it:

http://www.clearfoundation.com/component/option,com_kunena/Itemid,232/catid,40/func,view/id,3614/

http://communities.vmware.com/message/1372156#1372156

I believe someone has attached a replacement vmnet.tar file you can copy over into your build source for the tools.

0 Kudos
wheelz311
Contributor
Contributor
Jump to solution

It build successfully!! Unfortunately the NICs are still missing when I do an ifconfig. On reboot the vmxnet modules appear to load successfully now. After switch the NICs from e1000 to vmxnet3, only the loopback is listed from ifconfig. This is probably just my ignorance about Linux based OSes. Is there something I have to do to get it to see the new adapter (besides reboot)? Thanks.

0 Kudos
mjpcomp
Enthusiast
Enthusiast
Jump to solution

Since it's hard for me to tell in what state your vm began (e.g. NIC settings), and how it was configured/changed since then, it might be troublesome to figure out without lots of back-and-forth. Since I'm assuming you just built the VM, and if you don't mind starting over with a fresh one, then you can follow these steps and be up and running in no time:

Create a new VM - the O.S. type should be RHEL 5 32bit.

Create NICs - make them Flexible.

During setup, the NICs will be detected as PCNet32 and whatnot, so they will work while we do updates and whatnot...

1: After ClearOS is installed, complete the WebConfig to setup networking and device properties. Do not configure or setup anything else, you'll do that after we have VMWare Tools installed.

2: Download PuTTY (www.putty.nl) or your choice of SSH client, and SSH into the IP address of the ClearOS setup. (you can also do this all through the vSphere client console, but PuTTY lets you adjust the screen size and you can copy/paste the commands I'm typing below).

Login with root and the password you typed in during the initial install.

3: type:

yum upgrade

(answer yes)

yum install gcc kernel-devel

(answer yes)

uname -r

rpm -q kernel-devel

(make sure the versions of the above two match exactly)

4: Now, using the vSphere Client, do the "Guest -> Install Vmware tools" fun stuff...

5: Returning back to the SSH / vSphere console session:

mkdir /mnt/cdrom

mount /dev/cdrom /mnt/cdrom/

cd /mnt/cdrom/

cp -rp VM*.tar.gz /tmp

cd /tmp

tar -zxvf VM (hit the TAB key after typing VM (all caps, no space) to fill in the full name, ex: VMwareTools-4.0.0-208167.tar.gz, or just type it yourself)

cd /tmp/vmware-tools-distrib/lib/modules/source/

mkdir 1

cp vmxnet.tar 1

cd 1

tar -xvf vmxnet.tar

nano -w vmxnet-only/compat_netdevice.h

Comment out the line as per: http://bugs.centos.org/view.php?id=3977

(add a /* before, and a */ after:)

struct napi_struct {

int dummy;

};

So it will look like this:

/*

struct napi_struct {

int dummy;

};

*/

Now, hit CTRL-O to save, and CTRL-X to exit nano

rm vmxnet.tar

tar -cvf vmxnet.tar vmxnet-only/

mv vmxnet.tar (answer yes to overwrite)

cd /tmp/vmware-tools-distrib/

./vmware-install.pl --default

And that will build the tools - with all the default choices...

After it's done, you'll see a message about what you need to do to change your networking. You can follow that (if you used an SSH session - copy those lines and type them into the console session, you'll lose your connection). If you are using the console, write the lines down since the second you do the stop networking command, the lines will go off screen...

Let me know if you need any other assistance.

0 Kudos
wheelz311
Contributor
Contributor
Jump to solution

That did work, though I am a little confused. Your steps never changed the network adapters from flexible to vmxnet. So does flexible run vmxnet if that driver is installed and the PCnet32 if it is not? Also does that mean I can't use vmxnet3? If I change the same code as vmxnet, it can then build the vmxnet3. However I tried a couple ways of changing the adapters and it didn't seem to work.

0 Kudos
wheelz311
Contributor
Contributor
Jump to solution

FYI to those that try the same thing. I was able to get this to work by following mjpcomp's instructions, but then shuting down the VM, deleting the Flexible NICs, adding the same number vmxnet3 NICs, and then booting it back up.

0 Kudos