Quick tip: Find the IP address of a virtual machine

virt-ifconfig will eventually fix this “properly”, although it’s yet again back on the drawing board while people upstream talk about heavyweight “guest agents”.

But while we’re waiting for that to happen, here’s a very quick and easy way to find out what IP address your virtual machine just acquired:

$ /sbin/arp -an
? (192.168.0.130) at 00:17:f2:d8:db:3f [ether] on eth0
? (192.168.122.187) at 52:54:00:37:a8:f8 [ether] on virbr0

That’s right — just run /sbin/arp -an and look for the new IP address that’s appeared. If you want to be clever you can look up the MAC address from the output of “virsh dumpxml” and match it to the MAC addresses from ARP, but usually that’s overkill.

2 Comments

Filed under Uncategorized

2 responses to “Quick tip: Find the IP address of a virtual machine

  1. Matěj Cepl

    … and also fortunately, finally, virtual guests work correctly with avahi, so for virtual guest named foo, you get ssh foo.local working.

  2. Pingback: Tip: Find the IP address of a virtual machine « Richard WM Jones

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s