[libvirt-users] virsh list not working with xen 4
by Rogério Vinhal Nunes
Hi, I'm having some trouble to get libvirt to show the correct power state
of my virtual machines. I'm using Ubuntu 10.04 + Xen 4.1.1 + libvirt 0.8.8.
virsh list --all only shows turned off machines registered in xend. If I
turn them on, they just "disappear", and when I start machines directly from
xml, they just doesn't appear at all.
Libvirt is correctly connecting to xen as I can use the other commands fine,
just the list option doesn't seem to work at all. What can I do to change
that?
# virsh version
Compiled against library: libvir 0.8.8
Using library: libvir 0.8.8
Using API: Xen 3.0.1
Running hypervisor: Xen 4.1.0
12 years, 3 months
[libvirt-users] converting save/dump output into physical memory image
by Andrew Tappert
A lot of people in the security community, myself included, are
interested in memory forensics these days. Virtualization is a natural
fit with memory forensics because it allows one to get access to a
guest's memory without having to introduce any extra software into the
guest or otherwise interfere with it. Incident responders are
particularly interested in getting memory dumps from systems they're
investigating.
Virsh has "save" and "dump" commands for storing the state of a guest to
a file on disk, but memory of KVM guests doesn't get saved in the
"standard" input format for memory forensics tools, which is a raw
physical memory image. (This is what you'd get via the classical "dd
/dev/mem" approach or the contemporary equivalent using the crash
driver; and VMware Server and Workstation produce .vmem files, which are
such raw physical memory images, when a guest is paused or snapshotted.)
In order to analyze the memory of Libvirt/KVM guests with my Linux
memory forensics software, Second Look, I've created a tool for
converting Libvirt-QEMU-save files (output of virsh save command) or
QEMU-savevm files (output of virsh dump command) to raw physical memory
images.
I've got a basic working capability, though I'm still tracking down some
problems with a guest allocated 8GB RAM--not all the memory seems to be
present in the save or dump file. And I haven't tested very extensively
yet, version support is limited to what I myself am currently running, etc.
I'd like to know if this is a capability that others are interested in.
Is this something that would be of interest to the Libvirt project if I
were to contribute the code, or to the KVM project, or do you think it
best exists as a separate project?
I've also got a proof-of-concept tool for converting hibernate images to
raw physical memory images. Perhaps a collection of tools for
converting various memory dump formats would be a good project. Anyone
else interested in this kind of stuff? As an author of commercial
memory forensics software I've got a vested interest in availability of
good memory acquisition capabilities. But there are a number of people
working on FOSS Linux memory analysis tools, too...
Andrew
12 years, 6 months
[libvirt-users] Thread-safety issues with vbox driver ?
by Jean-Baptiste Rouault
Hi,
I'm experiencing weird things with the vbox driver when using multiple threads.
Following is the snippet of code I experience problems with
/*****************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <libvirt/libvirt.h>
void *create_and_destroy(void *arg)
{
virDomainPtr dom = (virDomainPtr)arg;
char buf[VIR_UUID_STRING_BUFLEN];
virDomainGetUUIDString(dom, buf);
if (virDomainCreate(dom) != 0) {
printf("failed to start %s\n", buf);
goto end;
}
printf("%s started\n", buf);
if (virDomainDestroy(dom) != 0) {
printf("failed to destroy %s\n", buf);
}
printf("%s destroyed\n", buf);
end:
virDomainFree(dom);
pthread_exit(NULL);
}
int main(int argc, char **argv)
{
virConnectPtr conn = virConnectOpen("vbox:///session");
int i;
int count = virConnectNumOfDefinedDomains(conn);
char **names = malloc(count * sizeof(char *));
virConnectListDefinedDomains(conn, names, count);
virDomainPtr *doms = malloc(count * sizeof(virDomainPtr));
for (i = 0 ; i < count ; ++i) {
doms[i] = virDomainLookupByName(conn, names[i]);
}
pthread_t *threads = malloc(count * sizeof(pthread_t));
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
for (i = 0 ; i < count ; ++i) {
pthread_create(&threads[i], &attr, create_and_destroy, (void *)doms[i]);
}
pthread_attr_destroy(&attr);
for (i = 0 ; i < count ; ++i) {
pthread_join(threads[i], NULL);
}
virConnectClose(conn);
pthread_exit(NULL);
}
/************************************************/
Here is the output of the program with 2 defined domains:
> libvir: VBOX error : operation failed: OpenRemoteSession/LaunchVMProcess failed, domain can't be started
> failed to start c538c89a-70da-42ab-a88a-5aeb15698c12
> 034cf837-abe7-4c48-8373-0ddcf480d416 started
> 034cf837-abe7-4c48-8373-0ddcf480d416 destroyed
Sometimes the first domain really fails to start, but sometimes it starts correctly but libvirt reports
an error. Sometimes domains aren't destroyed but libvirt reports no error at all.
If there is only one domain, no problem occurs at all. I also tried the same code (ie with multiple domains)
but with only one thread and it works well.
I managed to reproduce these issues with libvirt 0.9.4, 0.9.7, using VirtualBox 4.0 and 4.1.
--
Jean-Baptiste ROUAULT
Ingénieur R&D - diateam : Architectes de l'information
Phone : +33 (0)9 53 16 02 70 Fax : +33 (0)2 98 050 051
12 years, 8 months
[libvirt-users] qemu - could not load kernel and dynamic ownership setting
by Shantanu Pavgi
Hi,
I am getting following 'qemu: could not load kernel' error while trying to create a new VM using virt-install or virt-manager. The software versions are as follows: CentOS 6.2, Libvirt 0.9.4, qemu-kvm 2:0.12.1.2-2.209.el6_2.1.
The qemu.conf has disabled dynamic_ownership setting. The VM instantiation has worked fine before when dynamic_ownership was enabled (default). So is this error related to dynamic ownership being disabled? I appreciate any help on how to debug this error further.
Also, is there any documentation on why/when dynamic_ownership setting should be used? We have enabled it to figure this out through some test installs but right now unable to move further with the install step itself.
{{{
virt-install --connect qemu:///system \
-n $guestname \
-r 512 \
--vcpus=1 \
--os-type=linux \
--os-variant=rhel6 \
--accelerate \
--graphics vnc,keymap=en-us \
-v \
-w bridge:br1 \
--disk path=$datastore/$guestname.img,size=40 \
-l $repo \
-x "ks=$ksurl/$ksfile ksdevice=eth0 ip=$guestip netmask=$netmask nameserver=$nameserver gateway=$gw"
}}}
{{{
Starting install...
Retrieving file .treeinfo... | 798 B 00:00 ...
Retrieving file vmlinuz... | 7.5 MB 00:00 ...
Retrieving file initrd.img... | 59 MB 00:01 ...
Allocating 'virtinst-vmlinuz.l4mEAd' | 3.8 MB 00:00
Transferring virtinst-vmlinuz.l4mEAd | 3.8 MB 00:00
Allocating 'virtinst-initrd.img.IvGhFr' | 29 MB 00:00
Transferring virtinst-initrd.img.IvGhFr | 29 MB 00:05
Creating storage file generic-server.img | 40 GB 00:00
ERROR internal error process exited while connecting to monitor: char device redirected to /dev/pts/1
qemu: could not load kernel '/var/lib/libvirt/boot/virtinst-vmlinuz.l4mEAd': Permission denied
Domain installation does not appear to have been successful.
}}}
--
Thanks,
Shantanu
12 years, 9 months
[libvirt-users] libvirt-manager , details / console ...
by Marko Weber
Hi all,
we have an easy question for you maybe.
when we start the virt-manager, and doubleclick an listed virtual
machine,
we always bei transported to CONSOLE page.
Thats very annoying for us.
Is there a possibility to set an option, that on doubleclick you are
getting the CONSOLE TAB.
in 95% we need Console and not Details.
thanks for any costructive hints.
marko , from cloudy rainy germany
12 years, 9 months
[libvirt-users] Problems running virtual machines after an upgrade
by Bhasker C V
Hi all,
I upgraded qemu-kvm and libvirt to the new versions
qemu-kvm at : 1.0
libvirt at : git version 0.9.10
I lost the original machines but the xml files were are all present (it
is not showing up in virsh list --all)
But when I import an xml I get an error: Attached is some information
which might be helpful
Can someone help please ?
If this is a compatibility issue please can someone tell me which is the
latest version of qemu-kvm and libvirt combination which will work ?
I cannot use qemu plain since it does not yet support boot from scsi
thanks
-----------------------------------------------
$ sudo virsh list --all
Id Name State
----------------------------------------------------
$ lsmod | grep kvm
kvm_intel 112920 0
kvm 280656 1 kvm_intel
$ /usr/local/sbin/libvirtd --version
/usr/local/sbin/libvirtd (libvirt) 0.9.10
$ ./qemu-system-x86_64 --version
QEMU emulator version 1.0-bcv (qemu-kvm-1.0), Copyright (c) 2003-2008
Fabrice Bellard
$ sudo virsh define ./debian.xml
error: Failed to define domain from ./debian.xml
error: unknown OS type hvm
$ cat debian.xml
<domain type='kvm'>
<name>debian</name>
<uuid>0aab8869-ff87-14ce-a00b-944cdca7acf7</uuid>
<memory>524288</memory>
<currentMemory>524288</currentMemory>
<vcpu cpuset='6-7'>2</vcpu>
<cputune>
<vcpupin vcpu='0' cpuset='6'/>
<vcpupin vcpu='1' cpuset='7'/>
</cputune>
<os>
<type arch='x86_64' machine='pc-0.14'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<cpu match='exact'>
<model>core2duo</model>
<vendor>Intel</vendor>
<topology sockets='1' cores='2' threads='1'/>
<feature policy='disable' name='lahf_lm'/>
</cpu>
<clock offset='localtime'>
<timer name='hpet' tickpolicy='catchup'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/local/bin/kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/VIRT/disks/DEBIAN'/>
<target dev='sda' bus='scsi'/>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' unit='0'/>
</disk>
<controller type='scsi' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04'
function='0x0'/>
</controller>
<controller type='ide' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01'
function='0x1'/>
</controller>
<interface type='bridge'>
<mac address='52:54:00:71:62:f3'/>
<source bridge='virt'/>
<model type='e1000'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' keymap='en-gb'/>
<sound model='ich6'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06'
function='0x0'/>
</sound>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02'
function='0x0'/>
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05'
function='0x0'/>
</memballoon>
</devices>
</domain>
--
Bhasker C V
12 years, 10 months
[libvirt-users] Virtualizing a an old SuSE system
by Dale Amon
I'm in the midst of an attempt to convert an
old and rather large SuSE server (5 disks) into
a virsh loadable VM. Has anyone else dealt with
the issues of systems of this sort? I'm at the
moment trying to hand construct a machine xml
file for it. I managed to create one which would
load but not start.
I'd appreciate some pointers and can supply
whatever info you'd like about what I am
trying to do and what the dd'd image of the
system disk and other disks are like.
Not that they do have LVM's, although the boot
should be off a base partition that is not
in the LVM.
12 years, 10 months
[libvirt-users] Fwd: Unable to connect qemu:///system on Fedora16 X86_64
by suyi wang
---------- 已转发邮件 ----------
发件人: suyi wang <wangsuyi640(a)gmail.com>
日期: 2012年2月29日 上午10:57
主题: Re: [libvirt-users] Unable to connect qemu:///system on Fedora16 X86_64
收件人: Eric Blake <eblake(a)redhat.com>
So, thanks a lot . Eric.
I attached the figure,which showed when I ran the command "virt-manager".
I also tested the commad as follows, sa you can see my output.
[root@localhost ~]# virt-manager --debug
2012-02-29 10:56:13,555 (cli:71): virt-manager startup
2012-02-29 10:56:13,555 (virt-manager:292): Launched as:
/usr/share/virt-manager/virt-manager.py --debug
2012-02-29 10:56:13,555 (virt-manager:293): GTK version: (2, 24, 7)
2012-02-29 10:56:13,555 (virt-manager:294): virtManager import: <module
'virtManager' from '/usr/share/virt-manager/virtManager/__init__.pyc'>
2012-02-29 10:56:13,671 (engine:555): No inspection thread because
libguestfs is too old, not available, or libvirt is not thread safe.
2012-02-29 10:56:13,674 (engine:346): About to connect to uris
['qemu:///system']
2012-02-29 10:56:13,720 (engine:471): window counter incremented to 1
2012-02-29 10:56:13,726 (connection:954): Scheduling background open thread
for qemu:///system
2012-02-29 10:56:13,727 (connection:1140): Background 'open connection'
thread is running
Thanks!
Suyi Wang
2012/2/29 Eric Blake <eblake(a)redhat.com>
> On 02/28/2012 10:23 AM, suyi wang wrote:
> > Dear all:
> > I ust installed Fedora16Fedora16 X86_64 on my new machine, and then I
> > ran the commands as follows(ran as root):
> >
> > yum install qemu-kvm
> > yum install qemu
> > yum install libvirt
> > yum install virt-manager
> >
> > then I started the libvirtd as follow:
> > /etc/init.d/lbvirtd start
> >
> > So , it ran well.
> >
> >
> > However, after a few days , when I ran the command "virt-manager" , it
> > showed as bellow:
> >
> >
> >
> > it seemed that ti cannot connect the hipervisor.
>
> This list is plain-text only. Your embedded graphic (at least, I'm
> assuming you attempted to embed a graphic) got eaten by the list server,
> so we don't know what message you got. Can you paste the actual error
> message you got?
>
> Meanwhile, we have a wiki page for diagnosing common problems. Perhaps
> your issue is covered by one of the items there; and if not, it would
> help if you could add a new page with the steps you take in resolving
> the issue. http://wiki.libvirt.org/page/Troubleshooting
>
> >
> >
> > Then I did a little test:
> > I ran the conmand "virsh list" , but it didnot work,either.
>
> Again, knowing the exact output of 'virsh -c qemu:///system list',
> rather than just saying it didn't work, will help others in diagnosing
> your issue.
>
> --
> Eric Blake eblake(a)redhat.com +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>
>
12 years, 10 months
[libvirt-users] Unable to connect qemu:///system on Fedora16 X86_64
by suyi wang
Dear all:
I ust installed Fedora16Fedora16 X86_64 on my new machine, and then I
ran the commands as follows(ran as root):
yum install qemu-kvm
yum install qemu
yum install libvirt
yum install virt-manager
then I started the libvirtd as follow:
/etc/init.d/lbvirtd start
So , it ran well.
However, after a few days , when I ran the command "virt-manager" , it
showed as bellow:
it seemed that ti cannot connect the hipervisor.
Then I did a little test:
I ran the conmand "virsh list" , but it didnot work,either.
Then I used Python as follows:
import libvirt
cc = libvirt.open(r'qemu:///system')
but it didnot work,either.
All the test above are under root . I hope that someone can give me some
suggestiion. Thanks to all!
Suyi Wang
12 years, 10 months
[libvirt-users] Bug? virGetLastError() returns NULL after virDomainCreate() if Domain running already
by Guido Winkelmann
Hi,
As the subject line indicates, when I'm calling virDomainCreate() to start a
defined domain, and that command fails because the domain is already running at
that point, virGetLastError() will return NULL, instead of a proper pointer to
an error code.
Libvirt will, however, print an error to the console:
libvir: QEMU error : Requested operation is not valid: domain is already
running
This looks like a bug to me, and I'm fairly certain that earlier version would
return an error code of VIR_ERR_OPERATION_INVALID at that point. Or maybe that
was just virDomainDestroy(), and I'm just blindly assuming that
virDomainCreate() will work analogously...
Anyway, no error code is bad, because I can't tell what happened.
This is version 0.9.8. I couldn't find anything about this issue in the
changelogs for 0.9.9 and 0.9.10, so I'm assuming the issue has not been
addressed since.
Guido
12 years, 10 months