A short description and all necessary scripts to deploy VMs on a headless Virtualbox
|
|
8 anni fa | |
|---|---|---|
| LICENSE | 8 anni fa | |
| README.md | 8 anni fa |
A short description and all necessary scripts to deploy VMs on a headless Virtualbox
This is a collection of all commands necessary to create a virtual machine on a headless VirtualBox
The following steps will be performed:
Since virtualbox manages virtual machines on a per user basis, all commands will be executed using the system user, who will be using the virtual machine later. The machine will be called MyMachine (but hold before you execute the following command):
VBoxManage --createvm MyMachine
This will create the base for all later actions. But since VirtualBox needs to know about the machine, we should register it with VirtualBox (again: hold the presses):
VBoxManage --createvm MyMachine --register
If you want to store all of your virtual machine stuff some place else than ~/VirtualBox VMs, you should tell VirtualBox also about your desired location, e.g. /srv/vms (while still holding back on pressing Return):
VBoxManage --createvm MyMachine --register --basefolder /srv/vms
Be patient, we are almost there, but why not telling VirtualBox at the same time about the intenden operating system (Debian 64bit):
VBoxManage --createvm MyMachine --register --basefolder /srv/vms --ostype Debian_64
And last but not least, if you intend to run more than one virtual machine with virtual box and machines are intended for different purposes, you could even group your machines. In my case I decided to go with a grouping logic that consists of stage (e.g. development, testing, production), purpose (i.e. office, services, network) and type (i.e. server, workstation), which led me to a nested grouping:
VBoxManage --createvm MyMachine --register --basefolder /srv/vms --ostype Debian_64 --groups "/Production/Office/Server"
This will create a frame for your virtual machine in /srv/vms/Production/Office/Server.