VMware Cloud Community
m0ps
Enthusiast
Enthusiast

vmware-tools and FreeBSD 8.0

hi all!

i'll try to install vmware-tools from ESX 4.0 Update 1 on FreeBSD 8.0.

vmware-tools doesn't contain binary kernel modules for 8.0, that's why

i'm try to compile modules from included sources. vmmemctl.ko and

vmxnet.ko compiled successfull, but compilation of vmblock.ko finished

with error:

vfsops.c:116: error: conflicting types for 'VMBlockVFSMount'

vfsops.c:68: error: previous declaration of 'VMBlockVFSMount' was here

vfsops.c: In function 'VMBlockVFSMount':

vfsops.c:159: error: 'AT_FDCWD' undeclared (first use in this function)

vfsops.c:159: error: (Each undeclared identifier is reported only once

vfsops.c:159: error: for each function it appears in.)

vfsops.c:190: error: too many arguments to function 'VOP_UNLOCK'

vfsops.c:212: error: too many arguments to function 'VOP_UNLOCK'

vfsops.c:220:5: error: "BSD_VERSION" is not defined

vfsops.c: At top level:

vfsops.c:257: error: conflicting types for 'VMBlockVFSUnmount'

vfsops.c:72: error: previous declaration of 'VMBlockVFSUnmount' was here

vfsops.c:291:55: error: macro "VOP_LOCK" passed 3 arguments, but takes just 2

vfsops.c: In function 'VMBlockVFSUnmount':

vfsops.c:291: error: 'VOP_LOCK' undeclared (first use in this function)

vfsops.c:298: error: too many arguments to function 'VOP_UNLOCK'

vfsops.c: At top level:

vfsops.c:341: error: conflicting types for 'VMBlockVFSRoot'

vfsops.c:69: error: previous declaration of 'VMBlockVFSRoot' was here

vfsops.c:349:36: error: macro "vn_lock" passed 3 arguments, but takes just 2

vfsops.c: In function 'VMBlockVFSRoot':

vfsops.c:349: error: 'vn_lock' undeclared (first use in this function)

vfsops.c: At top level:

vfsops.c:377: error: conflicting types for 'VMBlockVFSStatFS'

vfsops.c:71: error: previous declaration of 'VMBlockVFSStatFS' was here

vfsops.c:387:64: error: macro "VFS_STATFS" passed 3 arguments, but takes just 2

vfsops.c: In function 'VMBlockVFSStatFS':

vfsops.c:387: error: 'VFS_STATFS' undeclared (first use in this function)

vfsops.c: At top level:

vfsops.c:427: error: conflicting types for 'VMBlockVFSSync'

vfsops.c:70: error: previous declaration of 'VMBlockVFSSync' was here

***Error code 1

any solutions?

best regards, m0ps

best regards, m0ps
Reply
0 Kudos
13 Replies
Texiwill
Leadership
Leadership

Hello,

Moved to the Virtual Machine and Guest OS forum.


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

Virtualization Practice Analyst[/url]
Now Available: 'VMware vSphere(TM) and Virtual Infrastructure Security'[/url]
Also available 'VMWare ESX Server in the Enterprise'[/url]
[url=http://www.astroarch.com/wiki/index.php/Blog_Roll]SearchVMware Pro[/url]|Blue Gears[/url]|Top Virtualization Security Links[/url]|
[url=http://www.astroarch.com/wiki/index.php/Virtualization_Security_Round_Table_Podcast]Virtualization Security Round Table Podcast[/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
Reply
0 Kudos
latepenguin
Contributor
Contributor

Funny, I just ran into this issue today. Found the soluton by piecing different information from several places (thx google). I'll be posting again when I'm done writing up the documentation. I'm currently using ESXi 3.5 but I'm sure it will work for 4.0.

Reply
0 Kudos
m0ps
Enthusiast
Enthusiast

waiting for your reply

best regards, m0ps

best regards, m0ps
Reply
0 Kudos
latepenguin
Contributor
Contributor

Reply
0 Kudos
latepenguin
Contributor
Contributor

Crud my solution didn't work. It installs correctly but when you issue a shutdown or restart it doesnt send the command to the VM. Sorry Smiley Sad

Reply
0 Kudos
m0ps
Enthusiast
Enthusiast

no comforting answer ...






best regards, m0ps

best regards, m0ps
Reply
0 Kudos
latepenguin
Contributor
Contributor

Hey, I managed to get the shutdown and restart working in the vm. :smileylaugh:

I was extracting the tgz in windows thus removing the permissions that were set before.

I'll post the updated article here for everyone. I would love to hear some feedback.

http://communities.vmware.com/docs/DOC-11573

-late

Reply
0 Kudos
m0ps
Enthusiast
Enthusiast

esx4 support freebsd and provide vmware-tools for 7.x and 6.x (precompiled modules). also vmware provide sources for kernel modules for freebsd, 2 of them compiled well, but compilation of thrid finished with errors Smiley Sad

i'm still searching for solution

best regards, m0ps

best regards, m0ps
Reply
0 Kudos
beerwatch
Contributor
Contributor

I also choosed BSD under ESXi and ran into the same trouble. Original installer didn't copy modules from FreeBSD-8.0 subdirectory and the vmblock didn't compile . I tried to add compat6x without success, I also tried to subvert the subdirectory . However, the problem is in kernel modules and no "compatibility layer" can help there - errors and kernel panics are unavoidable.

Looking into failed files I noticed that the interface changed to omit thread context parameter (variable "td") and also some structures are missing members. Unfortunately I had not time and knowledge enough to fix all the logic. Then I found out that contains open-vm-tools-167859_1.tbz and open-vm-tools-nox11-167859_1.tbz. Thanks that an alternative does exist!

WORKING - FreeBSD 8.0 without X11

I have not installed X11, so I issued following command:

pkg_add -r open-vm-tools-nox11

And added following lines to /etc/rc.conf

vmware_guest_vmblock_enable="YES"

#vmware_guest_vmhgfs_enable="YES"

vmware_guest_vmmemctl_enable="YES"

vmware_guest_vmxnet_enable="YES"

vmware_guestd_enable="YES"

After reboot, ESXi4.0U1 management console states "VMware Tools: Unmanaged" and shutdown/restart from the console work fine for me !http://communities.vmware.com/images/emoticons/cool.gif!. I assume that pkg_add -r open-vm-tools will install the right version with X11 support, but I didn't test it. As to me, the problem is solved and I hope anybody to look at the code and improve it to support newer interfaces in FreeBSD8.0 kernel and maybe NetBSD 5.0 (where the install script refused to do anything) also.

UPDATE: WORKING NetBSD 5.0 ALSO

Similar procedure also worked for NetBSD 5.0.2:

Run pkg_add open-vm-tools

Run cp /etc/pkg/share/examples/rc.d/vmtools /etc/rc.d

And add following lines to /etc/rc.conf

vmtools="YES"

vmware_guest_vmblock_enable="YES"

#vmware_guest_vmhgfs_enable="YES"

vmware_guest_vmmemctl_enable="YES"

vmware_guest_vmxnet_enable="YES"

vmware_guestd_enable="YES"

Save! Reboot! Enjoy!

Reply
0 Kudos
mosg
Contributor
Contributor

Hi!

Strange, but for me your solution did not work out. The main problem for us between FreeBSD8, ESXi4.0 and VMWare Tools is that in VMWare Infrastructure Client ESXi does not minimize memory for virtual machines. For example, I use BSD8 on ESXi4 + Open-VM-Tools (without X11), with 1024Mb RAM. Vmtools have to minimize unused RAM space on that virtual machine, but it doesn't! And even Windows + Tools doesn't working with memory correctly. That why we have to stay on 3.5 ESXi... Too bad...

I posted about a month age this issue, but support (and other community) just ignoring my posts. Here are the links:

- http://communities.vmware.com/message/1492610#1492610

- http://communities.vmware.com/message/1493947#1493947

Good luck.

Reply
0 Kudos
beerwatch
Contributor
Contributor

Hi mosg,

well, that could be called "unmanaged" state. Startup and clean shutdown was my goal.

But, OK, I decided to give two more hours to investigate the compilation issue of vmblock under FreeBSD8. Testing on FreeBSD amd64 architecture and free license of ESXi 4.0U1, I made the vmblock-only sources compilable. That's my only assurance. Check it, test it, try stressing the memory. I don't suggest using this in production!

  1. attach media (VM->Install tools) and and extract vmware tools as usual

  2. cd into vmware-tools-distrib/lib/modules/source/ and untar all archives here. three subdirectories vm*-only/ are created.

  3. overwrite files in vmware-tools-distrib/lib/modules/source/vmblock-only by files in attached archive (contains vmblock-altered directory - copy the three files /not patches/ into into vmblock-only, overwrite the official ones)

  4. cd into each *-only and run make. you may need kernel-headers or kernel-dev

  5. make directory vmware-tools-distrib/lib/modules/binary/FreeBSD8.0-amd64/

  6. copy all *.ko files from vmware-tools-distrib/lib/modules/source/ to vmware-tools-distrib/lib/modules/binary/FreeBSD8.0-amd64/

  7. run vmware-tools-install.pl, install compat6x if asked to

Enjoy.

Reply
0 Kudos
mosg
Contributor
Contributor

First of all, thank you beerwatch for your time!

Today I tried do this 7 steps, but no luck. After I run vmware-tools-install.pl script, everything works fine until the final state, when script start to execute vmware tools. The error was on section "Starting VMWare Tools services in the virtual machine":

- Switching to guest configuration: done

- Guest memory manager: failed

- Guest operating system daemon: done

Daemon started, and it`s work.

I think it`s a global ESXi4.0 bug, because and Windows systems also does not free unused memory!!! So if FreeBSD8 started working correctly with memory and others things (net, start/shutdown vm), we couldn't use it, because other OS has the same problems, as FreeBSD. Too bad. Smiley Sad That`s how working free stuff some times.

The only solution for us is to use ESXi version 3.5, which doesn't have such problems.

Good luck.

Reply
0 Kudos
blueit
Contributor
Contributor

HI,

Beerwatch's method is worked, thank you.

But, is it necessary?

If I don't care about that shutdown/restart button from the console works fine?

I just want my freebsd vm run stable...

If I do not install vmware tools under ESXi 4.0 update 1, is there any potential problem?

Reply
0 Kudos