Index: /trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro	(revision 38101)
+++ /trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro	(revision 38102)
@@ -51,4 +51,5 @@
     src/wizards/clonevm/UICloneVMWizardPage1.ui \
     src/wizards/clonevm/UICloneVMWizardPage2.ui \
+    src/wizards/clonevm/UICloneVMWizardPage3.ui \
     src/wizards/newvm/UINewVMWzdPage1.ui \
     src/wizards/newvm/UINewVMWzdPage2.ui \
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UICloneVMWizard.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UICloneVMWizard.cpp	(revision 38101)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UICloneVMWizard.cpp	(revision 38102)
@@ -31,14 +31,17 @@
 #include "iprt/path.h"
 
-UICloneVMWizard::UICloneVMWizard(QWidget *pParent, CMachine machine, bool fShowChildsOption /* = true */)
+UICloneVMWizard::UICloneVMWizard(QWidget *pParent, CMachine machine, CSnapshot snapshot /* = CSnapshot() */)
     : QIWizard(pParent)
     , m_machine(machine)
 {
     /* Create & add pages: */
-    addPage(new UICloneVMWizardPage1(machine.GetName()));
+    setPage(PageIntro, new UICloneVMWizardPage1(machine.GetName()));
+    /* If we are having a snapshot we can show the "Linked" option. */
+    if (!snapshot.isNull())
+        setPage(PageType, new UICloneVMWizardPage2());
     /* If the machine has no snapshots, we don't bother the user about options
      * for it. */
     if (machine.GetSnapshotCount() > 0)
-        addPage(new UICloneVMWizardPage2(fShowChildsOption));
+        setPage(PageMode, new UICloneVMWizardPage3(snapshot.isNull() ? false : snapshot.GetChildrenCount() > 0));
 
     /* Translate wizard: */
@@ -69,5 +72,5 @@
 }
 
-bool UICloneVMWizard::createClone(const QString &strName, KCloneMode mode, bool fReinitMACs)
+bool UICloneVMWizard::createClone(const QString &strName, KCloneMode mode, bool fReinitMACs, bool fLinked /* = false */)
 {
     CVirtualBox vbox = vboxGlobal().virtualBox();
@@ -86,4 +89,7 @@
     if (!fReinitMACs)
         options.append(KCloneOptions_KeepAllMACs);
+    /* Linked clones requested? */
+    if (fLinked)
+        options.append(KCloneOptions_Link);
 
     /* Start cloning. */
@@ -192,20 +198,77 @@
 }
 
-UICloneVMWizardPage2::UICloneVMWizardPage2(bool fShowChildsOption /* = true */)
-  : m_fShowChildsOption(fShowChildsOption)
+UICloneVMWizardPage2::UICloneVMWizardPage2()
 {
     /* Decorate page: */
     Ui::UICloneVMWizardPage2::setupUi(this);
 
+    QButtonGroup *pButtonGroup = new QButtonGroup(this);
+    pButtonGroup->addButton(m_pFullCloneRadio);
+    pButtonGroup->addButton(m_pLinkedCloneRadio);
+
+    connect(pButtonGroup, SIGNAL(buttonClicked(QAbstractButton *)),
+            this, SLOT(buttonClicked(QAbstractButton *)));
+}
+
+void UICloneVMWizardPage2::buttonClicked(QAbstractButton *pButton)
+{
+    setFinalPage(pButton != m_pFullCloneRadio);
+}
+
+void UICloneVMWizardPage2::retranslateUi()
+{
+    /* Translate uic generated strings: */
+    Ui::UICloneVMWizardPage2::retranslateUi(this);
+
+    /* Set 'Page2' page title: */
+    setTitle(tr("Cloning Configuration"));
+}
+
+void UICloneVMWizardPage2::initializePage()
+{
+    /* Retranslate page: */
+    retranslateUi();
+}
+
+int UICloneVMWizardPage2::nextId() const
+{
+    return m_pFullCloneRadio->isChecked() ? UICloneVMWizard::PageMode : -1;
+}
+
+bool UICloneVMWizardPage2::validatePage()
+{
+    if (isFinalPage())
+    {
+        /* Start performing long-time operation: */
+        startProcessing();
+        /* Try to create the clone: */
+        QString strName = field("cloneName").toString();
+        bool fReinitMACs = field("reinitMACs").toBool();
+        bool fResult = static_cast<UICloneVMWizard*>(wizard())->createClone(strName, KCloneMode_MachineState, fReinitMACs, true);
+        /* Finish performing long-time operation: */
+        endProcessing();
+        /* Return operation result: */
+        return fResult;
+    }
+    else
+        return true;
+}
+
+UICloneVMWizardPage3::UICloneVMWizardPage3(bool fShowChildsOption /* = true */)
+  : m_fShowChildsOption(fShowChildsOption)
+{
+    /* Decorate page: */
+    Ui::UICloneVMWizardPage3::setupUi(this);
+
     if (!fShowChildsOption)
        m_pMachineAndChildsRadio->hide();
 }
 
-void UICloneVMWizardPage2::retranslateUi()
+void UICloneVMWizardPage3::retranslateUi()
 {
     /* Translate uic generated strings: */
-    Ui::UICloneVMWizardPage2::retranslateUi(this);
-
-    /* Set 'Page2' page title: */
+    Ui::UICloneVMWizardPage3::retranslateUi(this);
+
+    /* Set 'Page3' page title: */
     setTitle(tr("Cloning Configuration"));
 
@@ -227,5 +290,5 @@
 }
 
-void UICloneVMWizardPage2::initializePage()
+void UICloneVMWizardPage3::initializePage()
 {
     /* Retranslate page: */
@@ -233,5 +296,5 @@
 }
 
-bool UICloneVMWizardPage2::validatePage()
+bool UICloneVMWizardPage3::validatePage()
 {
     /* Start performing long-time operation: */
@@ -247,5 +310,5 @@
 }
 
-KCloneMode UICloneVMWizardPage2::cloneMode() const
+KCloneMode UICloneVMWizardPage3::cloneMode() const
 {
     if (m_pMachineRadio->isChecked())
@@ -256,5 +319,5 @@
 }
 
-void UICloneVMWizardPage2::setCloneMode(KCloneMode mode)
+void UICloneVMWizardPage3::setCloneMode(KCloneMode mode)
 {
     switch(mode)
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UICloneVMWizard.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UICloneVMWizard.h	(revision 38101)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UICloneVMWizard.h	(revision 38102)
@@ -27,4 +27,5 @@
 #include "UICloneVMWizardPage1.gen.h"
 #include "UICloneVMWizardPage2.gen.h"
+#include "UICloneVMWizardPage3.gen.h"
 
 /* Clone vm wizard class: */
@@ -35,8 +36,15 @@
 public:
 
+    enum
+    {
+        PageIntro,
+        PageType,
+        PageMode
+    };
+
     /* Constructor: */
-    UICloneVMWizard(QWidget *pParent, CMachine machine, bool fShowChildsOption = true);
+    UICloneVMWizard(QWidget *pParent, CMachine machine, CSnapshot snapshot = CSnapshot());
 
-    bool createClone(const QString &strName, KCloneMode mode, bool fReinitMACs);
+    bool createClone(const QString &strName, KCloneMode mode, bool fReinitMACs, bool fLinked = false);
 
 private:
@@ -108,4 +116,30 @@
 {
     Q_OBJECT;
+
+public:
+
+    /* Constructor: */
+    UICloneVMWizardPage2();
+    int nextId() const;
+
+protected:
+
+    /* Translation stuff: */
+    void retranslateUi();
+
+    /* Prepare page: */
+    void initializePage();
+
+    bool validatePage();
+
+private slots:
+
+    void buttonClicked(QAbstractButton *pButton);
+};
+
+/* Page3 of the new clonevm wizard: */
+class UICloneVMWizardPage3 : public UICloneVMWizardPage, public Ui::UICloneVMWizardPage3
+{
+    Q_OBJECT;
     Q_PROPERTY(KCloneMode cloneMode READ cloneMode WRITE setCloneMode);
 
@@ -113,5 +147,5 @@
 
     /* Constructor: */
-    UICloneVMWizardPage2(bool fShowChildsOption = true);
+    UICloneVMWizardPage3(bool fShowChildsOption = true);
 
 protected:
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UICloneVMWizardPage2.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UICloneVMWizardPage2.ui	(revision 38101)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UICloneVMWizardPage2.ui	(revision 38102)
@@ -34,5 +34,5 @@
     <widget class="QILabel" name="m_pLabel">
      <property name="text">
-      <string></string>
+      <string>&lt;p&gt;Please select the type of the clone.&lt;/p&gt;&lt;p&gt;If you choose &lt;b&gt;Full Clone&lt;/b&gt; an exact copy (including all virtual disk images) of the original VM will be created. If you select &lt;b&gt;Linked Clone&lt;/b&gt;, a new VM will be created, but the virtual disk images will point to the virtual disk images of original VM.&lt;/p&gt;</string>
      </property>
      <property name="wordWrap">
@@ -42,7 +42,7 @@
    </item>
    <item>
-    <widget class="QRadioButton" name="m_pMachineRadio">
+    <widget class="QRadioButton" name="m_pFullCloneRadio">
      <property name="text">
-      <string>Current machine state</string>
+      <string>Full Clone</string>
      </property>
      <property name="checked">
@@ -52,14 +52,7 @@
    </item>
    <item>
-    <widget class="QRadioButton" name="m_pMachineAndChildsRadio">
+    <widget class="QRadioButton" name="m_pLinkedCloneRadio">
      <property name="text">
-      <string>Current machine and all child states</string>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <widget class="QRadioButton" name="m_pAllRadio">
-     <property name="text">
-      <string>All states</string>
+      <string>Linked Clone</string>
      </property>
     </widget>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UICloneVMWizardPage3.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UICloneVMWizardPage3.ui	(revision 38102)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UICloneVMWizardPage3.ui	(revision 38102)
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI (&quot;VirtualBox&quot;):
+
+     Copyright (C) 2011 Oracle Corporation
+
+     This file is part of VirtualBox Open Source Edition (OSE), as
+     available from http://www.virtualbox.org. This file is free software;
+     you can redistribute it and/or modify it under the terms of the GNU
+     General Public License (GPL) as published by the Free Software
+     Foundation, in version 2 as it comes in the &quot;COPYING&quot; file of the
+     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ </comment>
+ <class>UICloneVMWizardPage3</class>
+ <widget class="QWidget" name="UICloneVMWizardPage3">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>600</width>
+    <height>400</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <widget class="QILabel" name="m_pLabel">
+     <property name="text">
+      <string></string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QRadioButton" name="m_pMachineRadio">
+     <property name="text">
+      <string>Current machine state</string>
+     </property>
+     <property name="checked">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QRadioButton" name="m_pMachineAndChildsRadio">
+     <property name="text">
+      <string>Current machine and all child states</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QRadioButton" name="m_pAllRadio">
+     <property name="text">
+      <string>All states</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <spacer name="m_pSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>0</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QILabel</class>
+   <extends>QLabel</extends>
+   <header>QILabel.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
