[CLOSE]VirtualBox 3.0.12 loses its guests
Posted: 8. Dec 2009, 08:47
Hi,
I launch two guest by those commands.
At first time, all work fine. Rdp control is enable. VBoxManage say my vms are up.
But next day (or maybe after long time), the rdp control is disable. VBoxManage say there is no more vm running.
I can ping again vm, I can connect on by SSH or RDP of my 2003.
This command show they work run.
I'm under Ubuntu 9.04, I test 3.0.10 and 3.0.12.
I use my owns scripts for launch my vms.
Configuration File:
I launch two guest by those commands.
Code: Select all
/usr/lib/virtualbox/VBoxHeadless -s 2K3 --vrdp on --vrdpport 10001
/usr/lib/virtualbox/VBoxHeadless -s uglpi --vrdp on --vrdpport 10000
But next day (or maybe after long time), the rdp control is disable. VBoxManage say there is no more vm running.
Code: Select all
administrateur@vbox2:~$ VBoxManage list runningvms
VirtualBox Command Line Management Interface Version 3.0.12
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
administrateur@vbox2:~$
This command show they work run.
Code: Select all
administrateur@vbox2:~$ ps aux | grep VBoxHeadless
1000 6264 0.0 0.0 42188 1568 ? S Dec07 0:00 su -c VBoxHeadless -s uglpi --vrdp on --vrdpport 10000 administrateur
1000 6266 0.0 0.0 42188 1568 ? S Dec07 0:00 su -c VBoxHeadless -s 2K3 --vrdp on --vrdpport 10001 administrateur
1000 6280 140 18.0 2460528 2192816 ? Sl Dec07 1674:50 /usr/lib/virtualbox/VBoxHeadless -s 2K3 --vrdp on --vrdpport 10001
1000 6281 0.3 2.6 532360 316952 ? Sl Dec07 4:39 /usr/lib/virtualbox/VBoxHeadless -s uglpi --vrdp on --vrdpport 10000
1000 17409 0.0 0.0 6548 804 pts/0 R+ 08:31 0:00 grep VBoxHeadless
I use my owns scripts for launch my vms.
Code: Select all
administrateur@vbox2:/etc/init.d$ cat VBoxNetwork
#!/bin/bash
# Plug VM Network interface on bridge
function createTun() {
echo "Up dev=$1 user=$2 bridge=$3"
tunctl -t $1 -u $2
ip link set up dev $1
brctl addif $3 $1
}
function deleteTun() {
echo "Down dev=$1 bridge=$3 "
brctl delif $3 $1
tunctl -d $1
}
function upNetwork() {
cat /etc/vbox/guests | grep -v \# | while curLine=`line`
do
createTun $curLine
done
}
function downNetwork() {
cat /etc/vbox/guests | grep -v \# | while curLine=`line`
do
deleteTun $curLine
done
}
case "$1" in
start)
upNetwork
;;
stop)
downNetwork
;;
force-reload|restart)
downNetwork
sleep 5
upNetwork
;;
*)
echo "Usage: /etc/init.d/VBoxNetwork.sh {start|stop|restart|force-reload}"
exit 1
;;
esac
exit 0
Code: Select all
administrateur@vbox2:/etc/init.d$ cat VBoxControler
#!/bin/bash
# Launch VM
function startGuest() {
echo "Start guest=$4"
su -c "VBoxHeadless -s $4 --vrdp on --vrdpport $6" administrateur < /dev/null &> /home/administrateur/log/$1.log &
}
function stopGuest() {
echo "Stop guest=$4"
su -c "VBoxManage controlvm $4 poweroff" administrateur &
}
function controlGuest() {
echo "control guest=$4"
if ! ping -q -c 2 $5
then
echo La VM $4 ne repond pas au ping
if su administrateur -c VBoxManage list runningvms | grep $4
then
su administrateur -c VBoxManage controlvm $4 poweroff &
sleep 60
fi
echo Lancement de la VM $4
startGuest $curLine
else
echo La VM $4 est en vie
fi
}
function startAllGuests() {
cat /etc/vbox/guests | grep -v \# | while curLine=`line`
do
startGuest $curLine
done
}
function stopAllGuests() {
cat /etc/vbox/guests | grep -v \# | while curLine=`line`
do
stopGuest $curLine
done
}
function controlAllGuests() {
cat /etc/vbox/guests | grep -v \# | while curLine=`line`
do
controlGuest $curLine
done
}
case "$1" in
start)
startAllGuests
;;
stop)
stopAllGuests
;;
control)
controlAllGuests
;;
force-reload|restart)
stopAllGuests
sleep 60
controlAllGuests
;;
*)
echo "Usage: /etc/init.d/VBoxNetwork.sh {start|stop|control|restart|force-reload}"
exit 1
;;
esac
exit 0
Code: Select all
administrateur@vbox2:/etc/init.d$ cat /etc/vbox/guests
# Each line should be of the format :
# <interface name> <user name> <bridge> <guestname> <guestip> <rdpport>
vbox0 administrateur br0 uglpi X.X.X.45 10000
vbox1 administrateur br0 2K3 X.X.X.46 10001
administrateur@vbox2:/etc/init.d$