"VBoxManage unattended detect" gives "NS_ERROR_NOT_IMPLEMENTED" (#18411)

This is for discussing general topics about how to use VirtualBox.
Post Reply
candlerb
Posts: 3
Joined: 18. Feb 2018, 12:12

"VBoxManage unattended detect" gives "NS_ERROR_NOT_IMPLEMENTED" (#18411)

Post by candlerb »


ModEdit; related ticket: #18411: ubuntu-bionic-server does not work with 'VBoxManage unattended install' because of preseeding post-install errors
Hi,

I'm just trying out the unattended installation feature from 5.2.6 under macOS 10.12.6

With "unattended detect" I get the following error:

Code: Select all

$ VBoxManage unattended detect --iso=ubuntu-16.04.3-server-amd64.iso
VBoxManage: error: Code NS_ERROR_NOT_IMPLEMENTED (0x80004001) - Not implemented (extended info not available)
VBoxManage: error: Context: "DetectIsoOS()" at line 1328 of file VBoxManageMisc.cpp
VBoxManage: info: Detected '/Users/brian/Downloads/linux/ubuntu-16.04.3-server-amd64.iso' to be:
    OS TypeId    =
    OS Version   =
    OS Flavor    =
    OS Languages = en-US
    OS Hints     =
That doesn't look good. However, if I then proceed with "unattended install" it seems to work fine.

Anyway, I just thought it was worth a mention in case you want to fix this.

Thanks, Brian.
Last edited by socratis on 8. Feb 2019, 02:09, edited 1 time in total.
Reason: Added ticket related information.
candlerb
Posts: 3
Joined: 18. Feb 2018, 12:12

Re: "VBoxManage unattended detect" gives "NS_ERROR_NOT_IMPLEMENTED"

Post by candlerb »

Actually I spoke too soon... the install looked like it was going OK, but it ended with an error.

Code: Select all

!! 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.
Exit code 127 normally means the shell was not able to find the given command, which suggests that either "cp" and "chmod" are not in the path, or "/bin/bash" does not exist.

Regards, Brian.
Attachments
VirtualBox_easy-install_18_02_2018_10_24_46.png
VirtualBox_easy-install_18_02_2018_10_24_46.png (6.99 KiB) Viewed 8600 times
candlerb
Posts: 3
Joined: 18. Feb 2018, 12:12

Re: "VBoxManage unattended detect" gives "NS_ERROR_NOT_IMPLEMENTED"

Post by candlerb »

... and possibly related: if I login to the newly-installed VM as "vboxuser" and "changeme" it works, but sudo is rejected:

Code: Select all

vboxuser is not in the sudoers file.  This incident will be reported.
Checking in /etc/group, no users are in the "sudo" group. In fact, there are no users in supplementary groups apart from this one:

Code: Select all

$ grep -v ':$' /etc/group
adm:x:4:syslog
$
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: "VBoxManage unattended detect" gives "NS_ERROR_NOT_IMPLEMENTED"

Post by socratis »

I can only comment on your first post, and the title of the thread: the "detect" part, the auto-detection of the OS algorithm has not been implemented yet. Hence the error message.

Other than that, I haven't tested the templates, but maybe they need some hand tweaking? I don't know, haven't tested that area yet...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
WildSAR
Posts: 9
Joined: 2. Mar 2018, 11:38

Re: "VBoxManage unattended detect" gives "NS_ERROR_NOT_IMPLEMENTED"

Post by WildSAR »

I ran into this same issue. Here is the workaround/fix I came up with

The bug is in the following preseed file (it only gets exposed when installing ubuntu server; ubuntu desktop has no issue):

/Applications/VirtualBox.app/Contents/MacOS/UnattendedTemplates/ubuntu_preseed.cfg

Here is the patch (replace the line starting with - with the line starting with +).

Code: Select all

 # Custom Commands
 d-i preseed/late_command string cp /cdrom/vboxpostinstall.sh /target/root/vboxpostinstall.sh \
  && chmod +x /target/root/vboxpostinstall.sh \
- && /bin/bash /root/vboxpostinstall.sh --preseed-late-command
+ && /bin/sh /target/root/vboxpostinstall.sh --need-target-bash --preseed-late-command
Last edited by WildSAR on 2. Mar 2018, 23:27, edited 1 time in total.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: "VBoxManage unattended detect" gives "NS_ERROR_NOT_IMPLEMENTED"

Post by socratis »

WildSAR wrote:it only gets exposed when installing ubuntu server; ubuntu desktop has no issue
WildSAR wrote:Here is the patch
Assuming the patch fixes the server edition, what does it do to the desktop edition?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
WildSAR
Posts: 9
Joined: 2. Mar 2018, 11:38

Re: "VBoxManage unattended detect" gives "NS_ERROR_NOT_IMPLEMENTED"

Post by WildSAR »

I tested my patch with both
ubuntu-16.04.3-server-amd64.iso
ubuntu-16.04.3-desktop-amd64.iso

And it works with both.

It appears (by looking in /var/log/vboxpostinstall.log) when building 'server' preseeding uses the command

Code: Select all

d-i preseed/late_command string cp /cdrom/vboxpostinstall.sh /target/root/vboxpostinstall.sh [...]
and when building 'desktop' it uses the command

Code: Select all

ubiquity ubiquity/success_command string cp /cdrom/vboxpostinstall.sh /target/root/vboxpostinstall.sh [...]
My change only affect the first command and thus only affects the 'server' build. So 'desktop' should be unaffected.

I'm happy to provide any/all work I've done on cmd-line building/installing (using VBoxManage) if its useful.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: "VBoxManage unattended detect" gives "NS_ERROR_NOT_IMPLEMENTED"

Post by socratis »

I sent an e-mail to the vbox-dev mailing list with the link to this thread...
Let's see if it gets through... ;)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
WildSAR
Posts: 9
Joined: 2. Mar 2018, 11:38

Re: "VBoxManage unattended detect" gives "NS_ERROR_NOT_IMPLEMENTED"

Post by WildSAR »

Just filed this ticket. Its really covers any ubuntu server, but I just referenced ubuntu-bionic-server.

I'm Robert Nielsen (AKA: WildSAR)

https://www.virtualbox.org/ticket/18411
WildSAR
Posts: 9
Joined: 2. Mar 2018, 11:38

Fix for issue with 'VBoxManage unattended install' of Ubuntu Server (#18411)

Post by WildSAR »

Greetings,

There is an issue when installing Ubuntu Server using 'VBoxManage unattended install' because of preseeding post-install errors. Unfortunately it fails late after the install completes and its performing post-install configuration. This likely effects all Ubuntu Server releases. I've tested xenial (16.04.1), bionic (18.04.1), and cosmic (18.10). They all fail identically.
ubuntu-server-install-failure.png
ubuntu-server-install-failure.png (10.58 KiB) Viewed 7681 times
I filed a bug and supplied the fix for this issue. Attached to the bug is a script to reproduce the bug (cleverly named reproduce-bug.sh) and a three line patch to fix .../UnattendedTemplates/ubuntu_preseed.cfg.

https://www.virtualbox.org/ticket/18411

Code: Select all

# to see the bug
./reproduce-bug.sh

# to see the fix
fix=1 ./reproduce-bug.sh
The script might be interesting to anyone trying to learn how to use the VBoxManage to build an entire VM (including installation) from the command line.

Robert Nielsen (aka WildSAR)
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: "VBoxManage unattended detect" gives "NS_ERROR_NOT_IMPLEMENTED" (#18411)

Post by socratis »

Robert, I merged your post with the existing thread on the subject.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
DeekGeek
Posts: 1
Joined: 5. Aug 2019, 15:45

Re: "VBoxManage unattended detect" gives "NS_ERROR_NOT_IMPLEMENTED" (#18411)

Post by DeekGeek »

I applied Robert's proposed fix to VirtualBox 6.0.10 on a Windows 10 host. I still received a preseed error when performing an unattended install of Ubuntu Server 18.04.2.
[!!] 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.
I've added this information as a comment to Robert's bug report.
Attachments
Ubuntu preseed error post-fix under VB 6.0.10
Ubuntu preseed error post-fix under VB 6.0.10
2019-08-04 12_32_41-Ubuntu-Preseed-VirtualBox.png (24.3 KiB) Viewed 6742 times
marcopolo
Posts: 1
Joined: 23. Oct 2019, 04:07

Re: "VBoxManage unattended detect" gives "NS_ERROR_NOT_IMPLEMENTED" (#18411)

Post by marcopolo »

Does anyone has a working combination of ISO, and config files? I tried with the desktop version and it just hangs at the end of the process.
Post Reply