Changeset 68071 in vbox
- Timestamp:
- Jul 20, 2017 4:24:08 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 117104
- Location:
- trunk/src/VBox
- Files:
-
- 3 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
r68055 r68071 1286 1286 int fInstallTxs = -1; 1287 1287 const char *pszMachineName = NULL; 1288 Utf8Str strAbsSettingsFile;1289 const char *pszSettingsFile = NULL;1290 1288 bool fSetImageIdx = false; 1291 1289 uint32_t idxImage = 0; … … 1295 1293 Utf8Str strAbsScriptTemplatePath; 1296 1294 const char *pszScriptTemplatePath = NULL; 1295 Utf8Str strAbsPostInstallScriptTemplatePath; 1296 const char *pszPostInstallScriptTemplatePath = NULL; 1297 1297 const char *pszSessionType = "headless"; 1298 1298 … … 1319 1319 { "--image-index", 'm', RTGETOPT_REQ_UINT32 }, 1320 1320 { "--script-template", 'c', RTGETOPT_REQ_STRING }, 1321 { "--post-install-template", 'C', RTGETOPT_REQ_STRING }, 1321 1322 { "--post-install-command", 'P', RTGETOPT_REQ_STRING }, 1322 { "--settings-file", 's', RTGETOPT_REQ_STRING },1323 1323 { "--session-type", 'S', RTGETOPT_REQ_STRING }, 1324 1324 }; … … 1342 1342 break; 1343 1343 1344 case 's': // --settings-file <key value file>1345 vrc = RTPathAbsCxx(strAbsSettingsFile, ValueUnion.psz);1346 if (RT_FAILURE(vrc))1347 return errorSyntax(USAGE_UNATTENDEDINSTALL, "RTPathAbsCxx failed on '%s': %Rrc", ValueUnion.psz, vrc);1348 pszSettingsFile = strAbsSettingsFile.c_str();1349 break;1350 1351 1344 case 'i': // --iso 1352 1345 vrc = RTPathAbsCxx(strAbsIsoPath, ValueUnion.psz); … … 1417 1410 break; 1418 1411 1412 case 'C': // --post-install-script-template 1413 vrc = RTPathAbsCxx(strAbsPostInstallScriptTemplatePath, ValueUnion.psz); 1414 if (RT_FAILURE(vrc)) 1415 return errorSyntax(USAGE_UNATTENDEDINSTALL, "RTPathAbsCxx failed on '%s': %Rrc", ValueUnion.psz, vrc); 1416 pszPostInstallScriptTemplatePath = strAbsPostInstallScriptTemplatePath.c_str(); 1417 break; 1418 1419 1419 case 'P': // --post-install-command. 1420 1420 pszPostInstallCommand = ValueUnion.psz; … … 1436 1436 return errorSyntax(USAGE_UNATTENDEDINSTALL, "Missing VM name/UUID"); 1437 1437 1438 if (!psz SettingsFile && !pszIsoPath)1439 return errorSyntax(USAGE_UNATTENDEDINSTALL, "Missing required --iso (or --settings-file)option");1438 if (!pszIsoPath) 1439 return errorSyntax(USAGE_UNATTENDEDINSTALL, "Missing required --iso option"); 1440 1440 1441 1441 /* … … 1486 1486 ComPtr<IUnattended> ptrUnattended; 1487 1487 CHECK_ERROR_BREAK(machine, CreateUnattendedInstaller(ptrUnattended.asOutParam())); 1488 1489 if (pszSettingsFile)1490 CHECK_ERROR_BREAK(ptrUnattended, LoadSettings(Bstr(pszSettingsFile).raw()));1491 1488 1492 1489 if (pszIsoPath) … … 1512 1509 if (pszScriptTemplatePath) 1513 1510 CHECK_ERROR_BREAK(ptrUnattended, COMSETTER(ScriptTemplatePath)(Bstr(pszScriptTemplatePath).raw())); 1511 if (pszPostInstallScriptTemplatePath) 1512 CHECK_ERROR_BREAK(ptrUnattended, COMSETTER(PostInstallScriptTemplatePath)(Bstr(pszPostInstallScriptTemplatePath).raw())); 1514 1513 if (pszPostInstallCommand) 1515 1514 CHECK_ERROR_BREAK(ptrUnattended, COMSETTER(PostInstallCommand)(Bstr(pszPostInstallCommand).raw())); … … 1529 1528 HRESULT hrc2 = ptrUnattended->COMGETTER(a_Attr)(&Value); \ 1530 1529 if (SUCCEEDED(hrc2)) \ 1531 RTPrintf(" % 22s = " a_szFmt "\n", a_szText, Value); \1530 RTPrintf(" %32s = " a_szFmt "\n", a_szText, Value); \ 1532 1531 else \ 1533 RTPrintf(" % 22s = failed: %Rhrc\n", a_szText, hrc2); \1532 RTPrintf(" %32s = failed: %Rhrc\n", a_szText, hrc2); \ 1534 1533 } while (0) 1535 1534 #define SHOW_STR_ATTR(a_Attr, a_szText) do { \ … … 1537 1536 HRESULT hrc2 = ptrUnattended->COMGETTER(a_Attr)(bstrString.asOutParam()); \ 1538 1537 if (SUCCEEDED(hrc2)) \ 1539 RTPrintf(" % 22s = %ls\n", a_szText, bstrString.raw()); \1538 RTPrintf(" %32s = %ls\n", a_szText, bstrString.raw()); \ 1540 1539 else \ 1541 RTPrintf(" % 22s = failed: %Rhrc\n", a_szText, hrc2); \1540 RTPrintf(" %32s = failed: %Rhrc\n", a_szText, hrc2); \ 1542 1541 } while (0) 1543 1542 … … 1554 1553 SHOW_ATTR( ImageIndex, "imageIndex", ULONG, "%u"); 1555 1554 SHOW_STR_ATTR(ScriptTemplatePath, "scriptTemplatePath"); 1555 SHOW_STR_ATTR(PostInstallScriptTemplatePath, "postInstallScriptTemplatePath"); 1556 1556 SHOW_STR_ATTR(PostInstallCommand, "postInstallCommand"); 1557 1557 -
trunk/src/VBox/Main/UnattendedTemplates/debian_preseed.cfg
r68057 r68071 62 62 63 63 # Custom Commands 64 d-i preseed/late_command string \ 65 mkdir -p /target/postinstall && \ 66 cd /target/postinstall && \ 67 echo '#!/bin/bash' > post-install.sh && \ 68 echo 'apt-get -y install build-essential' >> post-install.sh && \ 69 echo 'apt-get -y install linux-headers-$(uname -r)' >> post-install.sh && \ 70 @@VBOX_COND_IS_INSTALLING_ADDITIONS@@echo 'echo' >> post-install.sh && \ 71 echo 'echo "Installing VirtualBox Guest Additions..."' >> post-install.sh && \ 72 echo 'bash /cdrom/VBoxAdditions/VBoxLinuxAdditions.run' >> post-install.sh && \ 73 echo 'usermod -a -G vboxsf "@@VBOX_INSERT_USER_LOGIN@@"' >> post-install.sh && \ 74 @@VBOX_COND_END@@@@VBOX_COND_IS_INSTALLING_TEST_EXEC_SERVICE@@echo 'echo' >> post-install.sh && \ 75 echo 'echo "TODO: Installing Test Execution Service..."' >> post-install.sh && \ 76 @@VBOX_COND_END@@echo exit 0' >> post-install.sh && \ 77 chmod +x /target/postinstall/post-install.sh && \ 78 chroot /target /bin/bash /postinstall/post-install.sh 64 d-i preseed/late_command string cp /cdrom/vboxpostinstall.sh /target/root/vboxpostinstall.sh \ 65 && chmod +x /target/root/vboxpostinstall.sh \ 66 && chroot /target /bin/bash /root/vboxpostinstall.sh 79 67 -
trunk/src/VBox/Main/UnattendedTemplates/fedora_ks.cfg
r67881 r68071 64 64 65 65 @@VBOX_COND_IS_INSTALLING_ADDITIONS@@ 66 mkdir -p /mnt/cdrom 67 mount -o ro /dev/sr2 /mnt/cdrom 68 echo 69 echo "Installing VirtualBox Guest Additions..." 70 bash /mnt/cdrom/VBoxLinuxAdditions.run 71 usermod -a -G vboxsf @@VBOX_INSERT_USER_LOGIN_SH@@ 72 @@VBOX_COND_END@@ 66 ## @todo fix this. 67 cp /cdrom/vboxpostinstall.sh /root/vboxpostinstall.sh && chmod a+x /root/vboxpostinstall.sh && /bin/bash /root/vboxpostinstall.sh 73 68 eject /dev/sr0 74 69 eject /dev/sr1 -
trunk/src/VBox/Main/UnattendedTemplates/ol_ks.cfg
r67881 r68071 72 72 73 73 %post --log=/root/ks-post.log 74 @@VBOX_COND_IS_INSTALLING_ADDITIONS@@ 75 mkdir -p /mnt/cdrom 76 mount -o ro /dev/sr2 /mnt/cdrom 77 echo 78 echo "Installing VirtualBox Guest Additions..." 79 bash /mnt/cdrom/VBoxLinuxAdditions.run 80 usermod -a -G vboxsf @@VBOX_INSERT_USER_LOGIN_SH@@ 81 @@VBOX_COND_END@@ 74 ## @todo fix this. 75 cp /cdrom/vboxpostinstall.sh /root/vboxpostinstall.sh && chmod a+x /root/vboxpostinstall.sh && /bin/bash /root/vboxpostinstall.sh 82 76 eject /dev/sr0 83 77 eject /dev/sr1 -
trunk/src/VBox/Main/UnattendedTemplates/redhat67_ks.cfg
r67881 r68071 71 71 72 72 %post --log=/root/ks-post.log 73 @@VBOX_COND_IS_INSTALLING_ADDITIONS@@ 74 mkdir -p /mnt/cdrom 75 mount -o ro /dev/sr2 /mnt/cdrom 76 echo 77 echo "Installing VirtualBox Guest Additions..." 78 bash /mnt/cdrom/VBoxLinuxAdditions.run 79 usermod -a -G vboxsf @@VBOX_INSERT_USER_LOGIN_SH@@ 80 @@VBOX_COND_END@@ 73 ## @todo fix this. 74 cp /cdrom/vboxpostinstall.sh /root/vboxpostinstall.sh && chmod a+x /root/vboxpostinstall.sh && /bin/bash /root/vboxpostinstall.sh 81 75 eject /dev/sr0 82 76 eject /dev/sr1 -
trunk/src/VBox/Main/UnattendedTemplates/ubuntu_preseed.cfg
r68057 r68071 62 62 63 63 # Custom Commands 64 d-i preseed/late_command string \ 65 mkdir -p /target/postinstall && \ 66 cd /target/postinstall && \ 67 echo '#!/bin/bash' > post-install.sh && \ 68 echo 'apt-get -y install build-essential' >> post-install.sh && \ 69 echo 'apt-get -y install linux-headers-$(uname -r)' >> post-install.sh && \ 70 @@VBOX_COND_IS_INSTALLING_ADDITIONS@@echo 'echo' >> post-install.sh && \ 71 echo 'echo "Installing VirtualBox Guest Additions..."' >> post-install.sh && \ 72 echo 'bash /cdrom/VBoxAdditions/VBoxLinuxAdditions.run' >> post-install.sh && \ 73 echo 'usermod -a -G vboxsf "@@VBOX_INSERT_USER_LOGIN@@"' >> post-install.sh && \ 74 @@VBOX_COND_END@@@@VBOX_COND_IS_INSTALLING_TEST_EXEC_SERVICE@@echo 'echo' >> post-install.sh && \ 75 echo 'echo "TODO: Installing Test Execution Service..."' >> post-install.sh && \ 76 @@VBOX_COND_END@@echo exit 0' >> post-install.sh && \ 77 chmod +x /target/postinstall/post-install.sh && \ 78 chroot /target /bin/bash /postinstall/post-install.sh 64 d-i preseed/late_command string cp /cdrom/vboxpostinstall.sh /target/root/vboxpostinstall.sh \ 65 && chmod +x /target/root/vboxpostinstall.sh \ 66 && chroot /target /bin/bash /root/vboxpostinstall.sh 79 67 80 68 # Same as above, but for ubiquity. 81 ubiquity ubiquity/success_command string \ 82 mkdir -p /target/postinstall && \ 83 cd /target/postinstall && \ 84 echo '#!/bin/bash' > post-install.sh && \ 85 echo 'apt-get -y install build-essential' >> post-install.sh && \ 86 echo 'apt-get -y install linux-headers-$(uname -r)' >> post-install.sh && \ 87 @@VBOX_COND_IS_INSTALLING_ADDITIONS@@echo 'echo' >> post-install.sh && \ 88 echo 'echo "Installing VirtualBox Guest Additions..."' >> post-install.sh && \ 89 echo 'bash /cdrom/VBoxAdditions/VBoxLinuxAdditions.run' >> post-install.sh && \ 90 echo 'usermod -a -G vboxsf "@@VBOX_INSERT_USER_LOGIN@@"' >> post-install.sh && \ 91 @@VBOX_COND_END@@@@VBOX_COND_IS_INSTALLING_TEST_EXEC_SERVICE@@echo 'echo' >> post-install.sh && \ 92 echo 'echo "TODO: Installing Test Execution Service..."' >> post-install.sh && \ 93 @@VBOX_COND_END@@echo exit 0' >> post-install.sh && \ 94 chmod +x /target/postinstall/post-install.sh && \ 95 chroot /target /bin/bash /postinstall/post-install.sh 69 ubiquity ubiquity/success_command string cp /cdrom/vboxpostinstall.sh /target/root/vboxpostinstall.sh \ 70 && chmod +x /target/root/vboxpostinstall.sh \ 71 && chroot /target /bin/bash /root/vboxpostinstall.sh 96 72 -
trunk/src/VBox/Main/UnattendedTemplates/win_nt5_unattended.sif
r67881 r68071 57 57 @@VBOX_COND_IS_INSTALLING_ADDITIONS@@ 58 58 [GuiRunOnce] 59 Command0=" E:\VBoxWindowsAdditions.exe"59 Command0="A:\vboxpost.cmd" 60 60 @@VBOX_COND_END@@ 61 61 -
trunk/src/VBox/Main/UnattendedTemplates/win_nt6_unattended.xml
r67941 r68071 126 126 <CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Network\NewNetworkWindowOff"</CommandLine> 127 127 </SynchronousCommand> 128 @@VBOX_COND_IS_INSTALLING_ADDITIONS@@129 128 <SynchronousCommand wcm:action="add"> 130 129 <Order>2</Order> 131 <Description> Install Oracle certificate</Description>132 <CommandLine> e:\cert\VBoxCertUtil.exe add-trusted-publisher e:\cert\vbox*.cer --root e:\cert\vbox*.cer</CommandLine>130 <Description>VirtualBox post guest install steps </Description> 131 <CommandLine>cmd.exe /c A:\vboxpost.cmd</CommandLine> 133 132 </SynchronousCommand> 134 <SynchronousCommand wcm:action="add">135 <Order>3</Order>136 <Description>Install VirtualBox Guest Additions</Description>137 <CommandLine>e:\VBoxWindowsAdditions.exe /S</CommandLine>138 </SynchronousCommand>139 @@VBOX_COND_END@@140 133 </FirstLogonCommands> 141 134 -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r68038 r68071 3767 3767 <interface 3768 3768 name="IUnattended" extends="$unknown" 3769 uuid=" 1f9a37d3-c3ba-4741-a53a-822a1b2d308d"3769 uuid="663fc677-ca00-4a24-b940-8741f76a898a" 3770 3770 wsmap="managed" 3771 3771 reservedMethods="4" reservedAttributes="16" … … 3900 3900 </attribute> 3901 3901 3902 <attribute name="postInstallScriptTemplatePath" type="wstring"> 3903 <desc> 3904 The post installation (shell/batch) script template file. 3905 3906 The template default is based on the guest OS type and is determined by the 3907 internal installer when when <link to="IUnattended::prepare"/> is invoked. 3908 Most users will want the defaults. 3909 3910 After <link to="IUnattended::prepare"/> is called, it can be read to see 3911 which file is being used. 3912 </desc> 3913 </attribute> 3914 3902 3915 <attribute name="postInstallCommand" type="wstring"> 3903 3916 <desc> … … 3905 3918 3906 3919 Exactly what is expected as input here depends on the guest OS installer 3907 and the script template (see <link to="IUnattended::scriptTemplatePath"/>). 3920 and the post installation script template (see 3921 <link to="IUnattended::postInstallScriptTemplatePath"/>). 3908 3922 Most users will not need to set this attribute. 3909 3923 </desc> 3910 3924 </attribute> 3911 3925 3926 <!-- See no point in having this any more. 3912 3927 <method name="loadSettings"> 3913 3928 <desc> … … 3922 3937 </param> 3923 3938 </method> 3939 --> 3924 3940 3925 3941 <method name="prepare">
Note:
See TracChangeset
for help on using the changeset viewer.