From owner-freebsd-emulation@FreeBSD.ORG Wed Nov 23 08:47:38 2011 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 9C8A0106566B for ; Wed, 23 Nov 2011 08:47:38 +0000 (UTC) (envelope-from h.schmalzbauer@omnilan.de) Received: from host.omnilan.net (s1.omnilan.net [62.245.232.135]) by mx1.freebsd.org (Postfix) with ESMTP id 214BF8FC13 for ; Wed, 23 Nov 2011 08:47:37 +0000 (UTC) Received: from titan.wdn.omnilan.net (titan.lo4.wdn.omnilan.net [172.21.1.150]) (authenticated bits=0) by host.omnilan.net (8.13.8/8.13.8) with ESMTP id pAN8YW1J012983 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 Nov 2011 09:34:32 +0100 (CET) (envelope-from h.schmalzbauer@omnilan.de) X-Authentication-Warning: smtp.dmz.omnisec.de: Host titan.lo4.wdn.omnilan.net [172.21.1.150] claimed to be titan.wdn.omnilan.net Message-ID: <4ECCB00C.2090308@omnilan.de> Date: Wed, 23 Nov 2011 09:34:20 +0100 From: Harald Schmalzbauer Organization: OmniLAN User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; de-DE; rv:1.9.2.8) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: freebsd-emulation@freebsd.org References: CALBk6yJrHniVi8RoTGwLtqWF1nL1r8JZLKbS1mcLMw1DnxeofQ@mail.gmail.com X-Enigmail-Version: 1.1.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig71249FD1A4A9263D413CB661" Subject: mount vdi on host 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: Wed, 23 Nov 2011 08:47:38 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig71249FD1A4A9263D413CB661 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Hello, I'm not subscribed, so I'm not sure this answer will make it onto the list... I found your thread "mount vdi on host" and was told about 'gnop' and 'VBoxManage internalcommands dumphdinfo'. That was the key to success, so I'd like to answer the last question of the thread, when mounting didn't work: "Any more idea" ... Yes You forgot that md0.nop is the disk, not the filesystem. You probably have partitions on it, so when it comes to 'mount' you have to use /dev/md0nops1a for example (verified with md3.nops1 and mount_msdosfs). Hope this helps and thanks for the post! -Harry Original thread, found via search engine at http://lists.freebsd.org/pipermail/freebsd-emulation/2011-July/008995.htm= l --- On Mon, 7/25/11, Brandon Gooch wrote= : From: Brandon Gooch Subject: Re: mount vdi To: "Andrey V. Elsukov" Cc: "Joe Sciulli" , freebsd-emulation at freebsd.org, nox at jelal.kn-bremen.de Date: Monday, July 25, 2011, 4:31 PM 2011/7/25 Andrey V. Elsukov : > On 25.07.2011 10:18, Joe Sciulli wrote: >> Is it possible to mount virtualbox vdi file on the FreeBSD host? This appears to be doable on >> windows and linux hosts, which basically is done in two steps: 1. find offset in the image. 2. >> mount the image with that offset. >> >> I'm trying to do the same thing on FreeBSD, and found the undocumented and deprecated command >> still works: >> >> VBoxManage internalcommands dumphdinfo freebsd_home.vdi >> >> I got the following for the virtual disk image holding the /home (no root hence no MBR) disk for >> a FreeBSD guest: >> >> Header: offBlocks=3D4096 offData=3D28672 >> >> Then attempt to mount it: >> >> mdconfig -a -t vnode -f /tmp/freebsd_home_56.vdi -u 0 mount /dev/md0 /tmp/aaa/ mount -t cd9660 /dev/md0 /tmp/aaa/ >> >> unfortunately both the above two mount commands failed with "Invalid argument". I tried >> skip=3D28672 to no avail as well. Anything did I do wrong? > > I have not any Vbox images with fixed size, but i tried this: > # mdconfig -f 10G_GPT_UFS.vdi > # gnop create -v -o 41472 /dev/md0 > > where 41472 is offData value. After that md0.nop was tasted and reports about invalid GPT. > So, i think if your image is fixed size disk yout can try this method and mount UFS (not cd9660). > > -- > WBR, Andrey V. Elsukov There was a CFT sent out a while back about a fuse module for mounting vdi images: http://lists.freebsd.org/pipermail/freebsd-emulation/2010-September/00796= 4.html Not sure about the state of this now though... -Brandon Thanks for your replies. I tried mdconfig -f freebsd_home.vdi gnop create -v -o 28672 /dev/md0 Indeed /dev/md0.nop etc were created. But mounting with the following commands still yielded the dreaded "Invalid argument" error: mount /dev/md0.nop /tmp/aaa/ mount -t ufs /dev/md0.nop /tmp/aaa/ One thing interesting is, in the gnop command, if I change 28672 to anything else such as 28671 or 28673 or whatever, that gnop command would fail with: gnop: Invalid offset for provider md0. so that suggests the offset is correct. It's just that how to mount it. The vdi is a variable size disk in virtualbox. But I had shutdown virtualbox and copied it to another file before mdconfig on it. I looked closer at virtualbox-ose-fuse.shar Brandon linked, it appears to be hardcoded to work with VirtualBox-3.2.8-OSE, while I only have VBoxGuestAdditions_4.0.12 as in the ports tree. Any more idea, thanks. --------------enig71249FD1A4A9263D413CB661 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk7MsBgACgkQLDqVQ9VXb8i/ZQCfSoZA1QR2J1iuKJ4TbIxzmZ3k d60AoLee9/eYuFzyuB1mWiBGReCZjENZ =QhMO -----END PGP SIGNATURE----- --------------enig71249FD1A4A9263D413CB661--