VBOX Variables during preseed?

This is for discussing general topics about how to use VirtualBox.
Post Reply
xiffy
Posts: 2
Joined: 11. Sep 2018, 16:43

VBOX Variables during preseed?

Post by xiffy »

I'm in the process of creating a lot of virtual machines, all scripted.
I've managed to create a shell-script which issues some vboxmanage commands and which creates a new pristine machine without OS. The next step is installing the OS (Debian) and configure the machine.
This is partly done by using a preseed file, based on:

[www virtualbox org] /svn/vbox/trunk/src/VBox/Main/UnattendedTemplates/debian_preseed.cfg

This file has examples like:
@@VBOX_INSERT_HOSTNAME_DOMAIN@@
@@VBOX_INSERT_HOSTNAME_WITHOUT_DOMAIN@@
@@VBOX_INSERT_TIME_ZONE_UX@@
The question I have in particular is this: How can i let VirtualBox insert the ip-address the machine has (static) or if this question is easier to answer, which VBOX variables are available during preseed ?

(i searched on many places, but it seems like this is undocumented? )
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VBOX Variables during preseed?

Post by mpack »

Why do you have to script the guest OS installation? Why not just install it once, then clone the VM as required?

You don't insert an IP address. IP address are assigned by the network DHCP server to each MAC address. You can control whether clones have the same or a different MAC address. I don't know of any way to force a new VM to have a particular MAC address, other than hacking the .vbox file before running the VM.
xiffy
Posts: 2
Joined: 11. Sep 2018, 16:43

Re: VBOX Variables during preseed?

Post by xiffy »

In most cases, yes DHCP is the answer, in my case, unfortunately not. In my case not all machines are equal and i'm looking for a quick way to script creating the machine (with some commandline arguments) and after that deploy our software. This process must be reproducable at all stages, including creation of the VM.
Now considering that VboxManage during unattended install can have for instance --user, which can be translated to @@VBOX_INSERT_USER_LOGIN@@ when used in a preeseed-file.
But reading the VboxManage documentation (/manual/ch08.html#vboxmanage-unattended) I see that no option for an IP-address exists for unattended. So I'll figure something out on a different path.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VBOX Variables during preseed?

Post by mpack »

DHCP is not an optional extra. I don't know of any other way to control assignment of an IP to an OS on a relevant network, regardless of the hardware the OS runs in.

VirtualBox has no power to make an OS do things it wouldn't ordinarily do.
Post Reply