I have a virtual machine (Ubuntu) and I need to send data through socket communication to my host PC (Ubuntu as well).

Is there a way to do it? I found out that the localhost of the PC and VM are the same ( but if I try to simply create a server on the VM and a receiving client on the PC, it does not receive anything...

Thanks in advance, Luigi

1 Answer 1


You can see the ip address of your VM/guest running this from your host (example for a VM called ubuntu16.04)

$ virsh  domifaddr ubuntu16.04
 Name       MAC address          Protocol     Address
-----------------------------------------------------------------------    --------
 vnet0      52:54:00:d6:f2:bc    ipv4

then use that ip address to send/receive data between host and VM.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .