Hot answers tagged

73 votes
Accepted

KVM/libvirt: How to configure static guest IP addresses on the virtualisation host

If you don't want to do any configuration inside the guest, then the only option is a DHCP server that hands out static IP addresses. If you use bridge mode, that will probably be some external DHCP ...
user avatar
39 votes
Accepted

How to change the default Storage Pool from libvirt?

Before following the steps, be sure that you are running these commands as normal user and that your user belongs to the group libvirtd (on some systems libvirt). Here are the following commands which ...
user avatar
  • 1,403
24 votes
Accepted

Delete "orphan" libvirt snapshot

The proper method was virsh snapshot-delete prod --metadata snap (This command can be found on the wiki. I tried it before asking here but it failed due to a typo that has been corrected since.) I ...
user avatar
  • 565
22 votes
Accepted

How do I list virsh networks without sudo?

It appears that: If not explicitly stated, the virsh binary uses the 'qemu:///session' URI (at least under debian). Therefore, not only virsh net-list, but practically any command, including ...
user avatar
15 votes

KVM/libvirt: How to configure static guest IP addresses on the virtualisation host

virsh net-update is a good command for you (you don't need to restart/destroy your network etc) see: https://www.redhat.com/archives/libvir-list/2012-September/msg01380.html
user avatar
  • 151
14 votes

How do I list virsh networks without sudo?

uncomment this line in file /etc/libvirt/libvirt.conf uri_default = "qemu:///system" was enough for me in fedora 29 . Edit: as it says here https://libvirt.org/uri.html for non root users that file ...
user avatar
11 votes

How do I make a persistent domain with virsh?

If you don't have the xml for the running vm (eg. after transient migration), you can do virsh dumpxml vm_name > vm_name.xml virsh define vm_name.xml To check: virsh list --all --persistent The ...
user avatar
  • 111
10 votes
Accepted

virsh command that displays the cpu and memory consumption?

The command dommemstat can give you memory stats for a specific domain and with domstats you can get plenty of stats for all domains or just the specified. You can pass the parameter --cpu-total to ...
user avatar
9 votes
Accepted

Virsh domain has space in it, can not remove

Kids, don't try this at home: Libvirt should have rejected the creation of a domain with a space in its name, so someone did something strange to create the domain to begin with. To recover from this ...
user avatar
7 votes

How to change the default Storage Pool from libvirt?

If you just want to change the image path, you can also edit the storage path in the default pool by running: $ virsh pool-edit default The above command will open the default pool xml in an editor (...
user avatar
  • 201
6 votes

virt-manager doesn't show list of local KVMs but virsh does

Check the output of virsh uri. If it returns qemu:///session, but you're using a qemu:///system connection in Virt-Manager, you found the cause. In order to fix it, you should either create a "...
user avatar
  • 207
6 votes
Accepted

CentOS 7 Virsh - Allow Non Sudo Users to Interface with QEMU / KVM / Virtual Machines

Hidden in the comments at https://major.io/2015/04/11/run-virsh-a is export LIBVIRT_DEFAULT_URI=qemu:///system This works for me but may give more access than you want.
user avatar
  • 114k
6 votes

Linux KVM if guest is rebooted it will not start, must be manually started

As per Michael Hampton comments above, the xml had "destroy" for the <on_reboot> node instead of "restart".
user avatar
  • 233
5 votes
Accepted

virsh vcpu_period and vcpu_quota

quota The optional quota element specifies the maximum allowed bandwidth(unit: microseconds). A domain with quota as any negative value indicates that the domain has infinite bandwidth, which means ...
user avatar
5 votes

Activate Intel VT-d in the kernel on CentOS7

In CentOS 7, append the kernel command line parameters to the GRUB_CMDLINE_LINUX entry in /etc/sysconfig/grub. For example, change: GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap rd.lvm.lv=centos/root ...
user avatar
5 votes
Accepted

Offline migrating KVM guests using virsh?

The message <domain> trying as domain NAME just means that the code is trying to lookup the guest based on its name (as opposed to UUID or ID). IOW, it is normal to see that here, no sign of ...
user avatar
  • 1,465
4 votes

Modifying xml definition of a running KVM domain via script

Use virsh dumpxml to get the XML, and then virsh define to replace the domain definition with your modifications.
user avatar
4 votes
Accepted

how to enable L3 cache on kvm guest?

FWIW, you're misunderstanding the scope of the host-passthrough CPU model. It only controls identification of the CPU and its feature flags - some aspects of the CPU are still not exposed to the guest....
user avatar
  • 1,465
4 votes

Clone KVM virtual machine with snapshots

There are two parts to a VM - the disk image (or set of images in a snapshot chain) and the VM definitions. Cloning VM definitions can be both simple and complex. For the clone to run on another host,...
user avatar
  • 18.4k
4 votes

virsh command that displays the cpu and memory consumption?

Nadya Nux: The command 'domstat --cpu-total' is executed within 'virsh' console, not from bash. So you have basicly two ways to do it. First: user@yourserver:~# virsh domstats --cpu-total Second: ...
user avatar
3 votes
Accepted

How can I increase vCPUs on VM without powering off in RHEL 7

Not at present. It looks like CPU hotplug used to be possible in QEMU, but the patch is old and crusty, never worked with windows guests, and not shipped natively anymore. http://www.linux-kvm.org/...
user avatar
3 votes
Accepted

How to check the number of CPUs and cores from host with virsh?

Use virsh nodeinfo. The output will be something like: CPU model x86_64 CPU (s) 8 CPU frequency 2895 Mhz CPU socket(s) 2 ...
user avatar
3 votes
Accepted

Installing VM on CentOS 6.6 with virt-install hangs

You appear to be attempting to install using a serial console, rather than a normal console. Not sure why you're doing that, but... By default the installer tries to display either text or graphics ...
user avatar
3 votes

State of VM after 'virsh save'

First, I totally agree with @dyasny, it is hard to find a reasonable use case for 'full VM state (aka. with memory)'. But, if you really want 'virsh save vm_name memdump' without destroy the vm, you ...
user avatar
3 votes

libvirt - Restart VMs after return from power failure?

On my RHEL6 and CentOS6 that is established by creating a symbolic link to VM XML description in /etc/libvirt/qemu/autostart/ : ls -la /etc/libvirt/qemu/autostart/ total 4 drwxr-xr-x. 2 root root ...
user avatar
  • 70.8k
3 votes

KVM/libvirt: How to configure static guest IP addresses on the virtualisation host

I have been able to make dnsmasq 'see' the newly added IP-MAC mapping by simply sending a -HUP signal to the dnsmasq process. After that, rebooting the new guest was enough to have the correct IP ...
user avatar
3 votes

How to create a new domain from an existing base image in virsh

You can copy the image file for any VM and clear the VM specific data (IP,...etc) using the command: virt-sysprep -a <image_file> Then use virt-install (in an example): virt-install \ -n ...
user avatar
  • 411
3 votes
Accepted

virsh auto restart after vm died

Check your domain XML for the value of <on_crash>. This should be set to: <on_crash>restart</on_crash>
user avatar
3 votes

OpenStack Juno Live-Migration never completes for instances with high load and size >64GB

Failing migration due to too-busy VMs has been recognized as a problem. Unfortunately, while qemu provides a solution, it is not exposed via the libvirt API, and is thus unavailable to OpenStack. ...
user avatar
3 votes

How to change the default Storage Pool from libvirt?

Aside from the reply above showing how todo it from the command line, you can also change this from virt-manager directly. In the main virt-manager window, go to the menu 'Edit -> Host Details'. In ...
user avatar
  • 1,465

Only top scored, non community-wiki answers of a minimum length are eligible