VMware Cloud Community
mingma
Contributor
Contributor

how to get vmci socket work in vMA?

The vMA VM can start and listen on vmci socket after I enabled it in the VM setting. However, the other VMs can't connect to the vMA's vmci socket CID. The same program works when I tried to connect one regular VM to another regular VM.

Is it possible vMA doesn't have vmci driver installed properly? For some reason, the vmware-tool is installed, but it doesn't have vmci directory under /usr/lib/vmware-tools.

0 Kudos
9 Replies
lamw
Community Manager
Community Manager

The version of VMware Tools found on vMA most likely did not contain VMCI drivers.

If you take a look at the VMCI SDK docs - http://pubs.vmware.com/vmci-sdk/VMCI_intro.html

You'll see that it requires both the editing fo the .VMX entry and custom installation of VMware Tools to include VMCI driver. If you perform the latter step, it should work and you should be able to see the VMCI directory

mingma
Contributor
Contributor

Thanks!

The actual question is how I can install vmware-tools properly into vMA? It seems by default vmware-tools is installed, but it doesn't include vmci driver. When I tried to update vmware-tools in the vMA, it said there is no CD-ROM.

0 Kudos
lamw
Community Manager
Community Manager

If you look at the VMCI doc, it gives you the exact command to run:

Run the vmware-config-tools.pl script with the --experimental flag. That option turns on experimental features during installation, which enables VMCI.

What you'll need to do is get on your ESX(i) host and transfer the linux.iso and extract the tarball through a simple loop mount to your vMA host. Once you have it, you can perform the install with --experimental flag which will enable VMCI

mingma
Contributor
Contributor

Really appreciate it. I can make more progress by reinstalling the latest vmware-tools. Now, the vMA can connect to other vmci socket server. However, it seems vMA can't act as vmci socket server. Somehow the connection is blocked on the server side. Is there any port I should open on vMA?

0 Kudos
lamw
Community Manager
Community Manager

You might want to check if iptables (firewall) is running on vMA and/or selinux, I don't recall off hand if that is the case or not.

0 Kudos
mingma
Contributor
Contributor

Thanks. It still doesn't work even after I disable the firewall.

Has anyone been able to config vMA as vmci socket server successfully? I would image that is one of the common use cases for vMA.

0 Kudos
svaerke
VMware Employee
VMware Employee

If the vMA can connect to VMCI server sockets in other VMs, then it should be able to accept incoming connections as well. There is no filtering based on incoming connections. Do you see any error messages in the kernel log?

0 Kudos
mingma
Contributor
Contributor

Thanks. In the case of ubuntu VM tries to connect to vMA, I don't see any log in kern.log in ubuntu VM. The error message I got is

"Transport endpoint is not connected" in the socket connect call.

On the vMA side, the socket bind and listen both succeed.

One thing is the binary is compiled on ubuntu. vMA uses Fedora.

0 Kudos
svaerke
VMware Employee
VMware Employee

Hi,

I don't see that we return ENOTCONN from the connect call itself. This is not an error returned from a subsequent send or receive call? Are you using non-blocking sockets?

One thing that can help debugging this is to recompile the vsock kernel module with VMX86_DEVEL defined. That will make it possible to log all incoming and outgoing control messages used by the VMCI Stream Socket protocol. You should be able to find the source code for the VMCI and VMCI Socket drivers in /usr/lib/vmware-tools/modules/source/[vmci|vsock].tar

Unpack those two tar files, and you will get two directories, vmci-only/ will contain the vmci driver source and vsock-only/ will contain the VMCI Socket source. If your kernel uses module symbol versions, you need to compile the vmci driver first (do "make vmci" in vmci-only/) and copy the Module.symvers file to the vsock-only/ directory before compiling the vsock module. For vsock, you can do "make vsock VMX86_DEVEL=1" to compile that module with the additional logging. If you are not using symbol versions, you don't need to recompile the VMCI module - you can just compile the vsock module.

You can now enable VMCI Socket packet logging by setting  the module parameter LOGLEVEL_THRESHOLD to 10. This is done by:

insmod vsock.ko LOGLEVEL_THRESHOLD=10

After loading the vsock module, you will have to change the permissions on /dev/vsock to allow all users to read and write, unless your applications run as root.

Following that, you should be able to see what control messages were sent when you try to connect to the peer. It would be useful to know what messages are sent and received both on the client and on the server side.

Thanks.

0 Kudos