10 Comments Already

mygif
raymond Said,
May 2nd, 2008 @02:54  

This is a great soluton! I have been looking for something like this for a long time.

What if I’m not using a tap interface will this script still work? Is there an option to disable the loading of the tap interface?

Why not use the VBoxRDP command to start the VMs?

mygif
Jochem Said,
May 2nd, 2008 @10:04  

Hi Raymond, thanks for the compliment.

Right now the script only works with tap interfaces, since I didn’t have a need for non-tap based VM’s. Adding an option for that would be easy though, I guess. If so, I’ll post a new version soonish with the option in it.

I use the VBoxManage command since that can do all actions to a VM needed, like shutting down (VBoxRDP can’t do this afaik), listing running VM’s etc. I don’t think there’s any advantage of running VBoxRDP for just starting the VM’s.

mygif
raymond Said,
May 2nd, 2008 @13:42  

Hi Jochem,

Thanks for the quick response.

The only difference with using VBoxRDP for starting the VM is that it will show up in the log if there are any problems when starting it.

I’m looking forward to your updated script.

PS. I believe you should post a link inside the VirtualBox forum for other s to find this wonderful script of yours. Believe you me there are many others who would like to be able to do this on their linux box but don’t know how to code the script.

mygif
esoco Said,
June 1st, 2008 @12:14  

Thanks for this helpful script, it works without problems on Ubuntu 8.04 for me. I only noticed a small typo in the instructions: the entry in interfaces mentioned here
* If you use ‘Host interface’ networking, put a br0 entry in /etc/network/interfaces: inet br0 inet dhcp

must instead be “iface br0 inet dhcp”.

mygif
Jochem Said,
June 1st, 2008 @13:19  

Thanks esoco, you’re right. It’s fixed in the vboxcontrol section

mygif
Lei Said,
June 15th, 2008 @13:39  

It’s a great script I have been looking for.

The version 2008051100 by Jochem does not work for my setup:

Sun xVM 1.6.2 under Ubuntu Server 8.04

so that I have adapted it and named version 20080615-1915. It is sent to Jochen to post in the hope that it may be useful for some people. It was just tested in my abovementioned setup and I am not sure if it would work on Ubuntu Desktop or any other Linux distributions, which I am not using and unable to test with.

mygif
timbophillips Said,
September 14th, 2008 @12:27  

great work jochem, that solved a problem i was having with a server running several virtualbox VMs. two extra bits that have helped me…

i add the lines
bridge_fd 0
bridge_stp on
in the br0 section of /etc/network/interfaces
on big networks this avoids the situation where the bridge isn’t in listening mode by the time virtualbox is plugging its VMs onto the taps

in your vboxcontrol script (fantastic script by the way) i added a few lines to the waiting_for_closing_machines() method to give the VMs a minute or so to close themselves in response to the ACPI powerbutton… if a minute goes by and they haven’t closed I assume they’ve hung and use ‘poweroff’ to pull the plug on them.

code below….

wait_for_closing_machines() {
RUNNING_MACHINES=`$SU “$VBOXMANAGE list runningvms” | wc -l`
if [ $RUNNING_MACHINES != 0 ]; then
sleep 5

# =========================================================
# added by Tim; give them a few cycles to shutdown then kill them
# =========================================================
x=$(expr $x + 1)
log_action_msg “waiting for them to shut-down as instructed - $x”
if [ $x = 10 ]; then
log_action_msg “$RUNNING_MACHINES VM(s) seem to be hung…”
$SU “$VBOXMANAGE list runningvms” | while read HUNGVM; do
log_action_msg “Powering off VM: $HUNGVM …”
$SU “$VBOXMANAGE controlvm \”$HUNGVM\” poweroff”
done
fi
#========================================================

wait_for_closing_machines
fi
}

mygif
robp2175 Said,
September 29th, 2008 @20:59  

How do I remove this script “update-rc.d vboxcontrol defaults 99 10″ .
It did not work for me and I want to make sure it does not try to run every time I boot.

mygif
frajopwaf Said,
October 7th, 2008 @13:26  

Подскажите шооблончег под Wordpress 2.6.2, чтобы был похож на ваш farfewertoes.com.

Заранее благодарю)

Pingback & Trackback
mygif
May 11th, 2008 @22:08  

Related stories

Leave Your Comments Below

Tags

Recent Posts

Recent Comments

  • frajopwaf in Start VirtualBox virtual machines on boot
  • robp2175 in Start VirtualBox virtual machines on boot
  • timbophillips in Start VirtualBox virtual machines on boot
  • Lei in Start VirtualBox virtual machines on boot
  • Jochem in Start VirtualBox virtual machines on boot
  • esoco in Start VirtualBox virtual machines on boot
  • vboxcontrol 2008051100 | Far Fewer … in Start VirtualBox virtual machines on boot
  • raymond in Start VirtualBox virtual machines on boot
  • Jochem in Start VirtualBox virtual machines on boot
  • raymond in Start VirtualBox virtual machines on boot
Syndication