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 .
154 questions
0
votes
0
answers
58
views
linux KVM host, no network connection on guest VMs
after a kernel upgrade with out debian servers we went through reboots and have since then problems with obe of our KVM hosts. On the host itself everything works, but on the guests there is no ...
0
votes
0
answers
76
views
VMs in nat network not reachable by the host. Guest Virtual interfaces not showing. (QEMU / KVM - VirtManager)
First of all, sorry for the lack of technical details. Virtualization is not my area of expertise.
I use QEMU / KVM with Virt manager to manage some VMs I use for personal labs and testing on my ...
0
votes
0
answers
25
views
Specify PV when creating volume in libvirt logical pool
I created a libvirt logical pool that uses an existing vg (that has a bunch of PVs with various sizes/speeds):
virsh pool-define-as --name existingvg --type logical
When I create a volume in this ...
0
votes
0
answers
12
views
Does Libvirtd record the start and end timestamps of a session when establishing a connection through the 'virsh' tool?
For instance, when initiating a connection to Libvirtd using the command 'virsh -c qemu+tcp://user@host/system', I attempted to locate the session logs within 'journalctl' and 'audit.log' but was ...
0
votes
0
answers
134
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.
0
votes
1
answer
1k
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:
...
0
votes
0
answers
16
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
--------------...
1
vote
1
answer
632
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 ...
0
votes
0
answers
76
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 --...
1
vote
1
answer
2k
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 ...
1
vote
0
answers
139
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 ...
0
votes
1
answer
4k
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 ...
0
votes
0
answers
1k
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 ...
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 ...
0
votes
2
answers
920
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 ...
2
votes
2
answers
3k
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 ...
2
votes
1
answer
3k
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 ...
0
votes
1
answer
428
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 ...
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 ...
1
vote
1
answer
434
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 ...
5
votes
3
answers
6k
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-...
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 ...
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'/&...
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,...
0
votes
0
answers
333
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 ...
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 ...
0
votes
2
answers
858
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 ...
1
vote
1
answer
753
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 ...
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 ...
0
votes
1
answer
1k
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 ...
1
vote
1
answer
1k
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 \
--...
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 ...
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....
1
vote
1
answer
557
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 ...
0
votes
2
answers
7k
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).
...
1
vote
1
answer
4k
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 ...
2
votes
1
answer
294
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 ...
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)
...
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 ...
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
/...
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/...
1
vote
1
answer
632
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 ...
1
vote
1
answer
4k
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> ...
0
votes
1
answer
423
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 ...
0
votes
1
answer
2k
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 -...
0
votes
1
answer
217
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="...
0
votes
0
answers
137
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 ...
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=...
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 ...
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 ...