Boot from Network Once

This is for discussing general topics about how to use VirtualBox.
Post Reply
S128K
Posts: 2
Joined: 10. Feb 2014, 15:30

Boot from Network Once

Post by S128K »

Is there a way to get a Guest to boot from net once i.e. the next boot.
I've one guest set up as a PXE server and multiple other guests set up to pxe boot from that one. I can use the modifyvm command to set boot from network on each guest and start the VM but I want to have it only boot from net only once as the kickstart will reboot it (thats when puppet takes over). Note: I've no control over the kickstarts or how they're generated.

I'de rather not have to nc the guests to figure out the install-reboot and halt them and reset the boot order and start them again.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Boot from Network Once

Post by scottgus1 »

Having a little trouble understanding "kickstart" and "puppet" and what "nc the guest" is.

I would first think of a launch script to monitor if a flag file (a simple text file with a certain unique name and no contents) exists for a guest, perhaps in the guest's Virtualbox folder. If the script sees that the flag file does not exist, it issues the boot-from-PXE VboxManage command, makes the flag file, and starts the guest. If the script does see the flag file it issues the boot-from-virtual-disk Vboxmanage command, and starts the guest. I'm not certain if there exists something native in Virtualbox to do this.

One could also do this without PXE by pointing the guest's virtual CD drive at the installer ISO (I assume it's an ISO), which could be stored on the network or on the host, then let the machine boot from CD first. If the installer ISO is like every Windows ISO I've used, and it has a "Press any key to boot from CD" function which jumps to the hard drive if no keys are pressed, then you're set up. If the disc ISO insists on booting, then use a script like above, to unmount the iso or change the boot order after the flag file exists.
S128K
Posts: 2
Joined: 10. Feb 2014, 15:30

Re: Boot from Network Once

Post by S128K »

nc -> netcat
puppet -> configuration management tool
cobbler - See en.wikipedia.org/wiki/Cobbler_(software)

Each guest has the boot order CD-ROM, HDD, Network.

We use cobbler to install i.e. install from network

I'de like to be able to start a VM using a startvm --type gui --boot net command where that boot command boots from Network just for this session. Rebooting the VM should cause the default boot order to hold. The reason being, there are reboots during the installation, setting Network before HDD as the default would stop the installation from proceeding (i.e. it would constantly reboot to network)
Post Reply