Segfault - delay to run multiple VM on boot

Discussions related to using VirtualBox on Linux hosts.
Post Reply
virtualpier
Posts: 12
Joined: 2. Jan 2009, 12:52
Primary OS: Ubuntu 8.04
VBox Version: OSE Debian
Guest OSses: Linux, Windows
Location: Italy

Segfault - delay to run multiple VM on boot

Post by virtualpier »

Hi all,

I've installed the latest VirtualBox (2.1.0) on Ubuntu 8.04.1 - AMD-64 with uname -a
Linux vm1 2.6.24-22-generic #1 SMP.
I use vboxcontrol script (http://farfewertoes.com/code/vboxcontrol/) to start my VM's on boot (2 Linux Ubuntu 64, let's say A and B).
I've removed the 'networking section' from the script.
When i start only 1 VM (eg. A OR B) on boot everything goes fine but, when i try to start my 2 VM on boot (eg. A AND B), i got the following error:
Dec 30 14:20:34 vm1 kernel: [ 34.954745] vboxdrv: TSC mode is 'synchronous', kernel timer mode is 'normal'.
Dec 30 14:32:31 vm1 kernel: [ 751.207455] VBoxSVC[6736]: segfault at 0 rip 4a796a rsp 41256e00 error 4
Dec 30 14:53:28 vm1 kernel: [ 2006.180719] VBoxSVC[6808]: segfault at 0 rip 4a796a rsp 40908e00 error 4
Dec 30 14:53:28 vm1 kernel: [ 2006.181453] VBoxHeadless[7517]: segfault at 0 rip 7fe093584edc rsp 7fff9cf60e40 error 4
Dec 30 15:35:16 vm1 kernel: [ 35.271881] VBoxDrv: dbg - g_abExecMemory=ffffffff88416640
Dec 30 15:35:16 vm1 kernel: [ 35.271945] vboxdrv: fAsync=0 offMin=0x546 offMax=0x2127
As you know, the /etc/init,d/vboxcontrol script start VM's in the following way:
# RUN
case "$1" in
start)
if [ -f /etc/virtualbox/machines_enabled ]; then

cat /etc/virtualbox/machines_enabled | while read VM; do
log_action_msg "Starting VM: $VM ..."
$SU "$VBOXHEADLESS -s \"$VM\" " &
# $SU "$VBOXMANAGE startvm \"$VM\" -type vrdp"
done
fi
;;
As workaround to fix this issue, i've introduced a "sleep 5". It seems it'is the only way to start more than one VM on boot for me :/
# RUN
case "$1" in
start)
if [ -f /etc/virtualbox/machines_enabled ]; then

cat /etc/virtualbox/machines_enabled | while read VM; do
log_action_msg "Starting VM: $VM ..."
$SU "$VBOXHEADLESS -s \"$VM\" " &
sleep 5
# $SU "$VBOXMANAGE startvm \"$VM\" -type vrdp"
done
fi
;;
Why? Is this a bug? Am i missing something?

Thanks for your attention
bb83
Posts: 34
Joined: 8. Sep 2008, 15:16
Primary OS: Linux other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Astaro Firewall,2k3,2k8,Endian Firewall,Debian 4.0,Win XP

Post by bb83 »

Its not a Bug

Code: Select all

$SU "$VBOXHEADLESS -s \"$VM\" " &
# $SU "$VBOXMANAGE startvm \"$VM\" -type vrdp" 
I think you should remove the "&"... Because with the & you may start more than one machine at the same time. Thats a bad idea ;)
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

bb83 wrote:Its not a Bug

Code: Select all

$SU "$VBOXHEADLESS -s "$VM" " &
# $SU "$VBOXMANAGE startvm "$VM" -type vrdp" 
I think you should remove the "&"... Because with the & you may start more than one machine at the same time. Thats a bad idea ;)
No, on Linux, running something with & at the end means drop it to the background and give the CLI back. If you would run a program, lets say firefox, from a terminal, you won't be able to use the terminal any more. With the & after firefox, you can use it again.
However, if you use &&, it means you want to run another program after it.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
bb83
Posts: 34
Joined: 8. Sep 2008, 15:16
Primary OS: Linux other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Astaro Firewall,2k3,2k8,Endian Firewall,Debian 4.0,Win XP

Post by bb83 »

No, on Linux, running something with & at the end means drop it to the background and give the CLI back.
You don't need to "daemonize" this command with &(VBoxManage "daemonizes" it self after succesfull execution). Because of this & you may start mulitple vm's at the same time! Thats why the sleep command helps...
Post Reply