[fedora-virt] Need to read guests logs.

Richard W.M. Jones rjones at redhat.com
Thu Nov 4 19:01:21 UTC 2010


On Thu, Nov 04, 2010 at 06:51:44PM +0000, Frank Murphy wrote:
> I have a guest that will not boot properly.
> While I have it like that,
> how can I get access to the logs. (boot,dmesg)
> 
> I am looking at install libguestfs,
> before I do, is there an easy example included?
> 
> Refer to this why I need them:
> https://bugzilla.redhat.com/show_bug.cgi?id=649823

You have several choices.  To read the log files:

 virt-cat Guest /var/log/messages     # or /var/log/dmesg etc

or:

 guestfish --ro -i -d Guest
 ><fs> less /var/log/messages

For recovering the guest:

 virt-edit Guest /boot/grub/grub.conf

or:

 guestfish -i -d Guest
 ><fs> emacs /boot/grub/grub.conf

or:

 virt-rescue Guest
 ><rescue> mount /dev/vg_foo/lv_root /sysroot
 ><rescue> mount /dev/vda1 /sysroot/boot
 ><rescue> vi /sysroot/boot/grub/grub.conf

We don't have a way that you can read 'dmesg' if it just exists in
memory (hasn't been written to disk).  We _used_ to have this
capability, and will do so in future, but not right now.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/


More information about the virt mailing list