VirtualBox

Opened 5 years ago

Last modified 4 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)

reproduce-bug.sh (3.1 KB ) - added by Robert Nielsen 5 years ago.
fix.patch (162 bytes ) - added by Robert Nielsen 5 years ago.
2019-08-04 12_32_41-Ubuntu-Preseed-VirtualBox.png (24.3 KB ) - added by DeekGeek 5 years ago.
Unattended Ubuntu install preseeded command error under VirtualBox 6.0.10

Download all attachments as: .zip

Change History (6)

by Robert Nielsen, 5 years ago

Attachment: reproduce-bug.sh added

by Robert Nielsen, 5 years ago

Attachment: fix.patch added

comment:1 by DeekGeek, 5 years ago

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.

by DeekGeek, 5 years ago

Unattended Ubuntu install preseeded command error under VirtualBox 6.0.10

in reply to:  1 comment:2 by Robert Nielsen, 4 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 Robert Nielsen, 4 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.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use