How to connect to the libvirt/qemu/guests ? (with no ip address)

ip addresskvm-virtualizationlibvirtqemu

I have inherited the administration of a trusty ubuntu server with several virtual servers, also ubuntu using libvirt and qemu. I have the problem I cannot connect to these virtual servers/guests.

The root password was unknown of the physical box and so I had to recover this (which may have broken things) by using a Knoppix Live CD (as it handles both LVM2 and Raided disks/images) and did a chroot and changed password. Since then (coincidence?) the guests do not seem to have IP Addresses.

When I look at the 'ifconfig vnet0' output there is no IP Address assigned and the RX/TX count are 0. This seems in error (perhaps the virtual network bridge is bad or the guests are not running).

The virbr0 has an IP Address and the TX count increases when I try to ping an IP Address which should be assigned to vnet0. So the virtual network seems ok.

When I do 'virsh list –all' I see that the guests are running. I also see the processes with a 'ps -eaf | grep libvirt'. So the guests seem to exist. (But are they running?)

The 'shutdown' command does not shut down the guests. However, this may be valid (no apcid). The 'destroy' and 'start' work, but again not sure if the guests are running enough to get to the point of initialising network or not.

I tried to 'console GuestMachine' from within virsh, but this hung, I think I need to have getty running on guest machine.

The output of the ps also shows '-vnc 127.0.0.1:9'. However, all servers including the physical one do not have a GUI/X. I think VNC is only graphical and so that route is perhaps another dead end.

In '/var/log/libvirt/qemu/GuestMachine.log' there is nothing of note. I see the 'shutting down', 'starting up', command line options and 'char device redirected to /dev/pts/13 (label charserial0)'.

This is my first intro to libvirt and qemu, and after a bit of digging I am not sure if I have running guests or how to connect to them (without the IPAddress/ssh option).

Once I can connect to the guests, I am sure I can fix the IP Address issue, but without an IP Address I cannot connect to the guests.

In this situation is there a way to connect to guests?

Best Answer

vnc is not limited to presenting a GUI; it can also present a graphical view of a shell prompt, just as you'd expect to see on the text console of a standalone box (eg, ALT-F2).

For example, here's me pointing a vnc viewer at the VNC port of one of my locally-hosted QEMU images:

enter image description here

It is, as you see, a non-GUI console, but I could happily log in here nonetheless, even if it had no IP address (as in fact it doesn't). Point your VNC viewer at port 5909 (add 5900 to the argument of -vnc 127.0.0.1:) and you should be fine.

Related Topic