VirtualBox can't boot a Linux residing in the same hard disk - operation not permitted

Juergen Lock nox at jelal.kn-bremen.de
Sat Oct 2 14:05:30 UTC 2010


In article <AANLkTikFn3dbkWXPFj0-zGQzhJD=W7sUFTUj1Mu8P_WK at mail.gmail.com> you write:
>Hi, everyone.
>
>I have a disk where I have installed both Linux and FreeBSD, under
>different partitions. From FreeBSD, I wanted to use VirtualBox to boot
>my Linux, which resides in a different partition of the same disk. I
>installed the latest Virtualbox from ports (3.2.8, r64453), and I
>tried to create a raw-access device:
>
>   bash$ sudo VBoxManage internalcommands createrawvmdk -filename
>~/.VirtualBox/WholeDisk.vmdk -rawdisk /dev/ad11
>
>but unfortunately, I got...
>
>   ERROR: VMDK: could not open raw disk file '/dev/ad11'
>
>and truss revealed that:
>
>  bash$ sudo truss VBoxManage internalcommands createrawvmdk -filename
>~/.VirtualBox/WholeDisk.vmdk -rawdisk /dev/ad11 2>&1 | grep ad11
>  open("/dev/ad11",O_RDONLY,0600)                  = 8 (0x8)
>  open("/dev/ad11",O_RDWR,0600)                    ERR#1 'Operation
>not permitted'
>
>So it seems that VBoxManage attempted to get read-only access to the
>device, succeeded, then attempted to get RW access, and failed.
>
>I tried this under a root login too (i.e. not via sudo), just in case. No go.
>
>Security wise, I am at:
>
>bash$  sysctl kern.securelevel
>kern.securelevel: -1
>
>Any ideas on what to try?

You need to disable the geom(4) anti-foot-shooting flag:

	sysctl kern.geom.debugflags=16

(this is meant to protect from writing to underlying devices of mounted
filesystems because that usually causes corruption.)

 So be careful not to mount/boot the FreeBSD slice from within the
guest... :)

 HTH,
	Juergen


More information about the freebsd-emulation mailing list