Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Jul 2010 18:01:51 +0300
From:      Kyryll A Mirnenko aka Mirya <mirya@zoc.com.ua>
To:        freebsd-emulation@freebsd.org
Subject:   Re: Mounting VirtualBox vdi files
Message-ID:  <201007061801.52752.mirya@zoc.com.ua>

next in thread | raw e-mail | index | archive | help
If you're creating the VM from scratch, you may use raw file-backed disk image 
along with VMDK format wrapper. You may create a sparse file

# truncate -s 2G img

or a preallocated one

# dd if=/dev/zero of=img bs=1m count=2048

, then create a character device for it

# mdconfig -a -t vnode -f img -u 4

, and wrap it with a vmdk container

# VBoxManage internalcommands createrawvmdk -filename 
Img.vmdk -rawdisk /dev/md4

After that you may use Img.vmdk as any other disk image in VirtualBox, and 
mount /dev/md4* from the host machine. Just remember you'll need to run 
mdconfig after reboot, the md* devices are not preserved magically, and 
umount /dev/md4* before starting VBox.
That's how i work with -current FreeBSD snapshots - they're cross-compiled and 
cross-installed in the host system (which is faster), then run in the VBox.
-- 
Regards, Mirya
ICQ #313898202



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007061801.52752.mirya>