2016-10-08 17:56:17 +02:00
|
|
|
# qvm
|
2016-11-06 22:08:59 +01:00
|
|
|
|
2016-10-08 17:56:17 +02:00
|
|
|
Trivial management of 64 bit virtual machines with qemu.
|
2016-10-08 18:30:05 +02:00
|
|
|
|
2016-10-10 18:31:13 +02:00
|
|
|
## What this script will do
|
2016-11-06 22:08:59 +01:00
|
|
|
|
2016-10-08 18:30:05 +02:00
|
|
|
It can handle:
|
2016-11-06 22:08:59 +01:00
|
|
|
|
2016-10-08 18:30:05 +02:00
|
|
|
- Virtual hard disk creation, backup and deletion.
|
|
|
|
- Basic network management: two ports are exposed to the host
|
|
|
|
machine (but you can add as many as you want). One of these
|
|
|
|
two ports is SSH (so admin gets simpler).
|
2016-11-07 16:10:40 +01:00
|
|
|
- Connection via SSH.
|
2016-10-08 18:30:05 +02:00
|
|
|
- Shared directory between host and guest.
|
|
|
|
- Last, but not least, running the virtual machine with all
|
|
|
|
these options.
|
|
|
|
|
2016-10-10 18:31:13 +02:00
|
|
|
## Setup information and usage
|
2016-11-06 22:08:59 +01:00
|
|
|
|
2016-10-08 18:30:05 +02:00
|
|
|
- You need a 64 bit machine.
|
|
|
|
- Modify `configvmrc` based on your needs.
|
|
|
|
Variables are self-explanatory and I have kept mine
|
|
|
|
as an example.
|
|
|
|
|
2016-11-06 22:14:36 +01:00
|
|
|
# pacman -S qemu
|
|
|
|
$ . ./configvmrc
|
|
|
|
$ mkdir -p "$shared_data_path"
|
|
|
|
$ ./qvm -i
|
|
|
|
$ ./qvm -b
|
2016-10-10 17:34:01 +02:00
|
|
|
|
|
|
|
- Now you can run the virtual machine:
|
2016-11-06 22:08:59 +01:00
|
|
|
|
2016-11-06 22:14:36 +01:00
|
|
|
$ ./qvm -r
|
2016-10-08 18:30:05 +02:00
|
|
|
|
|
|
|
- On your guest machine add the following in `/etc/fstab`:
|
2016-11-06 22:08:59 +01:00
|
|
|
|
2016-11-06 22:14:36 +01:00
|
|
|
host_share /home/vm/shared 9p trans=virtio,version=9p2000.L 0 0
|
2016-11-06 22:08:59 +01:00
|
|
|
|
2016-10-08 18:30:05 +02:00
|
|
|
This will enable the shared directory automatically (no mount commands of any
|
|
|
|
sort).
|
|
|
|
|
2016-10-10 18:31:13 +02:00
|
|
|
## License
|
2016-11-06 22:08:59 +01:00
|
|
|
|
2016-10-08 18:30:05 +02:00
|
|
|
CC0.
|