Tuesday 5 April 2011

Extend boot volume on Windows Server 2000/2003

 
Before you begin, make sure that you do not have an active snapshot on the VM, extending a virtual disk with a snapshot will cause corrpution

Extend the boot volume of Windows Server 2003 Virtual Machine
To start, I have a Windows Server 2003 Virtual Machine that has a 5.3G disk allocated to it, I need to expand this disk to 10G.



Step 1: Power off the virtual machine that holds the boot volume that you want to extend.

Step 2: Make a backup copy of your virutal disk, this is optional but if you mess up don't call me unless you're willing to pay.

Step 3: From the service console, increase the size of the .dsk or .vmdk virtual disk file. This can also be accomplished through the Virtual Infrastructure Client if you are using VirtualCenter 2.x+.

[root@esx-test local]# ls -lah test.vmdk
-rw-------    1 root     root         5.4G Jul 18 13:57 test.vmdk
Extend the virtual disk with vmkfstools. The input to the -X switch is the size that you want the disk file to be not the size you want to extend the disk file by.
[root@esx-test local]# vmkfstools -X 10G test.vmdk
View the new size of test.vmdk
[root@esx-test local]# ls -lah test.vmdk
-rw-------    1 root     root          10G Jul 18 13:57 test.vmdk
Step 4: For this step you will need an additional Virtual Machine running Windows Server 2003. Power off the second Virtual Machine, and add the disk from the first Virtual Machine to it through the mui. Power up the second Virtual Machine and verify that the imported disk has unallocated space on it.



From the run menu type "diskpart.exe" to enter the command line utility to resize disk partitions in Windows Server 2003.



The command list volume will show you all the available volumes. Select your volume as shown below. select volume 1 corresponds to the "D" volume that I want to exntend. Finally extend the volume with the extend command.



If all goes well, the partition will be immediately exnteded under the Disk Management snap in.



Step 5: Shut down the second Virtual Machine and remove the disk from the second Virtual Machine. Power on the first Virtual Machine and check out your new space.





VirtualBOX setup after upgrading Kernel

>>>  - Run "sudo /etc/rc.d/vboxdrv setup", every time your kernel is upgraded,
>>>    to compile virtualbox driver modules for a new kernel version.
>>>  - Add your users to the vboxusers group:
>>>      gpasswd -a USERNAME vboxusers
>>>  - Customize your "/etc/conf.d/vboxdrv"; usually, defaults are OK.
>>>  - Add "vboxdrv" to DAEMONS array in your "/etc/rc.conf", if needed.
>>>  - If USB does not work for you out-of-the-box, add the following line
>>>    to your "/etc/fstab":
none /proc/bus/usb usbfs auto,busgid=108,busmode=0775,devgid=108,devmode=0664 0 0
Optional dependencies for virtualbox-sun
    alsa-lib: for ALSA support
    dkms: for building and loading vboxhost modules
    libgl: for shared OpenGL support
    libxt: for shared clipboard support
    mesa: for OpenGL support
    pulseaudio: for PulseAudio support
    python2: for VirtualBox SDK
    qt: for Oracle VirtualBox QT4 GUI on X-Window System
    sdl: for Oracle VBoxSDL and VirtualBox GUI on console
    vfuse: for mounting VBox (VDI/VMDK/VHD) disk images