Skip to main content
Share Your Experience: Take the 2024 Developer 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
48 views

Error migrating server Openstack host different than nova server

A migration of an instance failed. Now in nova, the host is in host A while in virsh the running instance is in host B. How can I set in nova, because openstack is showing in error state.
Roberto Matamoro's user avatar
0 votes
0 answers
202 views

Libvirt shared storage pool

I have what I hope is a quick question. I'm running: CENTOS 9 KVM/QEMU Pacemaker, DLM, lvmlockd, fence_scsi I have a simple two node KVM cluster where I've set up a LVM logical volume on a attached ...
JDW52's user avatar
  • 1
0 votes
1 answer
734 views

How to use specific host ip address on kvm?

Have a dedicated Ubuntu Server host with a single network interface but with two ip address: root@server:~# cat /etc/netplan/50-cloud-init.yaml network: version: 2 ethernets: eno3: ...
e-info128's user avatar
  • 173
0 votes
0 answers
15 views

Can you use virsh to reset vm id sequence? [duplicate]

Question in regards to "Id" for running VMs, using virsh running local Qemu VMs. command virsh list will bring up a list of the current running VMs defined, eg,  Id Name State  --------------...
account404's user avatar
1 vote
0 answers
349 views

libvirt virsh not using a predefined target while attaching interface

I am trying to automate the process of creating a Guest VM. I am using uvt-kvm to create the VM. I am also taking a network type as a parameter. This can be either nat or macvtap. Now in the script I ...
akarX_123's user avatar
0 votes
0 answers
61 views

Controlling virsh filters right way

I'm running centos 7, lxc for containers, virsh for setting up a bridge. Upon creation, virsh set up some firewall rules for virbr # iptables-save | grep virbr -A POSTROUTING -o virbr0 -p udp -m udp --...
Alex Povolotsky's user avatar
1 vote
1 answer
1k views

Migration disabled: vhost-user backend lacks VHOST_USER_PROTOCOL_F_LOG_SHMFD feature

I tried this command on the host. virsh snapshot-create-as --domain test_vm_back --name "snapshot-before-install-package" --description "snapshot test" As you know, this is just a ...
Constantin Hong's user avatar
1 vote
0 answers
112 views

How can I blockpull an inactive domain?

For active domain I can do virsh blockpull --domain ... --path ... --base ... I would expect the blockpull should also work with inactive domain since it should be even easier (there is no write ...
Wang's user avatar
  • 322
0 votes
1 answer
3k views

`virsh -c qemu:///session list --all` lists VMs created in `QEMU/KVM` connection, but misses VM from `QEMU/KVM User session` of Virt-Manager

# virsh -c qemu:///session list --all lists only VMs created in QEMU/KVM connection (system !), but misses VM I've created in QEMU/KVM User session in GUI of Virt-Manager. Why? From below I unserstand ...
Alex Martian's user avatar
0 votes
0 answers
825 views

Why would a KVM/Qemu VM, running successfully on a new host, get stuck "Paused" after a few minutes?

I used virsh commands to backup a Xubuntu 22.04 VM on an Ubuntu 20.04 machine and restore it on an Ubuntu 18.04 machine. The VM starts up successfully, but after a few minutes of running apt updates ...
Martin Bramwell's user avatar
0 votes
3 answers
1k views

Virsh command hangs when script runs in the background

I have a bash script which runs as a cronjob. This script runs several commands and one of them is the following virsh command: /usr/bin/virsh list --all When I run this script in the terminal (as ...
Esteban's user avatar
  • 35
0 votes
2 answers
626 views

How to resize kvm vm host

KVM Host Environment:- # cat /etc/issue Welcome to openSUSE 13.2 "Harlequin" - Kernel \r (\l). # /usr/bin/qemu-system-x86_64 --version QEMU emulator version 2.1.3 With the below commands i ...
Ekam's user avatar
  • 11
2 votes
2 answers
2k views

virsh console hangs when i connect kvm VM

KVM Host Environment:- # cat /etc/issue Welcome to openSUSE 13.2 "Harlequin" - Kernel \r (\l). # /usr/bin/qemu-system-x86_64 --version QEMU emulator version 2.1.3 Running VMs list as ...
user4948798's user avatar
2 votes
1 answer
2k views

Migrating libvirt guest vm to a new storage directory on the same host

I have found a few related questions/articles but nothing about just simply moving an existing VM to a new directory on the same machine. That's what this question entails. For this scenario, I need ...
Rino Bino's user avatar
  • 603
0 votes
1 answer
396 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 ...
gstlouis's user avatar
  • 119
2 votes
1 answer
2k 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 ...
Jason's user avatar
  • 21
1 vote
1 answer
343 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 ...
a coder's user avatar
  • 809
5 votes
3 answers
5k 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-...
David's user avatar
  • 91
0 votes
0 answers
2k 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 ...
ranji's user avatar
  • 21
1 vote
0 answers
2k 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'/&...
average_coder25's user avatar
4 votes
1 answer
2k 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,...
cm08's user avatar
  • 43
0 votes
0 answers
305 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 ...
Carlos Bazilio's user avatar
2 votes
1 answer
2k 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 ...
Adel M.'s user avatar
  • 121
0 votes
2 answers
712 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 ...
Lion's user avatar
  • 508
1 vote
1 answer
694 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 ...
Nitescu Lucian's user avatar
0 votes
2 answers
2k 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 ...
os_user's user avatar
0 votes
1 answer
944 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 ...
MrCalvin's user avatar
  • 403
1 vote
1 answer
931 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 \ --...
Karthik Srinivas's user avatar
0 votes
0 answers
2k 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 ...
gstlouis's user avatar
  • 119
1 vote
3 answers
1k 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....
andys's user avatar
  • 113
1 vote
1 answer
502 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 ...
qwr's user avatar
  • 111
0 votes
2 answers
5k 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). ...
MrSnrub's user avatar
  • 153
1 vote
1 answer
3k 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 ...
Philippe Gachoud's user avatar
2 votes
1 answer
259 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 ...
Sandra's user avatar
  • 10.6k
0 votes
1 answer
1k 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) ...
dsl101's user avatar
  • 433
0 votes
1 answer
4k 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 ...
Ash's user avatar
  • 31
1 vote
3 answers
2k 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 /...
user574429's user avatar
1 vote
1 answer
3k 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/...
2one's user avatar
  • 141
0 votes
1 answer
593 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 ...
turbonerd's user avatar
1 vote
1 answer
3k 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> ...
MrCalvin's user avatar
  • 403
0 votes
1 answer
361 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 ...
CzipO2's user avatar
  • 157
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 -...
PortoFino's user avatar
0 votes
1 answer
209 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="...
midhun k's user avatar
  • 161
0 votes
0 answers
124 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 ...
zzr99's 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=...
speed bump's user avatar
0 votes
1 answer
13k 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 ...
HomeIsWhereThePcIs's user avatar
1 vote
1 answer
3k 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 ...
Nicolas's user avatar
  • 21
0 votes
0 answers
2k 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=&...
Adriano_epifas's user avatar
1 vote
1 answer
1k 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 ...
Hristo Kolev's user avatar
0 votes
1 answer
3k 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 ...
Cutton Eye's user avatar