As of May 31, 2023, we have updated our Code of Conduct.

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
12 views

Virsh corruption image, re-merge snapshot?

I have an issue with one of my images. The image is encrypted. About three weeks ago I started a snapshot of a running image and then did a blockcommit more recently. Something has since happened to ...
user1021876's user avatar
0 votes
0 answers
14 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
77 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
35 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
193 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
0 votes
0 answers
88 views

Linux virtual machine network DDOS protection

I have dedicated server with installed virsh. On the server I have 5 virtual servers. When someone DDOS attack dedicated server is everyting ok. I hardly know it's an attack. But if someone attacks ...
JeyC0b's user avatar
  • 1
0 votes
0 answers
69 views

how to enable virsh console a ubuntu domain

Environment description: host: libvirtd (libvirt) 6.0.0 os version: 20.04.2 LTS (Focal Fossa) guest: os version: 20.04.2 LTS (Focal Fossa) Problem description: I tried to follow https://wiki.libvirt....
xiaojueguan's user avatar
0 votes
0 answers
128 views

Virt-manager: unable to interact with existing vms on a server

I have 3vm's on a kvm. of recent i have been able to manage these vm's visually through virt-manager. on a windows machine i have been using mobaxterm to access the server and everything was working ...
alpha-evzone's user avatar
0 votes
0 answers
116 views

Issues with starting a virtual machine using virsh without intializing virt manager

I am having problems with starting a virtual machine using virsh. When I do virsh list --all, I see the VM named "ubuntu20.04" and it's state if shut off. Then I do virsh start ubuntu20.04 ...
lukascobbler's user avatar
1 vote
0 answers
65 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
  • 292
0 votes
0 answers
17 views

virsh command that displays all the domins' the affinity to physical processors?

I want to know if there is a command virsh to display all the running domins' the affinity to physical processors? I know vcpuinfo domin to get one domin's info, but it change so fast. I set 16 VMs ...
Zhangcheng Liang's user avatar
0 votes
1 answer
941 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
323 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
0 answers
116 views

libvirt guest cannot be reboot within itself or from host

I have a guest(debian9) created by: virt-install --name vm --events=on_reboot=restart,on_poweroff=restart,on_crash=restart --disk /opt/debian9.qcow2 --import acpid is installed in guest. If I reboot ...
vego's user avatar
  • 123
0 votes
3 answers
556 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
197 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
1 vote
1 answer
1k 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
1 vote
1 answer
538 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
  • 377
0 votes
0 answers
200 views

Libvirt / virsh getting slow after long uptime

After a fresh reboot virsh list / virt-install is fast, as expected, but after a couple of months uptime they both took a long time. Virsh list takes around 3 seconds (from 0.04s on a fresh reboot) ...
Andrew's user avatar
  • 21
0 votes
1 answer
250 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
1 vote
1 answer
976 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
  • 11
1 vote
1 answer
184 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
  • 789
4 votes
3 answers
2k 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
  • 71
0 votes
0 answers
871 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
0 votes
0 answers
1k 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
2 votes
1 answer
1k 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
  • 23
0 votes
0 answers
162 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
1k 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
409 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
  • 496
1 vote
1 answer
416 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
1k 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
529 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
  • 354
1 vote
1 answer
489 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
1k 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
744 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
341 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
1 answer
3k 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
0 votes
1 answer
2k 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
182 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.2k
0 votes
1 answer
673 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
3k 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
2k 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
490 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
2k 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
  • 354
0 votes
1 answer
264 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
  • 137
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
146 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
  • 121
0 votes
0 answers
79 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=...
Christian Hick's user avatar