Creating a new VM from an ISO
You can create a VM in Reven to record scenarios by installing an operating system from an ISO.
The Project Manager does not guide you through all steps required for this operation.
Therefore, in conjunction with using the VM import Wizard, you will also need to run commands via a terminal in the Docker container Reven is running on.
IMPORTANT:
- This page will assume you are familiar with how to import a VM in Reven.
- To issue
docker
commands on the esReven server, your system user will need either bea sudoer or belong to thedocker
group.
To create a new VM from an ISO, please follow the procedure below:
- On the esReven server,
- Find the ID of the Reven container:
docker ps
- Create a directory to store the ISO in the Reven container:
docker exec <eshard/reven2... container id> mkdir /VMs/ISO
- Copy the operating system ISO file to that directory:
docker cp <path_to>/<ISO_file> <eshard/reven2... container id>:/VMs/ISO
- Set the directory and ISO owner to
reven:reven
docker exec <eshard/reven2... container id> chown -R reven:reven /VMs/ISO
- Find the ID of the Reven container:
- Open a terminal in Reven container:
- Open a shell on the docker:
docker exec -it <eshard/reven2... container id> /bin/bash
- Switch to the
reven
user:su - reven
- Go to the
/VMs
directory:cd /VMs
- Open a shell on the docker:
- From the terminal in the docker container:
- Create an empty VM disk:
qemu-img create -f qcow2 myimage.qcow2 80G
- NOTE: You should adapt the name and size of the disk to your requirements.
- Create an empty VM disk:
- From the Project Manager VM import Wizard
- Import the VM disk as described in previous sections.
- When asked to create a disk snapshot, do so (even if this disk is still empty). Write the name down, we will refer to it as
root
. - The first time the Wizard requests you start the VM:
- Check "Override custom options",
- Enter the custom option
-cdrom "/VMs/ISO/<ISO_file>"
, - Click on "Start" to start the VM.
- If the VM does not show up, use the link "Show in browser". Your ISO file will take precedence in the boot as expected.
- Install the operating system on the VM.
- Once the operating system is installed, shut the VM down with ACPI.
- Leave the Wizard open at this step.
- From the terminal in the docker container:
- At this point:
- The base disk of the VM is empty.
- The OS has been installed to the first disk snapshot.
- Instead we want the base disk to contain the vanilla installation, and later use the first snapshot to lighten the VM further.
- Hence, "commit" all changes to the base image using the command:
qemu-img commit /VMs/myimage.qcow2.snapshots/root.qcow2
- Exit the Docker container terminal.
exit
exit
- At this point:
- Back to the Project Manager VM import Wizard
- You might get a warning on this page, in which case simply click on the "Refresh" button.
- Uncheck "Override custom options".
- Click on "Save Settings".
You are now back into the normal workflow: you can stay at this step to perform the necessary operations to make your VM lighter on root
by disabling unnecessary services (see Guest Configuration), then continue on to create the first live snapshot and finish the Wizard.
You now have a ready-to-use VM! You can head over to Scenario to record scenarios and more.