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.

148 questions
41
votes
3 answers

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

What I'd like to do is to set the guests' network configuration (IP address, subnet, gateway, broadcast address) from the host system. The used network setup is in bridge mode. How can I configure the network from the host rather than configuring…
beta
  • 645
  • 2
  • 6
  • 12
28
votes
5 answers

How to connect a cdrom device to a kvm/qemu domain (using command-line tools)?

I have set up a virtual machine running Windows XP on my Ubuntu laptop. Using the virt-manager GUI application, I can insert a CD in my drive and go to Details→IDE CDROM 1 and click on the Connect button. Then the CD becomes available in my virtual…
ΤΖΩΤΖΙΟΥ
  • 1,038
  • 1
  • 10
  • 18
27
votes
2 answers

How do I make a persistent domain with virsh?

virsh create somefile.xml creates my machine just fine but when I shut the machine down the whole thing disappears. Machines I made with the virt-manager GUI are persistent (stick around after shutdown) and the xml file is derived from those…
colechristensen
  • 602
  • 1
  • 5
  • 14
24
votes
4 answers

How do I list virsh networks without sudo?

I noticed a strange behavior on one machine using Debian that I can't reproduce on another machine running Ubuntu. When listing virsh networks as an ordinary user, it shows an empty list: ~$ virsh net-list --all Name State …
Arseni Mourzenko
  • 2,165
  • 5
  • 23
  • 41
22
votes
4 answers

How to change the default Storage Pool from libvirt?

I'm trying to use a different Storage Pool on KVM in order to store the virtual disks of my VMs and also the ISOs from the operating systems which I'm using. For example: I want to use the directory /media/work/kvm which is mounted over /dev/sda5,…
ivanleoncz
  • 1,433
  • 4
  • 18
  • 32
15
votes
1 answer

Delete "orphan" libvirt snapshot

I am trying to live-snapshot using KVM as per this procedure. I must have messed up at some point because I'm in a state I don't understand. My VM is called prod. It was created in file /srv/vm/prod.qcow2. Apparently, there is no running snapshot:…
Jérôme
  • 565
  • 1
  • 5
  • 18
7
votes
2 answers

virsh command that displays the cpu and memory consumption?

I want to know if there is a command virsh to display the cpu and memory consumption of each machine virtual. I created the virtual machine using KVM in ubuntu system.
5
votes
2 answers

State of VM after 'virsh save'

virsh save vm_name memdump and then virsh restore memdump restores a (running) VM all right. However, a VM is shut off after virsh save. I'm writing a "live" backup and restore script for KVM VMs, so in the backup part I obviously need a VM running…
LetMeSOThat4U
  • 1,159
  • 2
  • 14
  • 29
4
votes
2 answers

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

Have an Ubuntu server running KVM: Linux hyperv 4.4.0-109-generic #132-Ubuntu SMP Tue Jan 9 19:52:39 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux It is running a few VMs which are linux, and one windows vm. After installing a new VM of Windows 2016…
number9
  • 233
  • 2
  • 11
4
votes
1 answer

Remove libvirt's dhcp lease entry using virsh

Using: $ virsh version Compiled against library: libvirt 1.3.1 Using library: libvirt 1.3.1 Using API: QEMU 1.3.1 Running hypervisor: QEMU 2.5.0 $ $ $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: …
Amir Keibi
  • 141
  • 1
  • 4
3
votes
1 answer

virt-install hangs, no apparent error in logs and virsh list later shows its running after ctrl c exit, no domifaddr though

Got thrown into a situation managing boxes that the person before me used virt, so trying to come up to speed. As a test doing a virt-install of this: virt-install --virt-type=kvm --name kosmos-icc --ram 1000 --os-variant=centos7.0…
Codejoy
  • 67
  • 3
  • 13
3
votes
1 answer

Clone KVM virtual machine with snapshots

I've created a virtual machine using virt-manager and saved a snapshot of it's current state. Now I'd like to create an exact duplicate machine with all snapshots from the first machine. How could I accomplish that?
michaelr524
  • 139
  • 1
  • 4
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…
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
  • 485
  • 12
  • 22
1
2 3
9 10