grimoire

personal wiki
git clone git://git.pyratebeard.net/grimoire.git
Log | Files | Refs

virsh.md (708B)


      1 # virsh
      2 
      3 ## creating vms
      4 * create vm with virt-install
      5 ```
      6 virt-install --name=<name> --vcpus=1 --memory=1024 --cdrom=/path/to/image.iso --disk size=8 --os-variant=<variant>
      7 ```
      8 * above should automatically start `virt-viewer` if installed
      9 * to see available variants incant
     10 ```
     11 virt-install --osinfo list
     12 ```
     13 
     14 ## managing vms
     15 ```
     16 virsh list --all
     17 virsh start <name>
     18 virsh dominfo <name>
     19 ```
     20 
     21 ## connecting to running vm
     22 * connect to terminal console
     23 ```
     24 virsh console <name>
     25 ```
     26 
     27 * connect to gui
     28 ```
     29 virt-viewer <name>
     30 ```
     31 
     32 ## customise image
     33 * `virt-customize` requires libguestfs-tools pkg on debian
     34 ```
     35 virt-customize -a /path/to/image.qcow2 --root-password password:<passwd> --uninstall cloud-init
     36 ```