Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

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 .

Filter by
Sorted by
Tagged with
0 votes
0 answers
7 views

Forbid LibVirt to pmsuspend

I've VMs on KVM/LibVirt. Some of them hangs after libvirt makes pmsuspend and then I pmwakeup them, and I need to force the reboot of the VM. Is there any way to make LibVirt never to pmsuspend domain?...
user avatar
0 votes
1 answer
33 views

reaching apache public reverse proxy virtualhost url from localhost behind a NAT using iptables

I have an issue with a guest using virsh behind a server running with iptables firewall. This guest hosts websites, one is mattermost with reverse proxy. Everything is working well. I then installed ...
user avatar
  • 109
0 votes
0 answers
82 views

Copy and paste from a QEMU VM with VNC graphics?

I run a headless server that uses qemu + kvm to run a few VMs, and I manage them with virsh + xml file definitions. Because this a remote / headless system, I set the graphics as VNC, and then with ...
user avatar
  • 1
0 votes
1 answer
16 views

vcpu counts aren't changing after config change and reboot

I recently downsized the number of vcpus virtual server Echobox1 uses from 4 to 1. before: # virsh vcpucount Echobox1 maximum config 4 maximum live 4 current config ...
user avatar
  • 709
0 votes
0 answers
11 views

Error in virsh dumpxl

I am trying to migrate a VM to a new host. One of the steps I need to do is virsh dumpxml. But I am getting this: sudo virsh dumpxml mycomputer error: failed to get domain 'mycomputer' Any idea how ...
user avatar
2 votes
3 answers
230 views

virsh autostart not working

root@virtual3:~# virsh autostart nstest Domain nstest marked as autostarted root@virtual3:~# virsh dominfo nstest Id: - Name: nstest UUID: 8cf691cd-7246-442b-a26b-...
user avatar
  • 41
0 votes
0 answers
215 views

Loading a KVM guest with static IP using XML file

I have an XML template for the image I am loading on KVM using ansible. For now, the image loads without IP. I would like to know if there is a way to add static IP on the XML template so that my VM ...
user avatar
  • 21
0 votes
0 answers
256 views

Why is net-dhcp-leases coming up empty in VIRSH?

From the following command virsh net-edit default, I see: <network> <name>default</name> <uuid>7a106327-942a-40e7-a977-018b5323832a</uuid> <forward mode='nat'/&...
user avatar
1 vote
1 answer
363 views

Where are RAM snapshots stored by libvirt?

My understanding is that when I run this command to create a snapshot of a running domain: virsh snapshot-create-as myvm snapshot1 that not only are internal snapshots created in each disk image file,...
user avatar
  • 13
0 votes
0 answers
74 views

Virsh console not responding after rebooting guest machine

I have a server running Ubuntu 20.04 with KVM. Whenever I install a guest VM (CentOS 7 or Fedora 34), virsh console works fine in the beginning. However, when I reboot this VM, virsh console stops ...
user avatar
0 votes
1 answer
304 views

Migrate a QEMU/KVM VM from qemu:///system to qemu:///session

I have a created a Windows 10 VM using virt-manager as user (not root). However, when try to list the VMs with virsh list --all, My VM is not listed? And, if I specify the system URI with by running ...
user avatar
0 votes
2 answers
115 views

Override virsh network from xml file to apply custom dnsmasq options outside

I want to automatically add a DNS CNAME entry using the dnsmasq namespace. Since this seems too complex to be handled by virsh net-edit, my idea is to use virsh net-dumpxml, apply the modifications ...
user avatar
  • 496
0 votes
1 answer
151 views

Unable to resize lvm to max of vda

I am trying to resize my lvm partition frm 29GB to ~60GB. Here is my current status: root@demo:~# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 7:0 ...
user avatar
0 votes
2 answers
544 views

Ubuntu 20.04 cloud image can't get IP address

When using virt-install to create a guest, CentOS 7.9 cloud image successfully gets an IP address, which can be checked with sudo virsh domifaddr <domain>. However, Ubuntu 20.04 LTS cloud image ...
user avatar
-1 votes
1 answer
273 views

Disable libvirt storage pools

It seems every time I create a VM with virt-install a new storage pool is created. But I don't use storage pools at all! I looked in the virt-install manual but could find a way to prevent this from ...
user avatar
  • 285
1 vote
1 answer
110 views

network interfaces are deleted after issuing a virsh shutdown on VM

I tried to instantiate a VM using virt-install command with few interfaces as needed. The exact command is as follows: virt-install \ --name VM \ --noautoconsole \ --input keyboard \ --...
user avatar
0 votes
0 answers
701 views

virsh attach-disk not working for iso file driver

Does anyone have any idea why I can't get this working. I have a windows7 guest vm installed with virt-install on a bridge. Windows 7 or 10 cannot get a drive for the network installed. Following ...
user avatar
  • 109
0 votes
2 answers
297 views

KVM trying to restore from backup and getting error unexpected data

Hello I made a backup of a VM guest with these steps: 1. virsh dumpxml --migratable test > /backup/test.xml 2. virsh snapshot-create-as --domain test \ --name backup....
user avatar
  • 103
1 vote
1 answer
165 views

Xen VM continuously restarts and kernel fails to start init

I am using a VM built using the Xen hypervisor and libvirt management layer. I couldn't connect to the VM after updating the Debian verison from 8 to 9 so I tried logging into the physical machine the ...
user avatar
  • 111
0 votes
1 answer
952 views

QEMU / KVM - Dedicated 802.1q VLAN for each VM - Communication only via router

I have a Linux firewall router (dedicated machine) with multiple ethN interfaces (my "big firewall"). All forwarded traffic is filtered by a set of iptables rules (default policy DROP). ...
user avatar
  • 153
0 votes
1 answer
621 views

Where is virsh save directory location defined

The default location of the virsh save myVm goes into /var/lib/something which makes my slash partition full on a Vm save, which is really anoying. I could not figure out where is the virsh save myVm ...
user avatar
2 votes
1 answer
87 views

Restoring terminal/TTY to normal after virt-install?

After having created a VM with virt-install then the terminal is only 24 lines, where the terminal have 70 lines. I recall seeing a similar issue with virsh console. Question Ideally would I like both ...
user avatar
  • 9,873
0 votes
1 answer
324 views

Can't start domain cloned with virt-clone

Final Update at bottom I have a working KVM domain which I've configured and want to use as a 'template' for other guests. So, my process is roughly this: Shut down the 'source' domain (07xQBuild) ...
user avatar
  • 433
0 votes
1 answer
2k views

KVM live migration for non shared lvm storage

I am trying to live migrate my KVM based VM from one host to another for non shared storage using virsh migrate. I have set both the hostnames at /etc/hosts on each of the host. Also I have set ...
user avatar
  • 31
1 vote
3 answers
848 views

How to reduce KVM qcow2 disk size?

When I boot in my guest Debian it says it size is 2.7G. df -h Filesystem Size Used Avail Use% Mounted on udev 718M 0 718M 0% /dev tmpfs 147M 6.2M 141M 5% /run /...
user avatar
1 vote
1 answer
1k views

Using virt-install to create a Ubuntu VM with iso / access to virsh console

I am trying to set up a Ubuntu server VM (CLI only) on a Debian host (CLI only) using virt-install (version 1.0.1). But following install: sudo virt-install --name=<name> --disk path=/home/...
user avatar
  • 131
0 votes
1 answer
323 views

Unable to access console or SSH on Amazon Linux 2 KVM image

I am trying to create a KVM guest instance running Amazon Linux 2 in an on-premises environment, on a CentOS 7 host. I am doing this over SSH (e.g. my local machine -> SSH to the CentOS host). I know ...
user avatar
1 vote
1 answer
1k views

Where are the OS specific properties located used by virt-install --os-variant

Using virt-install ... --os-variant win10 ... virt-install create a new VM optimized for Windows 10. But where are those OS specific properties located? E.g. machine-type and the <hyperv> ...
user avatar
  • 285
0 votes
1 answer
171 views

KVM VM lost its public IP and access to the internet after reboot?

I have shut-downed one of the VMs with "virsh shutdown VM" and when I started it, it lost its access to the internet. The VM had its own pupblic IP that had its own interface. I'm not sure how this ...
user avatar
  • 127
0 votes
1 answer
1k views

virt-install on Centos 8.1 doesn't complete when using --location http://localhost/inst

Should you reached this before, please let me know. ISSUE virt-install works well when passing arguments --cdrom /path/to/iso (and creates the guest) like [root@192-168-0-104 admin]# virt-install -...
user avatar
0 votes
1 answer
67 views

How to enable virsh console on Centos Atomic host?

I've Installed Centos AtomicHost Os on KVM , I just want to enable virsh console on it ! Tried below method but its is not working. 1. Added console=tty0 on /etc/grub/defailt GRUB_CMDLINE_LINUX="...
user avatar
0 votes
0 answers
60 views

why is kvm pool so small

I set up kvm on a fresh install ubuntu server 18.04 on a 1TB disk. There is nothing else on the disk. Whether I use virt-manager or virsh on cli to create a pool, I always get a pool of 3.75GB ...
user avatar
  • 1
0 votes
1 answer
2k views

Virsh command not working to install Centos 8 virtual-machine on Ubuntu 18.04 via qemu/kvm [closed]

I am trying to install centos 8 on ubuntu 18.04 as a virtual machine. I have a wireless connection. When I run the following command: chh2@chh2-cpu:~$ sudo virt-install --name=chris_centos --ram=...
user avatar
0 votes
1 answer
9k views

KVM-QEMU bridged network not working - guest can only access host

I am trying to configure VMs to act like devices on my LAN, instead of hiding behind the host. This is the tutorial I followed: RHEL8 Network Bridged Interface My router/DHCP is at 10.10.1.254 Host ...
user avatar
1 vote
1 answer
2k views

libvirt & openvswitch VLAN tagging on the fly

I'm working on a project using libvirt with qemu and openvswitch on Debian 10. I would like to be able to modify the configuration of a network card of a domain in bash with the update-device command ...
user avatar
  • 21
0 votes
0 answers
1k views

QEMU-KVM: VM will not start with virsh, only with qemu-system-x86_64

I have a vanilla Arch linux VM with disk in qcow2 format. I recently upgraded it and it stopped working. Every time I run $ virsh start Arch I get: Starting version 243.78-2-arch ERROR: device 'UUID=&...
user avatar
1 vote
1 answer
422 views

How to create internal snapshot with a virsh command

I want to create virsh snapshot that does not create any files, just keeps it in the same .qcow2 file. Basically the same thing that virt-manager does in the 'Manager VM Snapshots' page. How can I ...
user avatar
0 votes
1 answer
334 views

Get all virsh configs

I've several qemu vm's managed with virsh. I've already created a backup of the images. Now I want to create a backup of the config files. How can I do that? The only solution I've figured out so ...
user avatar
0 votes
1 answer
123 views

libvirt hot unplug cpu

I'm currently working with libvirt. after i reduce the number of vcpu cores with below command, the operation will be completed successfully. i should also mention that my current and max vcpus is 4, ...
user avatar
  • 3
0 votes
1 answer
552 views

Virsh can't detect my new vm

I have a *.qcow2 image from my old OS, it contains Windows 10. Then I copied it to the new OS and tried to install it. I followed the method written here "How to create a new domain from an existing ...
user avatar
2 votes
0 answers
2k views

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. ...
user avatar
  • 121
3 votes
1 answer
5k views

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 --...
user avatar
  • 67
0 votes
1 answer
600 views

How to achieve Host-and-Internet-Only networking within a Debian host and Windows Server guest using KVM/QEMU?

I have a physical/dedicated server which is running Debian 9 (Stretch). The server has enough resources to support its own load and the load of some virtual machines (in this question: Windows Server ...
user avatar
  • 1,946
1 vote
1 answer
1k views

What do the IDs of PCI devices refer to and which ones are relevent for setting up passthrough?

In setting up a domain with virsh, I had always assumed that the "slot" of a PCI card referred to which slot on the motherboard it was in. However, that seems not two be the case, cards in two ...
user avatar
0 votes
1 answer
780 views

Apply Network Filter to Ovirt Guest without Rebooting

I am trying to change the clean-traffic IP address for a oVirt Guest VM. It works as long as I reboot the VM. ( Changed from within the Guest Virtual Machine Network Settings ) But for a production ...
user avatar
2 votes
2 answers
812 views

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 ...
user avatar
0 votes
0 answers
853 views

Mount a disk image as mmc flash in libvirt

I'm trying to run the OS of my x64 NAS in a VM with kvm and libvirt. I made an image of the internal flash with dd. The image has a few partitions, starting with an EFI partition. virt-install -n ...
user avatar
0 votes
1 answer
904 views

Missing KVM snapshots in virt-manager

I need to resize an image and receive an error when using qemu-img the resize is not supported because snapshots exist. Sure enough, even though virt-manager does not show any snapshots, I see the ...
user avatar
  • 223
3 votes
2 answers
2k views

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 ...
user avatar
  • 213
2 votes
2 answers
3k views

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, ...
user avatar