Virsh: Difference between revisions

From DWIKI
mNo edit summary
Line 5: Line 5:




=FAQ=
==Find IP address of a guest==
https://rwmj.wordpress.com/2010/10/26/tip-find-the-ip-address-of-a-virtual-machine/


= FAQ =
== Find IP address of a guest ==
[https://rwmj.wordpress.com/2010/10/26/tip-find-the-ip-address-of-a-virtual-machine/ https://rwmj.wordpress.com/2010/10/26/tip-find-the-ip-address-of-a-virtual-machine/]
 
== Remove VM ==


==Remove VM==
  virsh list
  virsh list
  virsh destroy vmname
  virsh destroy vmname
Line 16: Line 21:
  virsh vol-delete /path/to/image
  virsh vol-delete /path/to/image


==Virsh console==
== Virsh console ==
     


== error: Requested operation is not valid: cannot undefine domain with nvram ==
virsh undefine --nvram yourvm


=Cheatsheet=
=Cheatsheet=

Revision as of 11:48, 18 February 2021

Docs


FAQ

Find IP address of a guest

https://rwmj.wordpress.com/2010/10/26/tip-find-the-ip-address-of-a-virtual-machine/

 

Remove VM

virsh list
virsh destroy vmname
virsh undefine vmname
virsh vol-delete /path/to/image

Virsh console

error: Requested operation is not valid: cannot undefine domain with nvram

virsh undefine --nvram yourvm

Cheatsheet

show resources

virsh dominfo <vmname>

show volumes

virsh vol-list default

show disk sizes

virsh pool-list --all --details

enable virsh console

systemctl enable serial-getty@ttyS0.service
systemctl start serial-getty@ttyS0.service

Centos 6, 7

To get to see bootloader:

grubby --update-kernel=ALL --args="console=ttyS0"

ON Centos 6 you need to create /etc/init/ttyS0.conf:

stop on runlevel[S016]
start on stopped rc RUNLEVEL=[2345]
respawn
instance /dev/ttyS0
exec /sbin/mingetty /dev/ttyS0

Add "ttyS0" to /etc/securetty And then run:

initctl start ttyS0