Now that the vyos-router startup script also probes for a GRUB serial console, this heavily breaks VyOS running as native container image in e.g. containerlab or whereever else.
The most prominent issue is that the vyos system user is not created as the init script responsible for the CLI fails.
Traceback (most recent call last):
File "/usr/libexec/vyos/conf_mode/system_console.py", line 157, in <module>
generate(c)
File "/usr/libexec/vyos/conf_mode/system_console.py", line 95, in generate
grub_util.update_serial_console(*default_tty_console)
File "/usr/lib/python3/dist-packages/vyos/system/image.py", line 275, in wrapper
ret = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/vyos/system/grub_util.py", line 54, in update_serial_console
set_serial_console(console_type, console_num, console_speed, root_dir)
File "/usr/lib/python3/dist-packages/vyos/system/compat.py", line 345, in wrapper
render_grub_cfg()
File "/usr/lib/python3/dist-packages/vyos/system/compat.py", line 335, in render_grub_cfg
fields = grub_cfg_fields(root_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/vyos/system/compat.py", line 311, in grub_cfg_fields
menu_entries = update_version_list(root_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/vyos/system/compat.py", line 257, in update_version_list
menu_entries = parse_menuentries(grub_cfg_main)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/vyos/system/compat.py", line 162, in parse_menuentries
config_text = Path(grub_path).read_text()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/pathlib.py", line 1059, in read_text
with self.open(mode='r', encoding=encoding, errors=errors) as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/pathlib.py", line 1045, in open
return io.open(self, mode, buffering, encoding, errors, newline)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '//boot/grub/grub.cfg'