Skip to content

Conversation

@DaniilKl
Copy link
Contributor

Adds Automatic installation of Ubuntu Desktop instance via netboot.xyz preconfigured using Dasharo/preseeds repo.

@DaniilKl DaniilKl added the enhancement New feature or request label Apr 23, 2024
@DaniilKl DaniilKl requested a review from macpijan April 23, 2024 11:00
@DaniilKl DaniilKl self-assigned this Apr 23, 2024
@DaniilKl DaniilKl marked this pull request as draft April 23, 2024 11:00
@DaniilKl DaniilKl force-pushed the ubuntu-automatic-installation branch 4 times, most recently from 0fe91b8 to 02431e4 Compare April 26, 2024 12:15
@DaniilKl DaniilKl marked this pull request as ready for review April 26, 2024 12:28
@DaniilKl
Copy link
Contributor Author

Verification results:

λ robot -b file.txt -L TRACE -v ansible_config:yes -v rte_ip:127.0.0.1 -v snipeit:no -v config:qemu operating-systems/ubuntu.robot
==============================================================================
Ubuntu                                                                        
==============================================================================
UBOS001.001 Ubuntu 22.04 is installable :: Try to install ubuntu v... | PASS |
------------------------------------------------------------------------------
Ubuntu                                                                | PASS |
1 test, 1 passed, 0 failed
==============================================================================
Debug:   /home/user/Projects/Dasharo/open-source-firmware-validation/file.txt
Output:  /home/user/Projects/Dasharo/open-source-firmware-validation/output.xml
Log:     /home/user/Projects/Dasharo/open-source-firmware-validation/log.html
Report:  /home/user/Projects/Dasharo/open-source-firmware-validation/report.html

@DaniilKl DaniilKl force-pushed the ubuntu-automatic-installation branch from f8de017 to 57aca8b Compare April 26, 2024 13:07
@DaniilKl DaniilKl force-pushed the ubuntu-automatic-installation branch from 57aca8b to a9d10c1 Compare June 27, 2024 14:57
@wiktormowinski wiktormowinski deleted the branch develop July 2, 2024 12:10
@DaniilKl DaniilKl reopened this Jul 4, 2024
@DaniilKl DaniilKl force-pushed the ubuntu-automatic-installation branch 2 times, most recently from 6ac72cf to dda8cfe Compare July 5, 2024 13:05

# Wait for Ubuntu to be installed:
# 1. Increase timeout, installation cat take a while
Set DUT Response Timeout 120m
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any data on how long it can take? Should I see any progress?
Trying on APU2, seeing just:

Specify autoinstall URL for Ubuntu noble:http://192.168.10.30
Loading Ubuntu Subiquity Network Installer...
https://github.com/netbootxyz/ubuntu-squash/releases/download/24.04-dac09526/vml
inuz.... ok 
https://github.com/netbootxyz/ubuntu-squash/releases/download/24.04-dac09526/ini
trd... ok 

MD5sums:
b194f9469b330d2fef04d07eb13ce2b6  vmlinuz
10cce5b2ac680f070f0de8a63b611e18  initrd
EFI stub: Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path
EFI stub: WARNING: Failed to obtain seed from EFI_RNG_PROTOCOL or EFI variable

Copy link
Contributor Author

@DaniilKl DaniilKl Jul 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me the longest installation time was around 20 minutes. During installation you should see a lot of installer logs on your monitor (or serial port), so in your case I guess the installation failed on chaining Ubuntu installer from iPXE.

@DaniilKl DaniilKl force-pushed the ubuntu-automatic-installation branch from dda8cfe to cc2a089 Compare July 8, 2024 07:51
@DaniilKl
Copy link
Contributor Author

DaniilKl commented Jul 8, 2024

Noticed some weird behavior on freshly auto-installed Ubuntu 24.04: it takes too much time to boot it (4-5 minutes). I have found following logs in dmesg:

(...)
[FAILED] Failed to start systemd-networkd-w… Wait for Network to be Configured.
See 'systemctl status systemd-networkd-wait-online.service' for details.
         Starting cloud-init.service - Init…t job (metadata service crawler)...
[  132.110535] cloud-init[1100]: Cloud-init v. 24.1.3-0ubuntu3.3 running 'init' at Mon, 08 Jul 2024 07:39:59 +0000. Up 132.09 seconds.
[  132.156613] cloud-init[1100]: ci-info: +++++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++++
[  132.169123] cloud-init[1100]: ci-info: +-----------+-------+-----------+-----------+-------+-------------------+
[  132.182108] cloud-init[1100]: ci-info: |   Device  |   Up  |  Address  |    Mask   | Scope |     Hw-Address    |
[  132.195117] cloud-init[1100]: ci-info: +-----------+-------+-----------+-----------+-------+-------------------+
[  132.208141] cloud-init[1100]: ci-info: |   enp3s0  | False |     .     |     .     |   .   | d8:bb:c1:8c:be:7e |
[  132.222120] cloud-init[1100]: ci-info: |     lo    |  True | 127.0.0.1 | 255.0.0.0 |  host |         .         |
[  132.236075] cloud-init[1100]: ci-info: |     lo    |  True |  ::1/128  |     .     |  host |         .         |
[  132.249070] cloud-init[1100]: ci-info: | wlp0s20f3 | False |     .     |     .     |   .   | 64:6e:e0:6b:9e:82 |
[  132.262063] cloud-init[1100]: ci-info: +-----------+-------+-----------+-----------+-------+-------------------+
[  132.275069] cloud-init[1100]: ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++
[  132.286024] cloud-init[1100]: ci-info: +-------+-------------+---------+-----------+-------+
[  132.297067] cloud-init[1100]: ci-info: | Route | Destination | Gateway | Interface | Flags |
[  132.309111] cloud-init[1100]: ci-info: +-------+-------------+---------+-----------+-------+
[  132.320068] cloud-init[1100]: ci-info: +-------+-------------+---------+-----------+-------+
         Starting modprobe@dm_mod.service - Load Kernel Module dm_mod...
         Starting modprobe@efi_pstore.servi… - Load Kernel Module efi_pstore...
         Starting [email protected] - Load Kernel Module loop...
         Starting systemd-networkd-wait-onl…ait for Network to be Configured...
(...)

It seems it tries to start systemd-networkd-wait-online for 4 minutes and fails, then it continues to boot system. What is interesting, though, the system boots with network connection configured.

I do not know what is going on but two facts are certain: the system boots significantly slower and Ubuntu 22.04 did not have such problems.

It is very interesting that incorrect pattern fails because of
underlying logic:

KEYWORD ${matches} = BuiltIn . Run Keyword And Return Status Should Match, ${item}, *${option}*
Documentation:

23:12:21.311 	TRACE 	Arguments: [ '2. AHCI/0: QEMU HARDDISK ATA-7 Hard-Disk (20480 MiBytes)' | '*[setup]*' ]
23:12:21.311 	TRACE 	Return: None
23:12:21.311 	TRACE 	Return: True
23:12:21.311 	INFO 	${matches} = True

So this one return True, but following one return False:

KEYWORD ${matches} = BuiltIn . Run Keyword And Return Status Should Match, ${item}, *${option}*
Documentation:

Fails if the given string does not match the given pattern.
Start / End / Elapsed: 	20241216 23:12:21.307 / 20241216 23:12:21.309 / 00:00:00.002
23:12:21.307 	TRACE 	Arguments: [ '1. DVD/CD [AHCI/2: QEMU DVD-ROM ATAPI-4 DVD/CD]' | '*[setup]*' ]
23:12:21.308 	FAIL 	'1. DVD/CD [AHCI/2: QEMU DVD-ROM ATAPI-4 DVD/CD]' does not match '*[setup]*'
23:12:21.309 	DEBUG 	Traceback (most recent call last):
  None
AssertionError: '1. DVD/CD [AHCI/2: QEMU DVD-ROM ATAPI-4 DVD/CD]' does not match '*[setup]*'
23:12:21.309 	TRACE 	Return: False
23:12:21.309 	INFO 	${matches} = False

Signed-off-by: Piotr Król <[email protected]>
This patch fix the problem where virtio-net by delivering its pxe rom
interfere with the fact that seabios needs empty romfile and use built
in iPXE to do network boot and work with developed tests.

Signed-off-by: Piotr Król <[email protected]>
…ers in env variables no mater the QEMU_FW_FILE

Signed-off-by: Piotr Król <[email protected]>
The current PXE003.01 test, which is supposed to check the functionality
of autoboot, does not perform as expected. The test passes based on the
appearance of a follow-up menu "Please select boot device", which varies
under SeaBIOS.

The issue arises from the lack of DHCP returning the necessary
information, leading to the "Nothing to boot iPXE error:
https://ipxe.org/err/2d03e1".

To correct this, DHCP should return a root-path and possibly combine
it with TFTP to retrieve the file. This approach is feasible in a QEMU
environment with customizable DHCP and TFTP. However, it might be more
challenging in a lab setting.

To fix above issue this commit change description of the test and make
it work for both uefi and seabios firmware.

Signed-off-by: Piotr Król <[email protected]>
@macpijan
Copy link
Contributor

Because no one has successfully repeated this yet. And for installing on hardware we mostly use this method which has worked so far: https://github.com/Dasharo/preseeds?tab=readme-ov-file#ubuntu

@DaniilKl
Copy link
Contributor Author

Because no one has successfully repeated this yet.

I have used it several times while running tests on several platforms. If smbd met any problem here - then the problem should be reported and handled accordingly.

@macpijan
Copy link
Contributor

I think I tried once or twice and reported once. Also asked @dawidlesiak many times to do so.

I guess the limitation is here that in 90% of cases we need Ubuntu to be installed alongside of Windows, not on the whole disk?

@pietrushnic
Copy link
Contributor

I guess the limitation is here that in 90% of cases we need Ubuntu to be installed alongside of Windows, not on the whole disk?

Why? Where do we get that limitation from?

I want to rebase this code on my seabios changes and try it in QEMU; what would be the best approach to that?

@DaniilKl
Copy link
Contributor Author

I want to rebase this code on my seabios changes and try it in QEMU; what would be the best approach to that?

Just rebase and run it using standard OSFV workflow for Qemu.

Hope there were no changes in netboot.xyz menu since last time I used this workflow. Otherwise, you may have problems, because, as you can see from code, currently netboot.xyz menu is hardcoded.

pietrushnic and others added 5 commits December 17, 2024 14:46
Otherwise cloud-init will be killed by OOM-Killer during installation
via netboot.xyz with autoinstall option.

Signed-off-by: Daniil Klimuk <[email protected]>
Signed-off-by: Daniil Klimuk <[email protected]>
Adds tests for installing Ubuntu 22.04 OS.

Signed-off-by: Daniil Klimuk <[email protected]>
@macpijan
Copy link
Contributor

Why? Where do we get that limitation from?

We need W11 for testing on nearly all (except for PC Engines) platforms. There is usually one disk. W11 autoinstaller needs to go first as it erases the whole disk. Then the ubuntu semi-auto installer needs to install Ubuntu alongside of Windows with manual partition selection, which we failed to automate after several attempts IIRC: Dasharo/preseeds#5

This MR also does not solve it.

@macpijan
Copy link
Contributor

If testing this on APU, be warned that at least on some of them it would not work, as the Ubuntu network ISO is already almost 3GB and would fail to load over netboot.xyz on 2GB units at least.

@pietrushnic pietrushnic force-pushed the ubuntu-automatic-installation branch from cc2a089 to 940d622 Compare December 17, 2024 22:24
@pietrushnic
Copy link
Contributor

@macpijan makes sense. For PC Engines my goal is different, I would choose more lightweight OS. I want to test this on QEMU. Then, I can move to hardware. Unfortunately, I keep going down the dependency hell, and there is no bottom to it so far.

@macpijan macpijan closed this Jul 3, 2025
@macpijan macpijan deleted the ubuntu-automatic-installation branch July 3, 2025 13:46
@macpijan macpijan restored the ubuntu-automatic-installation branch July 3, 2025 14:29
@macpijan macpijan reopened this Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants