From Wiki-UX.info

VirtualBox
Jump to: navigation, search

VirtualBox

Setup VBOX Environment

1. Create VirtualBox user.

# useradd -g staff -d /export/home/vbox -m -c "VirtualBox" vbox

2. Set VirtualBox user password.

# passwd vbox

Set-up

1. Create zfs volume.

# zfs create -V 2G export/vbox_debian1

2. Set permission of the zfs volume "dsfs" to vbox user.

# chown vbox:staff /dev/zvol/dsk/export/vbox_debian1
# chown vbox:staff /dev/zvol/rdsk/export/vbox_debian1

3. Create VMDKs directory to contain the raw disk access files.

# mkdir /export/home/vbox/VMDKs

4. Create the VMDK file with raw disk access using the vbox user account (not root).

# cd /opt/VirtualBox
# ./VBoxManage \
internalcommands createrawvmdk \
-filename /export/home/vbox/VMDKs/debian1.vmdk \
-rawdisk /dev/zvol/rdsk/export/vbox_debian1

Example:

$ cd /opt/VirtualBox
$ ./VBoxManage \
internalcommands createrawvmdk \
-filename /export/home/vbox/VMDKs/debian1.vmdk \
-rawdisk /dev/zvol/rdsk/export/vbox_debian1> > >
VirtualBox Command Line Management Interface Version 1.6.4
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

5. Check VMDK file

$ cat /export/home/vbox/VMDKs/debian1.vmdk
# Disk DescriptorFile
version=1
CID=014df0ce
parentCID=ffffffff
createType="fullDevice"
 
# Extent description
RW 4194304 FLAT "/dev/zvol/rdsk/export/vbox_debian1"
 
# The disk Data Base
#DDB
 
ddb.virtualHWVersion = "4"
ddb.adapterType="ide"
ddb.geometry.cylinders="4161"
ddb.geometry.heads="16"
ddb.geometry.sectors="63"
ddb.uuid.image="07784456-1d8e-4bfc-a199-72e8b86bf161"
ddb.uuid.parent="00000000-0000-0000-0000-000000000000"
ddb.uuid.modification="00000000-0000-0000-0000-000000000000"
ddb.uuid.parentmodification="00000000-0000-0000-0000-000000000000"

6. Register VMDK file for disk guest usage.

$ $ ./VBoxManage registerimage disk /export/home/vbox/VMDKs/debian1.vmdk
VirtualBox Command Line Management Interface Version 1.6.4
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

7. Check register VMDK files.

./VBoxManage list hdds
VirtualBox Command Line Management Interface Version 1.6.4
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.
 
UUID:         07784456-1d8e-4bfc-a199-72e8b86bf161
Storage type: unknown
Path:         /export/home/vbox/VMDKs/debian1.vmdk
Accessible:   yes

The disk will be available for guest configuration

This page was last modified on 6 September 2008, at 09:03. This page has been accessed 1,832 times.