## VMLite VBoot 2.0 Instructions

updated on Nov-17-11

Copyright © 2011, VMLite Corporation

### Contents

1. Download and Extract
2. Install VBoot Loader

- Chainloading from Windows Boot Manager
- Installing VBoot Loader directly to a hard disk or external USB drive
- Chainloading from other boot loaders

3. Install Windows XP to a virtual disk file
4. Install Windows 7/2008 R2/Windows 8 32- and 64-bit to a virtual disk file
5. Install Vista/2008 32- and 64-bit to a virtual disk file
6. Install Vista, 2008, Windows 7, Windows 8, 2008 32- and 64-bit to a virtual disk file from a physical cdrom
7. Install Vista, Windows 7, Windows 8 and 2008 32- and 64-bit to a virtual disk file using a simple command line
8. Converting virtual disk files to become bootable via VBoot
9. Virtual disk paths
10. Converting virtual disk files between different formats
11. Differencing disk files and snapshots
12. Offline Virtual Disk Access
13. Merge, Compact and Expand virtual disk files
14. Updating VBoot
15. VBoot Command Options
16. Troubleshooting

### 1. Download and Extract

After download, unzip the package to \vboot folder on your boot partition. It must be inside \vboot folder. Usually c:\vboot, or d:\vboot folder. The boot partition is the partition that contains the ntldr file for Windows XP, or the bootmgr file for Vista, Windows 7 and 8. For Vista and Windows 7 and 8, vboot directory should be installed in the same partition as the \Boot directory that installed by Windows. Boot partition is not necessary same as your Windows partition.

After extraction, the directory structure should look like this:

C:\.
| vbootldr
| vbootldr.mbr
|----- vboot
|
|-------- fonts
|
|-------- grub
|
|-------- tools
...........

The tools directory contains tools that are not needed to boot the virtual disks, so you can move this tools directory to somewhere else.

### 2. Install VBoot Loader

After you extracted the vboot zip file, you need to install it in order to boot from VBoot. There are two ways, the first and safest way is to chainload from your existing Windows boot manager, which keeps all of your Windows boot entries, and VBoot appears as an extra boot entry from the Windows boot manager. The second way is to install VBoot directly to the hard disk or to a USB drive, so VBoot Loader will be the first program to run after your PC powers on, which bypasses Windows Boot Manager, so you don't need Windows Boot Manager at all.

#### 2.1 Chainloading from Windows Boot Manager

If your current host is Windows, then you already have Windows boot manager, which is the first software program to run after your PC powers on. We need to add a boot entry to Windows boot manager for VBoot, so you can click this entry and go to VBoot boot menu.

#### 2.1.1 Automatic Setup by running VBootEdit.exe

It's highly recommend that you use this method to setup VBoot on Windows, since it's extremely simple and automates everything. You simply run the following command:

vbootedit.exe install on 32-bit Windows

or

vbootedit64.exe install on 64-bit Windows.

This utility will install VBoot Loader, and configure the Windows boot loader to contain an entry for VBoot.

After the above command is successfully run, you reboot the computer, and you should see a "VBoot" entry as the last one.

#### 2.1.2 Manual Setup

If somehow the automatic setup doesn't work, then you can perform the following manual steps:

2.1.2.1 Copy VBoot Loader Files

The VBoot loader is based on GNU GRUB2, and its files are located in vboot sub directory.

- vbootldr.mbr and vbootldr are the two critical boot loader files that must be copied to the root directory of a drive, typical C:\.
- The fonts directory contains font files to be used by our boot loader.
- The grub directory contains grub2 modules, and the very import grub.cfg configuration file.

For example, if you want to copy the files to C:\, you need to copy the vboot directory to c:\, so you will have c:\vboot directory. Then you must copy vbootldr.mbr and vbootldr to c:\.

The following commands can be used to copy the files. Make sure to run from the extracted dir. Obviously, if you have already extracted the vboot zip file to c:\vboot directory, then you don't need to copy most of the files except vbootldr and vbootldr.mbr, which must be present at the root folder of the boot partition.

    md c:\vboot
    xcopy /s vboot c:\vboot
    copy vboot\vbootldr c:\
    copy vboot\vbootldr.mbr c:\

2.1.2.2 Configure Windows Boot Loader

Once VBoot Loader files are copied, you need to configure Windows boot manager to have a VBoot entry.

2.1.2.2.1 Windows XP

You need to append the vbootldr.mbr entry to the [operating systems] section. The following is sample boot.ini file with VBoot entry added at the very last. Shown in red is what you need to add to boot.ini. Change C: to whatever drive you have copied VBoot Loader files.

    [boot loader]
    timeout=30
    default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
    [operating systems]
    multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect
    C:\vbootldr.mbr="VBoot"

2.2.2.2 Windows Vista/2008/7

Windows Vista and above use a different mechanism other than boot.init to boot, and you need to run bcdedit.exe to make changes to the boot manager. The following are the commands to run if you have copied VBoot Loader to drive C:. You must rum these commands as Administrator. Go to Windows Start menu > All Programs > Accessories, then right click on "Command Prompt", then select "Run As Administrator". Once command prompt window is open, you can enter these commands.

    bcdedit /create {D3DCE997-7447-41FC-9740-A8D20EE3BF55} /d "VBoot" /application BOOTSECTOR
    bcdedit /set {D3DCE997-7447-41FC-9740-A8D20EE3BF55} device partition=C:
    bcdedit /set {D3DCE997-7447-41FC-9740-A8D20EE3BF55} path \vbootldr.mbr
    bcdedit /displayorder {D3DCE997-7447-41FC-9740-A8D20EE3BF55} /addlast
    bcdedit /timeout 30

#### 2.2 Installing VBoot Loader directly to a hard disk or external USB drive

VBoot Loader is an independent piece of software, it does not depend on Windows boot manager at all, VBoot itself can boot your virtual disk files or cdrom ISO files. However, in this case, you need to install VBoot Loader directly to the first few sectors of the hard disk, or external USB drive. This way, VBoot Loader will be the first program to run after your PC powers on. From here, you can also chainload to your Windows boot manager, please refer to GRUB2 user manual for more info.

Note that once you installed VBoot Loader to a hard disk, your original Windows boot manager will no longer start up, so be very careful about installing VBoot to your real hard disk, unless you are absolutely clear in what you are doing. Otherwise, chainloading from Windows boot manager is the safest way to go.

To install VBoot Loader to a hard disk or external USB drive, you run this command:

    vbootedit.exe install /drive C: /mbr

Obviously, you need to replace the drive letter with your hard disk or USB drive's drive letter. Once installed, when you power on your PC, you will first see VBoot boot menu appears. If for some reason, it does not show up, you can hold down Shift key while your PC is booting up.

#### 2.3 Chainloading from other boot loaders

It sIt should be very easy to chainload from other boot loaders.

Chainloading from GRUB2:

    menuentry "VBOOT" {
        set root='(hd0,1)'
        linux16 /vbootldr
    }

### 3. Install Windows XP to a virtual disk file

Once you have VBoot Loader installed, you can now proceed to install a fresh operating system to a virtual disk file.

(1) On your host disk, create a virtual disk file. VBoot support VHD/VMDK/VDI formats.

For example, you can use this command to create 40 G dynamic VHD:

c:\vboot\tools\x86\vbootctl.exe createhd c:\winxp.vhd /size 40

You can use /format option to specify other virtual disk formats.

(2) Edit and configure grub.cfg file, a sample grub.cfg should exist in \vboot\grub folder. You need to follow these 3 steps to install Windows XP/2003 to the virtual disk, then boot from it. Note that you must adjust all of the paths according to your own files.

First step:

    menuentry "XP Install Step 1" {
       vboot harddisk=(hd0,1)/winxp.vhd floppy=(hd0,1)/vboot/vboot.img cdrom=(hd0,1)/winxp-sp2.iso boot=cdrom
    }

If you don't want to manually edit grub.cfg file, or have trouble getting the correct paths, you can also run this command to add the entry automatically. Note that you have to use Windows paths as input to vbootedit program.

    vbootedit.exe create title="XP Install Step 1" harddisk=c:\winxp.vhd floppy=c:\vboot\vboot.img cdrom=c:\winxp-sp2.iso boot=cdrom

After you boot to this entry, you will see the normal Windows XP setup screens. At one step, you need to select a disk to install XP, make sure you select the virtual disk, usually the last disk labeled as VBOOTMP. After first reboot, you select this boot entry:

    menuentry "XP Install Step 2" {
        vboot harddisk=(hd0,1)/winxp.vhd cdrom=(hd0,1)/winxp-sp2.iso boot=harddisk
    }

If you don't want to manually edit grub.cfg file, or have trouble getting the correct paths, you can also run this command to add the entry automatically. Note that you have to use Windows paths as input to vbootedit program.

    vbootedit.exe create title="XP Install Step 2" harddisk=c:\winxp.vhd cdrom=c:\winxp-sp2.iso boot=harddisk

After another reboot, your virtual disk is ready to go, and finally, you can boot to XP virtual disk using this entry:

    menuentry "XP VHD" {
        vboot harddisk=(hd0,1)/winxp.vhd
    }

If you don't want to manually edit grub.cfg file, or have trouble getting the correct paths, you can also run this command to add the entry automatically. Note that you have to use Windows paths as input to vbootedit program.

    vbootedit.exe create title="XP VHD" harddisk=c:\winxp.vhd

For Windows 2003, you do the following with the same floppy image.

    menuentry "Windows 2003" {
        vboot harddisk=(hd0,1)/win2k3.vhd
    }
    vbootedit.exe create title="Windows 2003" harddisk=c:\win2k3.vhd

    menuentry "Windows 2003 Install Step 2" {
        vboot harddisk=(hd0,1)/win2k3.vhd cdrom=(hd0,1)/win2k3.iso boot=harddisk
    }
    vbootedit.exe create title="Windows 2003 Install Step 2" harddisk=c:\win2k3.vhd cdrom=c:\win2k3.iso boot=harddisk

    menuentry "Windows 2003 Install Step 1" {
       vboot harddisk=(hd0,1)/win2k3.vhd floppy=(hd0,1)/vboot/vboot.img cdrom=(hd0,1)/win2k3.iso boot=cdrom
    }
    vbootedit.exe create title="Windows 2003 Install Step 1" harddisk=c:\win2k3.vhd floppy=c:\vboot\vboot.img cdrom=c:\win2k3.iso boot=cdrom

For Windows XP/2003 64-bit, you do the following with a different floppy image, vboot-x64.img. You can also use the same vboot.img as the 32-bit, but you will need to press F6 and select 64-bit driver. vboot.img and vboot-x64.img are same except for the default driver, so you don't need to press F6.

    menuentry "Windows 2003" {
       vboot harddisk=(hd0,1)/win2k3.vhd
    }
    vbootedit.exe create title="Windows 2003" harddisk=c:\win2k3.vhd

    menuentry "Windows 2003 Install Step 2" {
       vboot harddisk=(hd0,1)/win2k3.vhd cdrom=(hd0,1)/win2k3-64.iso boot=harddisk
    }
    vbootedit.exe create title="Windows 2003 Install Step 2" harddisk=c:\win2k3.vhd cdrom=c:\win2k3-64.iso boot=harddisk

    menuentry "Windows 2003 Install Step 1" {
       vboot harddisk=(hd0,1)/win2k3.vhd floppy=(hd0,1)/vboot/vboot-x64.img cdrom=(hd0,1)/win2k3-64.iso boot=cdrom
    }
    vbootedit.exe create title="Windows 2003 Install Step 1" harddisk=c:\win2k3.vhd floppy=c:\vboot\vboot-x64.img cdrom=c:\win2k3-64.iso boot=cdrom

### 4. Install Windows 7/2008 R2/Windows 8 32- and 64-bit to a virtual disk file

Once you have VBoot Loader installed, you can now proceed to install a fresh operating system to a virtual disk file.

1) On your host disk, create a virtual disk file. VBoot support VHD/VMDK/VDI formats.

For example, you can use this command to create 40 G dynamic VHD:

c:\vboot\tools\x86\vbootctl.exe createhd c:\win7.vhd /size 40

You can use /format option to specify other virtual disk formats.

(2) Edit and configure grub.cfg file, a sample grub.cfg should exist in \vboot\grub folder. You need to follow these two steps to install Windows 7/8 to the virtual disk, then boot from it. Note that you must adjust all of the paths according to your own files.

First step:

    menuentry "Windows 7 Install" {
       vboot harddisk=(hd0,1)/win7.vhd cdrom=(hd0,1)/win7.iso boot=cdrom
    }
    vbootedit.exe create title="Windows 7 Install" harddisk=c:\win7.vhd cdrom=c:\win7.iso boot=cdrom

After you boot to this entry, you will see the normal Windows 7 setup screens as booted from a physical cdrom.

Once you see the Install button, make sure to press Shift F10 key to launch the command window. You need to run the following command to load the VBoot virtual disk drivers:

    c:\vboot\tools\x86\vbootctl setup    (for 32-bit)
    c:\vboot\tools\amd64\vbootctl setup  (for 64-bit)

After this, you proceed the installation as usual. At one step, you need to select a disk to install Windows 7 or Windows 8, make sure you select the virtual disk, usually the last disk.

After reboot, your virtual disk is ready to go, and finally, you can boot to Windows 7 or Windows 8 virtual disk using this entry:

    menuentry "Windows 7 VHD" {
        vboot harddisk=(hd0,1)/win7.vhd
    }
    vbootedit.exe create title="Windows 7 VHD" harddisk=c:\win7.vhd

### 5. Install Vista/2008 32- and 64-bit to a virtual disk file

Once you have VBoot Loader installed, you can now proceed to install a fresh operating system to a virtual disk file.

1) On your host disk, create a virtual disk file. VBoot support VHD/VMDK/VDI formats.

For example, you can use this command to create 40 G dynamic VHD:

c:\vboot\tools\x86\vbootctl.exe createhd c:\win7.vhd /size 40

You can use /format option to specify other virtual disk formats.

(2) Edit and configure grub.cfg file, a sample grub.cfg should exist in \vboot\grub folder. You need to follow these 2 steps to install Vista to the virtual disk, then boot from it. Note that you must adjust all of the paths according to your own files.

First step:

    menuentry "Vista Install" {
       vboot harddisk=(hd0,1)/vista.vhd cdrom=(hd0,1)/vista.iso boot=cdrom
    }
    vbootedit.exe create title="Vista Install" harddisk=c:\vista.vhd cdrom=c:\vista.iso boot=cdrom

After you boot to this entry, you will see the normal Vista setup screens as booted from a physical cdrom.

Once you see the Install button, you need to click it first, then you will be able to press Shift F10 key to launch the command window.

You need to run the following command to load the VBoot virtual disk drivers:

    c:\vboot\tools\x86\vbootctl setup    (for 32-bit)
    c:\vboot\tools\amd64\vbootctl setup  (for 64-bit)

After this, you proceed the installation as usual. At one step, you need to select a disk to install Vista, make sure you select the virtual disk, usually the last disk.

After reboot, your virtual disk is ready to go, and finally, you can boot to Vista virtual disk using this entry:

    menuentry "Vista VHD" {
    vboot harddisk=(hd0,1)/vista.vhd
    }
    vbootedit.exe create title="Vista VHD" harddisk=c:\vista.vhd

### 6. Install Vista, 2008, Windows 7, 2008, Windows 8 32- and 64-bit to a virtual disk file from a physical cdrom

First, boot your computer using the physical cdrom.

Once you see the Install button, on Vista/2008, you need to click it first, then you can press Shift F10 key to launch the command window. On Windows 7/2008R2, you can press Shift-F10 without clicking the Install button.

Once the command window appears, you need to run the following commands to create a virtual disk and the mount it:

    32-bit:
    c:\vboot\tools\x86\vbootctl.exe createhd c:\win7.vhd /size 40
    c:\vboot\tools\x86\vbootctl mount c:\win7.vhd /setup

    64-bit:
    c:\vboot\tools\amd64\vbootctl.exe createhd c:\win7.vhd /size 40
    c:\vboot\tools\amd64\vbootctl mount c:\win7.vhd /setup  (for 64-bit)

After this, you proceed the installation as usual. At one step, you need to select a disk to install Windows, make sure you select the virtual disk, usually the last disk.

After reboot, your virtual disk is ready to go, and finally, you can boot to the virtual disk using this entry:

    menuentry "Vista VHD" {
       vboot harddisk=(hd0,1)/vista.vhd
    }
    vbootedit.exe create title="Vista VHD" harddisk=c:\vista.vhd

### 7. Install Vista, Windows 7, Windows 8 and Windows 2008 to a virtual disk file using a simple command line

To make the installation experience really simple, we have created a command line to help you. You can simply run this command line using your Windows CD/DVD or .ISO file as input, by the end, you will have a bootable virtual disk file that you can add to VBoot Loader, and boot to it.

For example, you can run the following commands to create a 80G Windows 7 VMDK file, then add a boot entry to VBoot Loader.

    (1) vbootctl make c:\win7.vhd c:\en_windows_7_x86.iso /size 80
    (2) vbootedit.exe create title="Windows 7 VMDK Boot" harddisk=c:\win7.vhd

After reboot, you should see an entry named as "Windows 7 VMDK Boot", and you select it to boot to Windows 7 VMDK.

Note that this command does not work for Windows 2000, Windows XP and Windows 2003.

It's recommended to run this command on Windows Vista and above hosts. If you run this command on Windows XP, you will have trouble booting to the virtual disk file, and you need to run "bootsect.exe" utility to correct the NTFS boot sectors.

The full syntax is described as follows:

    D:\vboot\tools\x86>vbootctl.exe make

    SYNTAX:
      vbootctl make diskfile source [/imageIndex index] [/size size_in_G] [/format VDI|VHD|VMDK] [/fixed]

    OPTIONS:
      diskfile  Specify the path to the new virtual disk file to create.
                It can be a .vmdk, .vhd or .vdi file.

      source    Specify the source of Windows OS.
                It can be an .iso file, or cdrom drive, or a .wim file.

      /imageIndex index
                Specify the 1-based index that identifies the image within the WIM file.

      /size size_in_G
                Specify the virtual disk size in giga bytes, e.g., 1.5.
                Default size is 16G if you don't specify any size.

      /format   Specify virtual disk format: VDI, VHD or VMDK. Default is VHD format.

      /fixed    The virtual disk is fixed, all space will be allocated.

    EXAMPLES:
      vbootctl make c:\win7.vhd en_windows_7_x86.iso /size 80
      vbootctl make c:\win7.vhd E:\ /size 80
      vbootctl make c:\win7.vhd E:\sources\install.wim /size 80

### 8. Converting virtual disk files to become bootable via VBoot

If you already have a virtual disk file, such as Windows 7 or Windows 8 Native boot VHD file, you can run the following command to make it to become bootable using VBoot. This command will install the correct components to your existing virtual disk file.

For example, you can run the following command to prepare the vhd file so it can boot with VBoot.

    vbootctl prepare c:\my-windows7.vhd

### 9. Virtual disk paths

VBoot Loader is is the first software program that runs when your computer starts. It is responsible for loading and transferring control to the operating system kernel software. When VBoot first starts, Windows or Linux has not started yet, so you can't use Windows or Linux paths, such as c:\win7.vhd, or /boot/win7.vhd.

VBoot Loader is modified from the popular GRUB2 boot loader, in particular, VBoot Loader supports loading operating system from virtual disk files in various disk formats, including VHD, VMDK, VDI, ISO and raw images, and you can use the same format as GRUB2 for file paths.

There are three formats:

1. (hdx,y)/path/file.ext

x is the disk number starting from 0, and y is the partition number starting from 1, the rest is the absolute path in UNIX format.
For example, the path (hd0,1)/vboot/win7.vhd indicates the file win7.vhd is inside /vboot folder on hard disk 0 and partition 1.

2. (UUID=16-hex-bytes)/path/file.ext

   UUID is a 16 bytes hex digit id for the volume. For example, you can use (UUID=c6803bae803ba439)/vboot/win7.vhd to represent the same file as mentioned above format.

   Each volume usually has a unique id after it has been formated. If you perform a reformat on the volume, this id will change.

   To find the uuid for a volume on Windows, you can run this command:

       vbootedit uuid C:

   Inside VBoot Loader, you can enter this command to get the uuid for a volume:

       probe -u (hd0,1)

3. (LABEL=volume-label)/path/file.ext

The label format is similar to UUID format. You can find a volume's label by right click the properties dialog on Windows host.

For example, you can use (LABEL=OS)/vboot/win7.vhd to represent the same file as discussed in (1) and (2) above.

Most of the time, you can choose your favorite format. However, when error occurs, you may want to try the others. In particular, when you boot from a USB drive, the first format may give you problems, because at boot time your USB drive is (hd0), but after Windows boots up, it becomes (hd1), so in this case, you always need to use UUID or LABEL formats.

### 10. Converting virtual disk files between different formats

VBoot natively supports a variety of disk image formats that you can find from popular virtual machine software, including VHD, VMDK, VDI and Raw. If for some reason you want to convert from one format to the other, you can use the vbootctl program that ships with VBoot to convert virtual disk files between different formats.

For example, the following command converts VDI file to a VMDK file:

            vbootctl convertvd c:\win7.vdi c:\win7.vmdk

The full syntax of the command is listed below:

    SYNTAX:
      vbootctl converthd src_diskfile dst_diskfile [/srcfmt format] [/dstfmt format]

    OPTIONS:
      src_diskfile  Specify the path to the source virtual disk file.
                    It can be a .vdi, .vmdk, or .vhd file.

      dst_diskfile  Specify the path to the destination virtual disk file.
                    It can be a .vdi, .vmdk, or .vhd file.

      [/srcfmt format]
                    Specify the source format, "VDI", "VMDK" or "VHD".

      [/dstfmt format]
                    Specify the destionation format, "VDI", "VMDK" or "VHD".

    EXAMPLES:
      vbootctl comvertvd disk1.vmdk disk1.vdi

### 11. Differencing disk files and snapshots

VBoot fully supports differencing files and snapshots. You can use ';' separated file names to specify a child disk and its parent, or use nested menu entries to represent a snapshot, for example:

    method 1:
    menuentry "Vista VHD" {
        vboot harddisk="(hd0,1)/vista-s1.vhd;(hd0,1)/vista.vhd"
    }

    method 2:
    menuentry "Vista VHD" {
        vboot harddisk="(hd0,1)/vista.vhd"
        snapshotentry "Snapshot 1"
        {
            vboot harddisk="(hd0,1)/vista-s1.vhd"
        }
    }

When you use nested menu entries, the boot menu will display a tree like structure, as shown below:

The easiest way to create a snapshot is from the boot menu, you can simply press 's' key to take a snapshot, and press 'r' key to perform a recovery. You can also press 'i' key to boot as immutable session.

You can also create a snapshot manually, and you need to follow these two steps:

(1) to create a differencing file, you can use the following command:

    vbootctl creatediff c:\vista-s1.vhd c:\vista.vhd

(2) add a boot entry for the snapshot:

    vbootedit create title="Snapshot 1" harddisk=c:\vista-s1.vhd parent=1

parent=1 indicates the boot entry index for the parent entry, you can run "vbootedit enum" to display a list of boot entries along with their indexes.

### 12. Offline Virtual Disk Access

VBoot provides a command utility to mount virtual disk files. This way, you can access your files offline while the virtual disk file is not running.

Be very cautious if your disk has snapshot child disks. When you mount a parent disk, it might get modified, and cause the child disks not consistent with the parent, this will most likely result in data loss because all of its child disk become invalid. If your disk file has a snapshot, make sure to mount the deepest child disk, or mount parent disk files as readonly to prevent modifications.

You can use the following command to mount a disk file in VHD, VMDK, VDI format, cdrom ISO file, Microsoft WIM file and floppy images.

For differencing disk files, you can use ';' separated file paths to specify the child and parent disk files.

    SYNTAX:
      vbootctl mount diskfile [/parentdir parent_dir] [/imageIndex index] [/mountdir mount_dir] [/setup] [/r] [/raw]

    OPTIONS:
      diskfile  Specify the path to the virtual disk file.
                It can be a .vmdk, .vhd, .vdi or .wim file.
                For differencing disk file, you can use ';' separated paths to specify all
                child disks and base image file.

      /parentdir parent_dir
                Specify the directory to search for parent disk files when mounting a diferencing
                disk file.

      /imageIndex index
                Specify the 1-based index that identifies the image within the .wim file.

      /mountdir mount_dir
                Specify the full path of an existing directory to which the .wim file
                will be mounted. This is only used for .wim file.

      /setup        The virtual disk is mounted to setup Windows.
                You must use this option to install Vista, Windows 7 and later OSes.

      /r        The virtual disk is mounted as readonly.

      /raw      Attach the virtual disk without going to diskmgmt service.
                This option is useful for newly created virtual disk files.

    EXAMPLES:
      vbootctl mount c:\xp.vhd
      vbootctl mount "c:\xp-s1.vhd;c:\xp.vhd"
      vbootctl mount c:\xp-s1.vhd /parentdir c:\my_base_images
      vbootctl mount D:\sources\install.wim /imageIndex 3 /mountdir c:\mnt

To dismount the mounted virtual disk, you can use this command:

     SYNTAX:
      vbootctl umount [x: | target | mount_dir] [/commit]

    OPTIONS:
      x:        Specify the drive letter, e.g., Z:, that the virtual disk was mounted.

      target    Specify an integer number for the target id of the disk to dismount.

      mount_dir
                Specify the full path of the directory to which the .wim file was mounted.
                This option is only used to dismount a .wim file.

      /commit   If specified, changes (if any) to the .wim file must be committed before unmounting
                the .wim file. This flag has no effect if the .wim file was mounted not to enable edits.

    EXAMPLES:
       vbootctl umount z:
       vbootctl umount 0
       vbootctl umount c:\mnt
       vbootctl umount c:\mnt /commit

### 13. Merge, Compact and Expand virtual disk files

VBoot command utility supports merging child disks to it parents, compacting and expanding virtual disk files. These are examples:

        vbootctl merge  c:\xp-s1.vhd c:\xp.vhd
        vbootctl compact c:\xp.vhd
        vbootctl expand c:\xp.vhd /newsize 40  (size in GB)

### 14. Updating VBoot

If you already have a working virtual disk file and want to update to the latest VBoot drivers, you only need to update a few driver files (vbootmp.sys, vbootfs.sys and vbootbus.sys for xp and above, or vbootdsk.sys for windows 2000).

There are two ways of doing this, automatic or by hand.

#### Update by command

The first and recommended way is to use "vbootctl update" command, as described below:

    vbootctl update current
    vbootctl update virtual_disk_file

The first is used to update the current running Windows instance if it's booted from a virtual disk file, whereas the 2nd is used to update a virtual disk file that is offline.

#### Update by hand

The second way is to do it manually. If your computer is currently booted using the virtual disk file that you want to update, you can simply copy the drivers to overwrite the current version, for example,

    copy D:\vboot\tools\x86\drivers\vbootmp\vbootmp.sys c:\windows\system32\drivers

If your virtual disk file is not current running, you will have to mount it first, then copy the driver file, for example,

    D:\vboot\tools\x86\vbootctl mount c:\path\your.vhd
    copy D:\vboot\tools\x86\drivers\vbootmp\vbootmp.sys Z:\windows\system32\drivers
    copy D:\vboot\tools\x86\drivers\vbootfs\vbootfs.sys Z:\windows\system32\drivers
    copy D:\vboot\tools\x86\drivers\vbootbus\vbootbus.sys Z:\windows\system32\drivers (vbootbus driver is used on vista and later, no need to copy it for xp/2003)
    D:\vboot\tools\x86\vbootctl umount Z:

On Windows Vista, Windows 7 and Windows 2008, you may get a message complaining device driver not installed successfully after updating, you can get rid of this message by running the following command after booting to the virtual disk file.

    D:\vboot\tools\x86\vbootctl dp_add default

The above examples assume Windows XP 32-bit is installed inside the virtual disk file, so vbootmp.sys is copied. For other operating systems, you need to copy different driver files:

- Windows 2000 (32-bit) uses \vboot\tools\x86\drivers\vbootdsk-w2k\vbootdsk.sys
- Windows XP (32-bit) and above use \vboot\tools\x86\drivers\vbootmp\vbootmp.sys
- Windows XP (64-bit) and above use \vboot\tools\amd64\drivers\vbootmp\vbootmp.sys

### 15. VBoot command options

To use VBoot Loader, you need to insert a command into the grub.cfg configuration files. VBoot Loader passes these options to vboot virtual disk drivers inside the operating system. The VBoot virtual disk drivers utilize these options to perform the corresponding operations, such as mounting the disk files, taking a new snapshot, restoring to a snapshot and delete the child differencing disks, updating the grub.cfg file, etc.

The full syntax of vboot command is as follows:

vboot harddisk=disk_path cdrom=file_path floppy=file_path floppy_b=file_path boot=harddisk|cdrom|floppy parent_dir=folder_path take_snapshot=differencing_disk_path boot_entry=index config_file=grub_config_file new_menu_entry=title hide=disk_or_volume_list restore immutable recover_mbr pause

Options:

harddisk=disk_path

  This option specifies a hard disk file, the path format is described here.

cdrom=file_path

  This option specifies a cdrom ISO file, the path format is described here.

floppy=file_path

  This option specifies a floppy image file, which usually contains vboot driver, the path format is described here.

floppy_b=file_path

  This option specifies a 2nd floppy image file, which usually contains a 3rd party SCSI driver, the path format is described here.

boot=harddisk|cdrom|floppy

  This option specifies which media to boot. The default boot is harddisk.

parent_dir=folder_path

  This option specifies a folder to search for base images, and should be only used for differencing hard disks.

take_snapshot=differencing_disk_path

  This option is used to take a snapshot with the specified path as the differencing disk file.

boot_entry=index

  This option is reserved for VBoot Loader to specify a boot entry. You should not use it explicitly.

config_file=grub_config_file

  This option is reserved for VBoot Loader to specify the full path of the grub.cfg file. You should not use it explicitly.

new_menu_entry=title

  This option is used to create a new menu entry inside the grub.cfg file. The virtual disk driver inserts an entry based the specified disk paths and the specified menu title. This option is typically used after you have entered some options manually using the VBoot Loader edit screen, i.e., you have pressed 'C' or 'E' . This way, you don't have to edit the grub.cfg file by hand after the operating system is booted up.

hide=disk_or_volume_list

  This option protects real hard disks from access. It is used to hide disks or volumes, e.g., hide="0,1,C:,D:", where 0,1 indicates disk number, C:, D: are volumes. When a disk or volume is in the list, its access will be denied, and becomes invisible.

  The following is a typical use to restrict all access to the vhd only:
  vboot harddisk=(hd0,1)/xp.vhd hide="0"

  The hide option is implemented using a file filter driver (vbootfs.sys). It's much more than just hiding the disk, it actually checks all access to the disk, and denies all access other than vboot itself.

restore

  This option is used to restore to a snapshot. When a disk file contains child differencing disks, you can use this option to thrown away the child disks, and bring back to the same state before the snapshot was taken. Since the VBoot Loader does not support write access, it is the virtuald disk driver that performs the real task of deleting the snapshot and its child disks when the operating system kernel boots up. If the disk has another child disk after restoring, a new snapshot will be taken, with a new child differencing disk file created. If the disk has no child disks after restoring, then the disk will operate as a base image without taking a new snapshot. The grub.cfg file will be automatically updated to reflect the change.

immutable

  When this option is used, the operating boots as immutable, meaning that all system changes will be discarded after reboot. This is done by automatically saving all system changes to a differencing disk, and the delete the differencing disk after reboot. Note that you can still permanently save files to your real hard disks or external disks. Only those changes that are saved to the virtual disk, including system registry entries, will be thrown away.

recover_mbr

  Immediately remove VBoot Loader code from MBR sectors and recover the original boot code.

pause

  Pause before booting, and the user needs to press a key to continue. This provide a chance to examine some messages.

### 16. Troubleshooting

VBoot is complex piece of system software, so be prepared for problems and bugs. These sections list common problems and errors.

#### 16.1 [VBoot] Can't load vboot to the specified memory address 00090000

VBoot Loader loads itself to the real mode memory address 0x90000 (576k), and it occupies 64k, i.e., 576K-640K is used by VBoot, this memory region is most likely free to use. However, if you are getting this error, it indicates there is something else already using this region. Make sure you don't have other boot loaders, don't chainload to VBoot from other loaders, don't use VBoot on encrypted hard disks, etc.

#### 16.2 Black screen or other boot loader issues

VBoot Loader reserves a memory region for use, this might have conflicts with other devices. For example, there are reports that ATI graphic cards cause black screen during boot. If you get into this problem, you can try to use a different boot file. We provide a file "vboot-black-screen" in c:\vboot folder, you need to rename this file to "vboot". Make sure you backup the original "vboot" file.

More information is available on our website, http://www.vmlite.com