升级9.10后virtualbox出现的问题

Kvm、VMware、Virtualbox、Xen、Qemu 等
回复
杨扬1
帖子: 36
注册时间: 2009-09-17 21:47

升级9.10后virtualbox出现的问题

#1

帖子 杨扬1 » 2009-09-30 10:26

我是在9.04上用virtualbox-3.0_3.0.6-52128_Ubuntu_jaunty_i386.deb安装的,升级到9.10后,就出现如下的问题了。请问怎么样才能解决呢?

运行virtualbox后运行xp虚拟时,打不开,出现的第一个提示窗口的提示内容如下:
不能为虚拟电脑 fgtr 打开一个新任务.
Virtual machine 'fgtr' has terminated unexpectedly during startup.
返回 代码:
NS_ERROR_FAILURE (0x80004005)
组件:
Machine
界面:
IMachine {540dcfda-3df2-49c6-88fa-033a28c2ff85}


第二个提示窗口内容如下:
Kernel driver not installed (rc=-1908)

The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Re-setup the kernel module by executing

'/etc/init.d/vboxdrv setup'

as root. Users of Ubuntu, Fedora or Mandriva should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.

vboxdrv文件内容如下:
#! /bin/sh
# Sun VirtualBox
# Linux kernel module init script

#
# Copyright (C) 2006-2009 Sun Microsystems, Inc.
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#

# chkconfig: 35 30 70
# description: VirtualBox Linux kernel module
#
### BEGIN INIT INFO
# Provides: vboxdrv
# Required-Start: $syslog
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: VirtualBox Linux kernel module
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin:$PATH
DEVICE=/dev/vboxdrv
GROUPNAME=vboxusers
LOG="/var/log/vbox-install.log"
NOLSB=

[ -f /lib/lsb/init-functions ] || NOLSB=yes
[ -f /etc/vbox/vbox.cfg ] && . /etc/vbox/vbox.cfg

if [ -n "$INSTALL_DIR" ]; then
VBOXMANAGE="$INSTALL_DIR/VBoxManage"
BUILDVBOXDRV="$INSTALL_DIR/src/vboxdrv/build_in_tmp"
BUILDVBOXNETFLT="$INSTALL_DIR/src/vboxnetflt/build_in_tmp"
BUILDVBOXNETADP="$INSTALL_DIR/src/vboxnetadp/build_in_tmp"
else
VBOXMANAGE="/usr/lib/virtualbox/VBoxManage"
BUILDVBOXDRV="/usr/share/virtualbox/src/vboxdrv/build_in_tmp"
BUILDVBOXNETFLT="/usr/share/virtualbox/src/vboxnetflt/build_in_tmp"
BUILDVBOXNETADP="/usr/share/virtualbox/src/vboxnetadp/build_in_tmp"
fi

if [ -n "$NOLSB" ]; then
if [ -f /etc/redhat-release ]; then
system=redhat
elif [ -f /etc/SuSE-release ]; then
system=suse
elif [ -f /etc/gentoo-release ]; then
system=gentoo
fi
fi

[ -r /etc/default/virtualbox ] && . /etc/default/virtualbox

if [ -z "$NOLSB" ]; then
. /lib/lsb/init-functions
fail_msg() {
echo ""
log_failure_msg "$1"
}
succ_msg() {
log_success_msg " done."
}
begin_msg() {
log_daemon_msg "$@"
}
else
if [ "$system" = "redhat" ]; then
. /etc/init.d/functions
fail_msg() {
echo -n " "
echo_failure
echo
echo " ($1)"
}
succ_msg() {
echo -n " "
echo_success
echo
}
elif [ "$system" = "suse" ]; then
. /etc/rc.status
fail_msg() {
rc_failed 1
rc_status -v
echo " ($1)"
}
succ_msg() {
rc_reset
rc_status -v
}
elif [ "$system" = "gentoo" ]; then
if [ -f /sbin/functions.sh ]; then
. /sbin/functions.sh
elif [ -f /etc/init.d/functions.sh ]; then
. /etc/init.d/functions.sh
fi
fail_msg() {
eerror "$1"
}
succ_msg() {
eend "$?"
}
begin_msg() {
ebegin "$1"
}
if [ "`which $0`" = "/sbin/rc" ]; then
shift
fi
else
fail_msg() {
echo " ...failed!"
echo " ($1)"
}
succ_msg() {
echo " ...done."
}
fi
if [ "$system" != "gentoo" ]; then
begin_msg() {
[ -z "${1:-}" ] && return 1
if [ -z "${2:-}" ]; then
echo -n "$1"
else
echo -n "$1: $2"
fi
}
fi
fi

failure()
{
fail_msg "$1"
exit 0
}

running()
{
lsmod | grep -q "$1[^_-]"
}

start()
{
begin_msg "Starting VirtualBox kernel module"
if ! running vboxdrv; then
if ! rm -f $DEVICE; then
failure "Cannot remove $DEVICE"
fi
# HACK: disable the hardware performance counter framework
if [ -e /proc/sys/kernel/perf_counter_paranoid ]; then
echo 2 > /proc/sys/kernel/perf_counter_paranoid
fi
if ! modprobe vboxdrv > /dev/null 2>&1; then
failure "modprobe vboxdrv failed. Please use 'dmesg' to find out why"
fi
sleep .2
fi
# ensure the character special exists
if [ ! -c $DEVICE ]; then
MAJOR=`sed -n 's;\([0-9]\+\) vboxdrv;\1;p' /proc/devices`
if [ ! -z "$MAJOR" ]; then
MINOR=0
else
MINOR=`sed -n 's;\([0-9]\+\) vboxdrv;\1;p' /proc/misc`
if [ ! -z "$MINOR" ]; then
MAJOR=10
fi
fi
if [ -z "$MAJOR" ]; then
rmmod vboxdrv 2>/dev/null
failure "Cannot locate the VirtualBox device"
fi
if ! mknod -m 0660 $DEVICE c $MAJOR $MINOR 2>/dev/null; then
rmmod vboxdrv 2>/dev/null
failure "Cannot create device $DEVICE with major $MAJOR and minor $MINOR"
fi
fi
# ensure permissions
if ! chown :$GROUPNAME $DEVICE 2>/dev/null; then
rmmod vboxnetadp 2>/dev/null
rmmod vboxnetflt 2>/dev/null
rmmod vboxdrv 2>/dev/null
failure "Cannot change owner $GROUPNAME for device $DEVICE"
fi
if ! modprobe vboxnetflt > /dev/null 2>&1; then
failure "modprobe vboxnetflt failed. Please use 'dmesg' to find out why"
fi
if ! modprobe vboxnetadp > /dev/null 2>&1; then
failure "modprobe vboxnetadp failed. Please use 'dmesg' to find out why"
fi
succ_msg
}

stop()
{
begin_msg "Stopping VirtualBox kernel module"
if running vboxnetadp; then
if ! rmmod vboxnetadp 2>/dev/null; then
failure "Cannot unload module vboxnetadp"
fi
fi
if running vboxdrv; then
if running vboxnetflt; then
if ! rmmod vboxnetflt 2>/dev/null; then
failure "Cannot unload module vboxnetflt"
fi
fi
if ! rmmod vboxdrv 2>/dev/null; then
failure "Cannot unload module vboxdrv"
fi
if ! rm -f $DEVICE; then
failure "Cannot unlink $DEVICE"
fi
fi
succ_msg
}

# enter the following variables in /etc/default/virtualbox:
# SHUTDOWN_USERS="foo bar"
# check for running VMs of user foo and user bar
# SHUTDOWN=poweroff
# SHUTDOWN=acpibutton
# SHUTDOWN=savestate
# select one of these shutdown methods for running VMs
stop_vms()
{
wait=0
for i in $SHUTDOWN_USERS; do
# don't create the ipcd directory with wrong permissions!
if [ -d /tmp/.vbox-$i-ipc ]; then
export VBOX_IPC_SOCKETID="$i"
VMS=`$VBOXMANAGE --nologo list runningvms | sed -e 's/^".*".*{\(.*\)}/\1/' 2>/dev/null`
if [ -n "$VMS" ]; then
if [ "$SHUTDOWN" = "poweroff" ]; then
begin_msg "Powering off remaining VMs"
for v in $VMS; do
$VBOXMANAGE --nologo controlvm $v poweroff
done
succ_msg
elif [ "$SHUTDOWN" = "acpibutton" ]; then
begin_msg "Sending ACPI power button event to remaining VMs"
for v in $VMS; do
$VBOXMANAGE --nologo controlvm $v acpipowerbutton
wait=30
done
succ_msg
elif [ "$SHUTDOWN" = "savestate" ]; then
begin_msg "Saving state of remaining VMs"
for v in $VMS; do
$VBOXMANAGE --nologo controlvm $v savestate
done
succ_msg
fi
fi
fi
done
# wait for some seconds when doing ACPI shutdown
if [ "$wait" -ne 0 ]; then
begin_msg "Waiting for $wait seconds for VM shutdown"
sleep $wait
succ_msg
fi
}

setup()
{
stop
if find /lib/modules/`uname -r` -name "vboxnetadp\.*" 2>/dev/null|grep -q vboxnetadp; then
begin_msg "Removing old VirtualBox netadp kernel module"
find /lib/modules/`uname -r` -name "vboxnetadp\.*" 2>/dev/null|xargs rm -f 2>/dev/null
succ_msg
fi
if find /lib/modules/`uname -r` -name "vboxnetflt\.*" 2>/dev/null|grep -q vboxnetflt; then
begin_msg "Removing old VirtualBox netflt kernel module"
find /lib/modules/`uname -r` -name "vboxnetflt\.*" 2>/dev/null|xargs rm -f 2>/dev/null
succ_msg
fi
if find /lib/modules/`uname -r` -name "vboxdrv\.*" 2>/dev/null|grep -q vboxdrv; then
begin_msg "Removing old VirtualBox kernel module"
find /lib/modules/`uname -r` -name "vboxdrv\.*" 2>/dev/null|xargs rm -f 2>/dev/null
succ_msg
fi
begin_msg "Recompiling VirtualBox kernel module"
if ! $BUILDVBOXDRV \
--save-module-symvers /tmp/vboxdrv-Module.symvers \
--no-print-directory install > $LOG 2>&1; then
failure "Look at $LOG to find out what went wrong"
fi
if ! $BUILDVBOXNETFLT \
--use-module-symvers /tmp/vboxdrv-Module.symvers \
--no-print-directory install >> $LOG 2>&1; then
failure "Look at $LOG to find out what went wrong"
fi
if ! $BUILDVBOXNETADP \
--use-module-symvers /tmp/vboxdrv-Module.symvers \
--no-print-directory install >> $LOG 2>&1; then
failure "Look at $LOG to find out what went wrong"
fi
rm -f /etc/vbox/module_not_compiled
succ_msg
start
}

dmnstatus()
{
if running vboxdrv; then
if running vboxnetflt; then
if running vboxnetadp; then
echo "VirtualBox kernel modules (vboxdrv, vboxnetflt and vboxnetadp) are loaded."
else
echo "VirtualBox kernel modules (vboxdrv and vboxnetflt) are loaded."
fi
else
echo "VirtualBox kernel module is loaded."
fi
for i in $SHUTDOWN_USERS; do
# don't create the ipcd directory with wrong permissions!
if [ -d /tmp/.vbox-$i-ipc ]; then
export VBOX_IPC_SOCKETID="$i"
VMS=`$VBOXMANAGE --nologo list runningvms | sed -e 's/^".*".*{\(.*\)}/\1/' 2>/dev/null`
if [ -n "$VMS" ]; then
echo "The following VMs are currently running:"
for v in $VMS; do
echo " $v"
done
fi
fi
done
else
echo "VirtualBox kernel module is not loaded."
fi
}

case "$1" in
start)
start
;;
stop)
stop_vms
stop
;;
stop_vms)
stop_vms
;;
restart)
stop && start
;;
force-reload)
stop
start
;;
setup)
setup
;;
status)
dmnstatus
;;
*)
echo "Usage: $0 {start|stop|stop_vms|restart|force-reload|status|setup}"
exit 1
esac

exit 0

重新用deb包安装时,出示如下的出错提示:
dpkg:在<包状态和进度文件描述符>时,无法读取文件描述的标志位:错误的文件描述符
Screenshot.png
Screenshot.png


问题已经解决:sudo /etc/init.d/vboxdrv setup
上次由 杨扬1 在 2009-09-30 12:25,总共编辑 1 次。
头像
peteryeh64
论坛版主
帖子: 9379
注册时间: 2008-12-20 15:43
系统: 家kubuntu20.04
来自: 心靈深處

Re: 升级9.10后virtualbox出现的问题

#2

帖子 peteryeh64 » 2009-09-30 11:17

virtualbox-3.0_3.0.6-52128_Ubuntu_jaunty_i386.deb有試著重新安裝看看嗎? :em20
[论坛版主行为规定]+[PITIVI簡易教程]+[ubuntu裝迅雷]
[releases.ubuntu.com]+[cdimage.ubuntu.com]+[old-releases.ubuntu.com]
[學ubuntu必須拜讀懶蝸牛"笨兔兔的故事"=viewtopic.php?f=112&t=162040][Linux明日的希望在中國]
zxjnfs
帖子: 51
注册时间: 2009-06-22 19:37

Re: 升级9.10后virtualbox出现的问题

#3

帖子 zxjnfs » 2009-11-03 9:19

装3.0.8试试看
tamsun
帖子: 451
注册时间: 2006-07-07 21:07

Re: 升级9.10后virtualbox出现的问题

#4

帖子 tamsun » 2009-11-03 11:09

你自己看自己的第二张截图,答案都给你了
头像
caoczlq
帖子: 1233
注册时间: 2008-08-22 11:30
来自: ヨイツ
联系:

Re: 升级9.10后virtualbox出现的问题

#5

帖子 caoczlq » 2009-11-04 8:46

看见那行伟大的蓝色字了吗?去运行那行命令吧~~~~~
头像
kranz
帖子: 171
注册时间: 2007-01-16 12:41

Re: 升级9.10后virtualbox出现的问题

#6

帖子 kranz » 2009-11-08 11:53

运行了 sudo /etc/init.d/vboxdrv setup 就能运行了。但是下次重新启动了又要运行。不知道问题出在了那里
fghlw
帖子: 40
注册时间: 2008-03-06 21:20

Re: 升级9.10后virtualbox出现的问题

#7

帖子 fghlw » 2009-11-08 14:23

重新安装下。。我就是这样解决的 如果安装提示失败 安装module-assistant
http://hi.baidu.com/liamxd/blog/item/e7 ... 669b4.html
回复