User Tools

Site Tools


computing:virtmanagerhell

This is an old revision of the document!



  • virtmanagerhell
  • Jonathan Haack
  • Haack's Networking
  • netcmnd@jonathanhaack.com

Start defualt

sudo virsh net-start default 

Remove bridge

sudo ifconfig virbr0 dow
sudo brctl delbr virbr0

List all

sudo virsh net-list --all 

Simple bridge mode for virt-manager - how to create it if you deleted or broke it. I used manual commands, but one could use the brctl command.

sudo nano /etc/network/interfaces
auto br1
iface br1 inet dhcp
   bridge_ports enp3s0
   bridge_stp on
   bridge_fd 0.0
   

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
computing/virtmanagerhell.1547398898.txt.gz · Last modified: 2019/01/13 17:01 by oemb1905