From owner-freebsd-emulation@FreeBSD.ORG Sat Oct 2 14:05:30 2010 Return-Path: Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C4F81065670 for ; Sat, 2 Oct 2010 14:05:30 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 013818FC0A for ; Sat, 2 Oct 2010 14:05:29 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 48EA11E000CA; Sat, 2 Oct 2010 16:05:29 +0200 (CEST) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.4/8.14.3) with ESMTP id o92E4AwB063221; Sat, 2 Oct 2010 16:04:10 +0200 (CEST) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.4/8.14.3/Submit) id o92E49cn063220; Sat, 2 Oct 2010 16:04:09 +0200 (CEST) (envelope-from nox) Date: Sat, 2 Oct 2010 16:04:09 +0200 (CEST) From: Juergen Lock Message-Id: <201010021404.o92E49cn063220@triton8.kn-bremen.de> To: ttsiodras@gmail.com X-Newsgroups: local.list.freebsd.emulation In-Reply-To: Organization: home Cc: freebsd-emulation@FreeBSD.org Subject: Re: VirtualBox can't boot a Linux residing in the same hard disk - operation not permitted X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2010 14:05:30 -0000 In article 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