Below are step by step instructions on setting up Virtualbox on Solaris10 and using zfs to clone.
Setup:
Solaris 10u8b5 installed on machine with 4 gig RAM and duo core processor.
Downloaded Latest Virtualbox from here:
http://www.virtualbox.org/wiki/Downloads
to /opt
Step 1: Install Virtualbox.
- cd /opt
- tar -xvf VirtualBox-3.0.4-50684-SunOS.tar
- pkgadd -d VirtualBoxKern-3.0.4-SunOS-r50684.pkg
- pkgadd -d VirtualBox-3.0.4-SunOS-r50684.pkg
Step 2: Setup zfs filesystem. This machine only has one hard drive so we make a zfs filesystem under UFS.
- cd /export/home
- mkfile 30000m vpool
Create SWAP space under ZFS: (Use roughly double the physical RAM)
- zfs create -V 10gb vpool/swap
Create the ZFS vpool
- zpool -f create vpool /export/home/vpool
Create an area to put the GOLDEN image:
- zfs create -V 15g vpool/GOLDEN_IMAGE/
Step 3: Get a GOLDEN image from net10-bambi.
- cd vpool/GOLDEN_IMAGE/
#ftp <golden image repository>
usual password.
- cd /export/vm_images/GOLDEN_images
- bin
- get Windows7_x86_b7229_vb_GOLDEN.vdi.tar.gz
- bye
- gunzip Windows7_x86_b7229_vb_GOLDEN.vdi.tar.gz
- tar -xvf Windows7_x86_b7229_vb_GOLDEN.vdi.tar
(Ideally at this point you should create a VM and point to the GOLDEN
image, start the VM and update the GOLDEN with any patches/updates etc
you need. Then stop the VM.)
Step 4: Cloning.
Ok we have the GOLDEN image now we can clone.
First we snapshot the GOLDEN image:
- zfs snapshot vpool/GOLDEN_IMAGE@golden
Then we create an area for TEST_IMAGE
- zfs create vpool/TEST_IMAGE
And then we clone:
- zfs clone vpool/GOLDEN_IMAGE@golden vpool/TEST_IMAGE/disk_image1
- zfs clone vpool/GOLDEN_IMAGE@golden vpool/TEST_IMAGE/disk_image2
- zfs clone vpool/GOLDEN_IMAGE@golden vpool/TEST_IMAGE/disk_image3
Change the uuid of each disk:
VBoxManage internalcommands setvdiuuid /vpool/TEST_IMAGE/disk_image1/Windows7_x86_b7229_vb_GOLDEN.vdi
VBoxManage internalcommands setvdiuuid /vpool/TEST_IMAGE/disk_image2/Windows7_x86_b7229_vb_GOLDEN.vdi
VBoxManage internalcommands setvdiuuid /vpool/TEST_IMAGE/disk_image3/Windows7_x86_b7229_vb_GOLDEN.vdi
Each of these disk_images is very small and only grows as the VM is used.
Step 5: Create VM.
This has been covered in previous emails/blogs so I wont cover it again.
Basically just create your VM's, select "existing disk" and point it
to one of the disk_images in Step 4.