How do I change the IP of a guest VM with only CLI access to the HOST?

Working on decommissioning/moving/updating old servers. I have an old host machine running CentOS 6.2. It has several KVM based virtual machines I need to access. I can’t use SSH or any network tools to reach the guests, because the guests have static IPs set to the wrong subnet. (They were moved from another office location).

The host machine has no GUI.

The host machine cannot use yum, because it’s too old to connect to the repos.

I cannot connect with virt-manager from my desktop to the host because libvirt on the old machine is too old.

I tried mounting the VM’s LVM partition on the host (so I could edit the config files manually), but you must specify the filesystem type.

It will not accept ext3 or ext4 as the type (mount: wrong fs type, bad option, bad superblock...).

The file command does not exist on the host.

The server and guests all run fine, no hardware issues. Just old software, and can’t access guests on the network due to wrong subnet.



  1. Physical removal of hard drives to another machine, rebuild RAID, mount LV, change IP in text file, move drives back, etc
  2. Change the subnet of this office’s router and my desktop computer.

There has to be a less stupid option, right?


virsh --change-ip my_guest_vm

from the host?

(Apparently, you can connect to a guest from the host… if you have ALREADY INSTALLED a package on the guest to do so… which isn’t useful at this point.)

So the VMs don’t have an image like qcow or raw ? Is it directly installed on LVM?

If it’s a LVM did you activate the vgs etc ?

Read from the point 13.6.4 down.

Besides … If those are bootable then just boot some random Ubuntu livecd in it and make change to the disks filesystem, if partitions are healthy and not encrypted they should even appear in nautilus. If not check the disks utility

Are the serial consoles of the guests accessible via “virsh console”?

Didn’t work. I think that requires a package already installed on the guest to work.

I ended up just removing the drives and putting them in another machine. :confused:

Thanks for the suggestions!

1 Like