I have a CentOS Linux virtual machine. When I run ifconfig -a on it to get the IP, it reports back with what appear to be two different IP addresses:
ens192: 192.168.20.130
virbr0: 192.168.122.1
What are the differences between these, and which one should I use if I want to connect to my virtual machine?
(side note: I cannot connect to either of the IP addresses from an external machine right now)
ens192 is your VM's primary network address. Given that the ens192 IP address is on a 192.168 network address, it's likely that you have NAT networking configured for the VM. You can not access that IP address from an external machine. as the NAT gateway provided by Workstation does not expose that IP address to the outside world. To connect to a service in the virtual machine that's running with NAT networking, you'll need to configure port forwarding to map an unused port on the PC to the IP address and port of the service you're looking to connect to. Or switch the VM to bridged networking - in which case the VM will get an IP address on the same network as the PC you're running on and it will be accessible by external machines.
virbr0 is an interface automatically created when the libvirtd packages are installed in the VM that supports native Linux virtualization. It is part of Linux virtual networking should you want to run a viirtual machine using Linux's "native" hypervisor. It has nothing to do with VMware and you can't connect to it from the outside world.
Thank you very much - this helps me understand and makes sense.
I have tried to change the VM from NAT to bridged and think I have followed the instructions correctly but I am unable to get an IP address on the same network and I still cannot reach the VM.
I haven't tried yet, but wonder if I have to set up a new VM and set it to bridged from the beginning??
Thoughts?
Thank you.
