Try this command to allow port with tcp protocol: sudo ufw allow 7777/tcp
If above command not works, Try with disabling firewall for testing purpose
# sudo ufw disable
If it work's, When disabling firewall, Let me know ?
If incase, after disabling firewall also, If it not work's, Please try by checking network connectivity, Between to VM's by using ping and telnet command's
I hope this will solve your problem.