2021-04-14 00:27:52 +00:00
# README
2021-07-14 20:24:13 +00:00
qq2clone is a linux tool to simplify creating and managing copy-on-write clones of template QEMU/KVM virtual machines. It can perform batch operations in case you are working with multiple clones. There is a version of the manual page you can read online above ([man.md](https://git.j-g-web.com/jesse/qq2clone/src/branch/master/man.md)).
2021-04-14 00:27:52 +00:00
qq2clone has these dependences:
2021-07-14 20:24:13 +00:00
* virsh (qq2clone has started transitioning to use the libvirt API directly, this will not remain a dependency forever)
2021-04-14 00:27:52 +00:00
* Bash 4.0+
* sqlite3
* xmllint (from libxml2)
* qemu\-img
* libvirt tools:
* virt\-clone
* virt\-xml
* virt\-xml\-validate
# INSTALL
2021-07-14 20:04:32 +00:00
The file [qq2clone_installer.bash ](https://git.j-g-web.com/jesse/qq2clone/raw/branch/master/qq2clone_installer.bash ) is a setup script containing a self-extracting archive. If you copy and paste the following into a terminal, it will download and run.
2021-07-14 20:06:22 +00:00
```
2021-07-14 20:04:32 +00:00
curl https://git.j-g-web.com/jesse/qq2clone/raw/branch/master/qq2clone_installer.bash > .qq2clone_installer.bash 2> /dev/null & &
chmod +x .qq2clone_installer.bash & &
./.qq2clone_installer.bash
2021-07-14 20:06:22 +00:00
```
2021-04-14 00:27:52 +00:00
# FAQ
2021-07-16 03:25:39 +00:00
2021-07-14 20:24:13 +00:00
## How do I use this thing?
2021-04-14 00:27:52 +00:00
2021-07-16 03:25:39 +00:00
The
[manual ](https://git.j-g-web.com/jesse/qq2clone/src/branch/master/man.md )
is quite detailed, and there is an
[examples](https://git.j-g-web.com/jesse/qq2clone/src/branch/master/man.
md#examples) section that may be helpful.
2021-04-14 00:27:52 +00:00
2021-07-14 20:24:13 +00:00
## Why use Bash and C when this could all be written in Python?
2021-04-14 00:27:52 +00:00
2021-07-16 03:25:39 +00:00
Just to improve my Bash skills and gain a tiny bit of familiarity with C.
Writing this in Python would certainly have been easier.
## Permission issues when making a clone
Getting an error like "Template $VMNAME refers
to /var/lib/libvirt/images/$VMNAME.qcow2, but the file
cannot be read" ? This is because libvirt is configured with a default
storage pool that you, as a non-root user are not allowed to read.
You can resolve this issue by moving the image associated with a
virtual machine to a location your user can read, changing the
ownership/permissions, and modifying the libvirt xml of the
template to point at the new image location. To modify a template machine's
XML, use qq2clone modify\-template VMNAME edit. You will have to
find the filepath of the virtual machine image in the XML and change it
to point at the location you moved it to.
2021-07-16 01:56:36 +00:00
# Copyright 2021, Jesse Gardner
All files present in the qq2clone git repository are released under the
the GNU GPL v2 license, made available in the [license
file](https://git.j-g-web.com/jesse/qq2clone/raw/branch/master/LICENSE)
above. All files contained in the qq2clone git repository, beginning from
the first commit and continuing to the present, are offered solely under
the terms of the GNU GPL v2 license.