This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
computing:virtmanagerhell [2022/08/08 20:15] – oemb1905 | computing:virtmanagerhell [2022/11/12 14:35] – oemb1905 | ||
---|---|---|---|
Line 7: | Line 7: | ||
------------------------------------------- | ------------------------------------------- | ||
- | These are two different attempts (both with 1 success each) of resizing .img files from the command line. Resize an .img with virt-manager, for example, expanding | + | To make a VM from the command line, do the following. Note that this recipe assumes you have already created your virtual switch, br0. |
+ | |||
+ | sudo virt-install --name=new \ | ||
+ | --os-type=Linux \ | ||
+ | --os-variant=debian10 \ | ||
+ | --vcpu=1 \ | ||
+ | --ram=2048 \ | ||
+ | --disk path=/ | ||
+ | --graphics spice \ | ||
+ | --location=/ | ||
+ | --network bridge: | ||
+ | |||
+ | To clone an existing image, do the following: | ||
+ | |||
+ | virt-clone \ | ||
+ | --original=clean \ | ||
+ | --name=sequoia \ | ||
+ | --file=/ | ||
+ | |||
+ | If you have a legacy image that needs to be larger, then install | ||
+ | |||
+ | apt install qemu-img kpartx | ||
+ | qemu-img resize debian10.img +50G | ||
+ | |||
+ | After expanding | ||
+ | |||
+ | virsh shutdown < | ||
+ | virsh domrename < | ||
+ | |||
+ | The rest from here on out is my attempt at resizing an .img using tools exclusively from virsh / virt-manager. I have only succeeded twice doing this, and often get confused looking at the l00ps. | ||
| | ||
sudo apt install libguestfs-tools | sudo apt install libguestfs-tools | ||
Line 87: | Line 116: | ||
kpartx -d debian10.img | kpartx -d debian10.img | ||
| | ||
- | After messing around with this, and succeeding 1 time in resizing the drive this way, I decided that just issuing '' | ||
- | --- // | + | --- // |