Skip to end of metadata
Go to start of metadata

Let's say you setup a Windows 7 virtual machine, then by the time you've installed all the software on it, you're running low on disk space inside the virtual machine. ZFS makes it easy to increase the size of disk allocated to the Windows vm.

Caution: this action might cause Windows to require activation again.

  1. Shut down the virtual machine from within the Windows guest
  2. Find the name of the zvol that is being used as the root disk
    [root@00-19-99-b6-fa-12 ~]# zfs list
    NAME                                               USED  AVAIL  REFER  MOUNTPOINT
    zones                                             97.1G   131G   483K  /zones
    zones/1b29b2e7-8741-4bc6-9465-bb0094bb905c        3.90G  6.10G  3.90G  /zones/1b29b2e7-8741-4bc6-9465-bb0094bb905c
    zones/1b29b2e7-8741-4bc6-9465-bb0094bb905c-disk0  4.08G   131G  4.08G  -
    zones/1b29b2e7-8741-4bc6-9465-bb0094bb905c/cores    31K  4.25G    31K  /zones/1b29b2e7-8741-4bc6-9465-bb0094bb905c/cores
    zones/708c73e3-48f2-4da5-a0a6-e161215a4215        2.97G  7.03G  2.97G  /zones/708c73e3-48f2-4da5-a0a6-e161215a4215
    zones/708c73e3-48f2-4da5-a0a6-e161215a4215-disk0  22.7G   131G  22.7G  -
    zones/708c73e3-48f2-4da5-a0a6-e161215a4215/cores    31K  7.03G    31K  /zones/708c73e3-48f2-4da5-a0a6-e161215a4215/cores
    zones/8aedbf84-81e7-49c5-9127-a3b0850e8df9        6.83G  3.17G  6.45G  /zones/8aedbf84-81e7-49c5-9127-a3b0850e8df9
    zones/8aedbf84-81e7-49c5-9127-a3b0850e8df9-disk0  14.4G   131G  14.4G  -
    zones/8aedbf84-81e7-49c5-9127-a3b0850e8df9/cores   394M  3.17G   394M  /zones/8aedbf84-81e7-49c5-9127-a3b0850e8df9/cores
    zones/config                                        57K   131G    57K  legacy
    zones/cores                                         31K  10.0G    31K  /zones/global/cores
    zones/dump                                        4.00G   131G  4.00G  -
    zones/opt                                         25.9G   131G  25.9G  legacy
    zones/swap                                        12.4G   143G   173M  -
    zones/usbkey                                       127K   131G   127K  legacy
    zones/var                                         3.05M   131G  3.05M  legacy
    [root@00-19-99-b6-fa-12 ~]#

    This probably looks like *-disk0, so in this case it might be 'zones/708c73e3-48f2-4da5-a0a6-e161215a4215-disk0'.

  3. Check the current size with 'zfs get volsize'
    [root@00-19-99-b6-fa-12 ~]# zfs get volsize zones/708c73e3-48f2-4da5-a0a6-e161215a4215-disk0
    NAME                                              PROPERTY  VALUE    SOURCE
    zones/708c73e3-48f2-4da5-a0a6-e161215a4215-disk0  volsize   60G      local
    [root@00-19-99-b6-fa-12 ~]#

    In this case we can see that the disk is setup with a volume size of 60 gigabytes, which Windows takes as the size of the disk.

  4. Set the volsize to some larger value (in this case 65 gigabytes):
    [root@00-19-99-b6-fa-12 ~]# zfs set volsize=65g zones/708c73e3-48f2-4da5-a0a6-e161215a4215-disk0
    [root@00-19-99-b6-fa-12 ~]#
  1. Start the virtual machine using vmadm
    [root@00-19-99-b6-fa-12 ~]# vmadm start 708c73e3-48f2-4da5-a0a6-e161215a4215
    Successfully started 708c73e3-48f2-4da5-a0a6-e161215a4215
    [root@00-19-99-b6-fa-12 ~]#
  2. Connect to the virtual machine using either vnc or rdp (if you have already configured Windows for remote access).
  3. Login to the Windows guest using an account that has administrative privileges.
  4. Find the "Computer" icon in the start menu, right-click on it, and select Manage
  5. In the left-hand panel, click on Disk Management. In the lower right panel, you should see a partition table for "Disk0", showing your additional space as "Unallocated".
  6. Right-click on the "C:" volume (either in the upper or lower panel) and select Extend Volume.
  7. The 'Extend Volume' wizard will appear. Click Next.
  8. The default action is to add all the new space to your 'C:' partition. This is likely what you want, so click Next, and then click Finish.
  9. Close the 'Computer Management' window by clicking on the 'x'.

You should now see that your hard drive has expanded.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Dec 06, 2012


    As we see, the precondition of this chapter is a already created win 7 VM.

    For a new comer of SmartOS, I did fail to create a Win7 kvm boot from iso.

    Is there any guide for windows? Thank you!