User Tools

Site Tools


computing:virtmanagerhell

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
computing:virtmanagerhell [2021/10/30 00:19] oemb1905computing:virtmanagerhell [2021/11/08 06:13] oemb1905
Line 60: Line 60:
  
 At this point, I would probably reboot and then from within the VM, ping 8.8.8.8, and then ping google.com to ensure you have link and upstream DNS.  Everything should be rosy ;> Some folks might be concerned about ARP and such, but virt-manager handles that with the gateway entry combined with the bridge, so no need to alter proc and pass traffic, etc.  Of course, replace Google's DNS if you so choose, but I had reliability problems with Level 3 during testing myself (sad). At this point, I would probably reboot and then from within the VM, ping 8.8.8.8, and then ping google.com to ensure you have link and upstream DNS.  Everything should be rosy ;> Some folks might be concerned about ARP and such, but virt-manager handles that with the gateway entry combined with the bridge, so no need to alter proc and pass traffic, etc.  Of course, replace Google's DNS if you so choose, but I had reliability problems with Level 3 during testing myself (sad).
 +-- Below, are notes from when I shrunk an .img file / expanded an .img file (cannot remember lol) --
 +
 +Resize an .img with virt-manager, for example, expanding a 64GB disk to a 124GB disk.  Start by installing the optional tools for this:
 +  
 +  sudo apt install libguestfs-tools
 +  
 +After that, confirm the location of your virtual machine.  You need to know the actual name of the .img file for this to work.  Usually (unless it was changed by someone), this is the name that appears in the virt-manager window.
 +  
 +  virsh dumpxml putnameofimagehere | xpath -e /domain/devices/disk/source
 +
 +Navigate to the directory it spit out, and back up the image and rename it before you proceed:
 +
 +  cd /var/lib/libvirt/images/
 +  sudo cp /var/lib/libvirt/images/putnameofimagehere.img /var/lib/libvirt/images/putnameofimagehere.img.bak
 +
 +Once you know the name of the .img file and the location of it, prepare the virtual file systems for expansion:
 +
 +  virt-filesystems --long --parts --blkdevs -h -a /var/lib/libvirt/images/putnameofimagehere.img
 +  
 +Build a new, larger, container for the final disk, and set it aside for the merge/expansion that the tools are going to provide:
 +
 +  truncate -s 128G /var/lib/libvirt/images/outdisk
 +
 +Now it is time to resize the existing image, using the container you just created:
 +
 +  virt-resize --expand /dev/sda2 /var/lib/libvirt/images/putnameofimagehere.img /var/lib/libvirt/images/outdisk
 +  
 +Okay, now we need to rename the new image we created to the name that virt-manager is looking for, i.e., the name of the original image.  Remember, you should have the .bak file you made earlier in case this does not work.  This is done as follows:
 +
 +  cp /var/lib/libvirt/images/putnameofimagerhere.img /var/lib/libvirt/images/putnameofimagerhere.img.old
 +  mv /var/lib/libvirt/images/outdisk /var/lib/libvirt/images/putnameofimagehere.img
 + 
    
  --- //[[jonathan@haacksnetworking.com|oemb1905]] 2021/10/29 16:39//  --- //[[jonathan@haacksnetworking.com|oemb1905]] 2021/10/29 16:39//
computing/virtmanagerhell.txt · Last modified: 2023/01/15 17:47 by oemb1905