VMware {code} Community
Andreas_Johanss
Contributor
Contributor

Typo in VMCI socket documentation and other issues

Hi,

I'm experimenting with the new VMCI-socket library at the moment and thought I should share some of the issues I have stumbled upon.

1. You can't use the new library with VMs that are created using VMware Workstation older than version 6.0.

  • Issue: VMCI is grayed out in the GUI. (The new pciBridge isn't available in earlier versions)

  • Solution: Upgrade the VM to at least version 6.0 (VM -> Upgrade or change version... - when the VM is powered off)

2. There is a typo in the documentation that results in that you can't call the getsockname() function on a VM (it works on the host though) if you are following the datagram instructions.

  • Issue: In the stream section of the documentation the "my_addr_size" variable is initialized with "sizeof my_addr", but in the datagram section this is left out.

  • Solution: Add the same assignment (but to the "svm_size" variable) in the datagram section before calling the getsockname() function.

Since VMware doesn't provide an example application for testing I coded a proof of concept implementation (Only datagram at the moment) that you can use as a base in your own tests.

Kind Regards

Andreas

Message was edited by: Andreas Johansson - updated the VmciSocketExample to v0.0.2 (It's now possible to provide servers listening port)

0 Kudos
4 Replies
tut
VMware Employee
VMware Employee

Andreas, thanks very much for correcting our documentation for the next release. Thanks also for your sample program, which will be useful to the community.

For use with VMCI Sockets, VMware recommends upgrading virtual machines to virtual hardware version 7, not 6. Experimental VMCI (without Sockets) was first supported in vHW version 6, but VMCI Sockets is not tested with version 6. Interesting that you imply version 6 works!

0 Kudos
Andreas_Johanss
Contributor
Contributor

Yes, it do work with 6.0 but I have stability issues at the moment. I have just upgraded the hardware version of the VM to 6.5 but it didn't resolve the issue.

Thanks for your reply.

Kind Regards

Andreas

0 Kudos
AnthonySowden
Contributor
Contributor

Andreas

Many thanks for uploading your vmciSocketExample program. I have used this to bootstrap my own development.

One small bug in your example: when you parse the CID value from the command args, you have to use an unsigned integer conversion, rather than the signed atoi. I guess you were lucky with your CIDs. I was initially too. I then had a CID with the top bit set, which was printed as a very large positive number, but parsed by atoi as a quite different value. Took me a while to work this one out.

Anthony

0 Kudos
Andreas_Johanss
Contributor
Contributor

Hi Anthony,

Thanks for your feedback and I see your point, but it doesn't seem to be an issue. If you look in your .vmx file where you have a very large CID (vmci0.id) you can see that VMware is storing the id in a signed integer (3166014164 -> -1128953132) and you can use either one in the VmciSocketExample program (Both represent the IP-address 188.181.138.212).

Kind Regards

Andreas

0 Kudos