Opened 6 years ago
Last modified 5 years ago
#18411 new defect
ubuntu-bionic-server does not work with 'VBoxManage unattended install' because of preseeding post-install errors
Reported by: | Robert Nielsen | Owned by: | |
---|---|---|---|
Component: | other | Version: | VirtualBox 6.0.4 |
Keywords: | VBoxManage unattended install ubuntu bionic server | Cc: | |
Guest type: | Linux | Host type: | all |
Description
[attached script: reproduce-bug.sh] # 111 lines
[attached patch: fix.patch] # 4 lines
It was reported here (and includes this fix):
https://forums.virtualbox.org/viewtopic.php?f=8&t=86798[[BR]]
I'm WildSAR
This is a single line change in .../UnattendedTemplates/ubuntu_preseed.cfg which is consistent with debian_preseed.cfg in the same directory.
The text of the error is:
---
!! Finish the installation
Failed to run preseeded command
Execution of preseeded command "cp /cdrom/vboxpostinstall.sh
/target/root/vboxpostinstall.sh && chmod +x /target /root/vboxpostinstall.sh && /bin/bash
/root/vboxpostinstall.sh --preseed-late-command" failed with exit code 127.
---
This is the patch which fixes ubuntu_preseed.cfg:
< && /bin/bash /root/vboxpostinstall.sh --preseed-late-command --- > && /bin/sh /target/root/vboxpostinstall.sh --need-target-bash --preseed-late-command
There are *three* bugs in this single line of code:
/bin/bash should be /bin/sh
/root/vboxpostinstall.sh should be /target/root/vboxpostinstall.sh
--need-target-bash is missing
The above solution is the same as in .../UnattendedTemplates/debian_preseed.cfg (a peer file of ubuntu_preseed.cfg).
# to see the bug, do this
./reproduce-bug.sh
# to see my fix, do this
fix=1 ./reproduce-bug.sh
Attachments (3)
Change History (6)
by , 6 years ago
Attachment: | reproduce-bug.sh added |
---|
by , 6 years ago
follow-up: 2 comment:1 by , 5 years ago
by , 5 years ago
Attachment: | 2019-08-04 12_32_41-Ubuntu-Preseed-VirtualBox.png added |
---|
Unattended Ubuntu install preseeded command error under VirtualBox 6.0.10
comment:2 by , 5 years ago
This has only been tested on macos and linux; never windows.
A few questions:
Which version of Ubuntu Server were you trying to install?
Did 'VBoxManage unattended install' ever work for you using any Ubuntu Server release (for example Bionic Server)? After applying this patch, did your error change, or did it stay the same? If different, please share.
Using 'VBoxManage unattended install' have you tried to install any Debian Netinstall release (for example Buster)? I ask because its uses the exact same code below. Compare debian_preseed.cfg with ubuntu_preseed.cfg you see same code as in my patch in the debian_preseed.cfg. The one in ubuntu_preseed.cfg is wrong in THREE places! There are three fixes in my one line patch. :-)
Replying to DeekGeek:
I applied the described fix to VirtualBox 6.0.10 on a Windows 10 host. I received the following error:
--
[!!] Finish the installation
Failed to run preseeded command Execution of preseeded command "cp /cdrom/vboxpostinstall.sh /target/root/vboxpostinstall.sh && cdmod +x /target/root/vboxpostinstall.sh && /bin/sh /target/root/vboxpostinstall.sh --need-target-bash --preseed-late-command" failed with exit code 1.
comment:3 by , 5 years ago
Oh wait, I see the problem. Looks like you applied the patch by hand.
cdmod
should be
chmod
That is why it failed.
I applied the described fix to VirtualBox 6.0.10 on a Windows 10 host. I received the following error:
--
[!!] Finish the installation
Failed to run preseeded command Execution of preseeded command "cp /cdrom/vboxpostinstall.sh /target/root/vboxpostinstall.sh && cdmod +x /target/root/vboxpostinstall.sh && /bin/sh /target/root/vboxpostinstall.sh --need-target-bash --preseed-late-command" failed with exit code 1.