Questions tagged [virsh]

The virsh program is the main interface for managing virsh guest domains. Virtualization of the Linux Operating System means the ability to run multiple instances of Operating Systems concurrently on a single hardware system where the basic resources are driven by a Linux instance. The library aims at providing a long term stable C API .

The virsh program is the main interface for managing virsh guest domains. The program can be used to create, pause, and shutdown domains. It can also be used to list current domains. Libvirt is a C toolkit to interact with the virtualization capabilities of recent versions of Linux (and other OSes). It is free software available under the GNU Lesser General Public License. Virtualization of the Linux Operating System means the ability to run multiple instances of Operating Systems concurrently on a single hardware system where the basic resources are driven by a Linux instance. The library aims at providing a long term stable C API . It currently supports Xen, QEmu, KVM , LXC , OpenVZ, VirtualBox, OpenNebula, and VMware ESX .

You can find all info and options on virsh on this page.

155 questions
3
votes
1 answer

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

Is there a way of creating a domain with virsh from a base image? I have looked around and found that it is possible using virt-install, however I would prefer it if this was done purely through virsh, as I am using libvirt language bindings just to…
brti
  • 31
  • 1
  • 3
3
votes
2 answers

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

I am trying to increase vCPUs on a VM. I have done this in the past. Poweroff the VM Configure for maximum allowed vCPUs virsh setvcpus vm-1 10 --maximum --config Change for current settings virsh setvcpus vm-1 10 --current Power on the VM This…
Suresh Kota
  • 133
  • 3
3
votes
2 answers

CentOS7: KVM: error: Cannot create user runtime directory '/run/user/0/libvirt': Permission denied

Been trying to resolve an issue I found by having our Nagios installation use a plugin for KVM, check_kvm, I found. I think my problem boils down to a permissions issue with the nagios/nrpe user. After installing nrpe and plugins, I do not have any…
rwfitzy
  • 233
  • 5
  • 16
3
votes
2 answers

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

How to check the number of CPUs and cores available in the host machine using virsh?
Fábio Perez
  • 161
  • 1
  • 7
3
votes
1 answer

virsh vcpu_period and vcpu_quota

I have been looking into ways to divide my CPU amongst KVM guests other than by just setting vCPU access limits. I understand the concept of cpu_shares which can be set/displayed with virsh schedinfo, but I also found vcpu_period and vcpu_quota…
Programster
  • 495
  • 1
  • 13
  • 22
2
votes
0 answers

Configure netplan to use a different interface for bridge

I'm setting up a virtual machine host on Ubuntu 18.04.3. I installed KVM and have succesfully set up a qemu vm which connects through a bridged network. It shows up as a regular machine in my network. vm host: 192.168.178.14 vm guest:…
Forkbeard
  • 121
  • 4
2
votes
2 answers

How to specify a NIC number in virsh/kvm?

Hoping I can get some help here. I am using the virt-clone command to get an image of VyOS (open source linux router). The clone works fine but when I copy the image to another KVM host and install it the NIC card number changes. ports eth0 and…
2
votes
2 answers

Mount URL as cdrom/iso KVM/QEMU

I am looking for a way to mount an ISO as a cd rom, according to libvirt docs (referenced below) it should be possible, additionally in the question referenced below. I am aware of this question, however its 4 years+ old and never actually came to…
Backtogeek
  • 577
  • 2
  • 6
  • 14
2
votes
0 answers

KVM/QEMU: cannot attach-device (disk) to a live domain

I'm trying to add a new disk to a running guest/domain (Win10) I succeed in using virsh attach-disk... --live and also using virsh attach-device.. --config But using: virsh attach-device SRV13 /tmp/SRV13.xml --live Give me this error: Failed to…
MrCalvin
  • 354
  • 1
  • 6
  • 18
2
votes
1 answer

virt-install preseed not working

I have setup a pre-seed for the vm install but it still asks me for location first. My vm install is being trigger by a bash script create_vm.sh: virt-install --name test \ --boot uefi \ --machine q35 \ --ram 16384 \ --disk…
KillerSnail
  • 121
  • 2
2
votes
2 answers

Offline migrating KVM guests using virsh?

I want to offline migrate the KVM guest e-devel to another centos73 host using virsh. So I do # virsh -d 0 migrate --offline --persistent e-devel qemu+ssh://kvm2/system migrate: offline(bool): (none) migrate: persistent(bool): (none) migrate:…
Jasmine Lognnes
  • 2,520
  • 8
  • 33
  • 51
2
votes
1 answer

QEMU cannot find device nor node_name

When I do virsh list I get ubuntu14.10 and ubuntu15.10 running but when I run this command to take a snapshot. virsh qemu-monitor-command ubuntu15.10 '{ "execute": "transaction", "arguments":{"actions": [{ "type": "blockdev-snapshot-sync", "data"…
2
votes
1 answer

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

Is there a way to allow non sudo users access to KVM QEMU virtual machines in CentOS 7? I want to allow a non-root user to manage KVM guest virtual machines without having sudo access. Mainly, I'd like the user to be able to run virsh commands such…
OwN
  • 187
  • 3
  • 14
2
votes
1 answer

libvirt kvm qemu virtual machine - hard code domain-id?

Is there a way to hard code the domain-id of a virtual machine kvm guest? I tried adding an id attribute to the XML configuration via virsh edit name And I also tried to edit the XML directly stored in /etc/libvirt/qemu Basically, I'd like all of…
OwN
  • 187
  • 3
  • 14
2
votes
1 answer

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

I have run into situations where live migrations never seem to complete or error out. Here is how I have been able to reproduce the problem. Here is the instance I am migrating: [root@osc1-mgmt-001 tmp]# nova show…
Red Cricket
  • 470
  • 2
  • 8
  • 21
1
2
3
10 11