Tracking in VMs to Host

What is the best way to configure ActivityWatch in VMs (VMware Workstation) and host to monitor both on the host?

I configured a setup that works, altering aw_client.ini to point to host’s real IP address. The problem is it seems to only work when the host is assigned an IP.

A wrinkle to this is the host machine is a notebook which may be switching networks. So the real IP will change. It would be nice to have a setup where the INI’s do not need reconfiguring every time the network changes or a new IP issued.

I thought setting up the host as 127.0.1.1 in aw_server.ini and the same in aw_client.ini in the VM would do it, but it doesn’t seem to be working. 127.0.1.1 is known to both when VM network card set up as NAT.

I believe I found a solution. Create a host-only network adapter for the VM and host to use. It’s a private host to VM connection.

Initial results look good for anyone in this situation. I’ll be moving networks soon and will see if connections remain.

1 Like

Exposing the server to the internet by setting a non-local port to bind on in aw_server.ini is a terrible idea security-wise.

The host-only network adapter sounds like the best solution. Let us know if you get that working :slight_smile:

Do you have any more details about how you solved this?
I have a similar issue.
I have a Windows 10 VMware host and a linux VM client.
I setup a host only network no problem, but the Activity Watch server on the host will only respond to connections from localhost. The VM sees the private network IP of the host (which is obviously not localhost), so Activity Watch does not respond.

Any ideas?

------------ Edit ---------------------------
Got it to work. I had to use the windows netsh utility to port forward the private network ip to localhost on the Windows side:
netsh interface portproxy add v4tov4 listenaddress=<vmware-ip-address> listenport=5600 connectaddress=localhost connectport=5600

1 Like

Rayman, I was on vaca when your post came in and forgot to circle back.

Glad you got it working. I am surprised you have to port forward. With a private network, the host and client talk to each other on private IP range. The host is x.x.x.1 and the guest gets something else.

I configured ActivityWatch, aw-client.ini, in the guest OS to find the server at x.x.x.1. ActivityWatch configs, the 2 INIs, on the host were configured to use the private IP, x.x.x.1. So host and client are using the same VMware issued IP. No reference to 127.0.0.1 or other localhost address. No port forwarding.

It could be different for you as my host is Linux and guest is Windows.