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 revisionBoth sides next revision
computing:virtmanagerhell [2022/11/07 05:09] oemb1905computing:virtmanagerhell [2022/11/12 14:32] oemb1905
Line 6: Line 6:
  
 ------------------------------------------- -------------------------------------------
 +
 +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=/mnt/vms/students/new.img \
 +  --graphics spice \
 +  --location=/mnt/vms/isos/debian-11.4.0-amd64-netinst.iso \
 +  --network bridge:br0
 +
 +To clone an existing image, do the following:
 +
 +  virt-clone \
 +  --original=clean \
 +  --name=sequoia \
 +  --file=/mnt/vms/students/sequoia.img
 +
 +If you have a legacy image that needs to be larger, then install a few tools and the proceed to expand the virtual hard disk as follows:
 +
 +  apt install qemu-img kpartx
 +  qemu-img resize debian10.img +50G
 +  
 +After expanding the virtual hard disk, open gparted in X passthrough / command line and expand the existing partition into as much of the the new space as you prefer. 
 +
 +-- Archive: Grow a VM through Command Line Only --
  
 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 a 64GB disk to a 124GB disk.  Start by installing the optional tools for this: 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 a 64GB disk to a 124GB disk.  Start by installing the optional tools for this:
Line 87: Line 115:
   kpartx -d debian10.img   kpartx -d debian10.img
      
-After messing around with this, and succeeding 1 time in resizing a drive this way, I decided that just issuing the commands below: 
- 
-  apt install qemu-img kpartx 
-  qemu-img resize debian10.img +50G 
-   
-And then opening gparted in X passthrough and expanding the volume is far more efficient and easier. Of course, you could also expand with gparted at the command line too. 
  
- --- //[[jonathan@haacksnetworking.org|oemb1905]] 2022/11/06 22:07//+ --- //[[jonathan@haacksnetworking.org|oemb1905]] 2022/11/12 07:27//
computing/virtmanagerhell.txt · Last modified: 2023/01/15 17:47 by oemb1905