You are not logged in.
Hi,
I wonder if it is possible to boot Alpine Linux by systemd-nspawn.
The Alpine user mailing list can't help with this.
• root@archlinux /home/rocketmouse
# systemd-nspawn -bqD /mnt/m1.alpine
OpenRC 0.47.1 is starting up Linux 6.3.5-arch1-1 (x86_64) [SYSTEMD-NSPAWN]
* /proc is already mounted
* /run/openrc: creating directory
* /run/lock: creating directory
* /run/lock: correcting owner
* Caching service dependencies ... [ ok ]
* Loading hardware drivers ... [ ok ]
* Creating user login records ... [ ok ]
* Setting hostname ... [ ok ]
* Setting keymap ...
loadkmap: can't open console [ !! ]
* ERROR: loadkmap failed to start
* Loading modules ... [ ok ]
* Starting networking ...
* lo ... [ ok ]
* eth0 ...
ip: ioctl 0x8913 failed: No such device
udhcpc: ioctl 0x8933 failed: No such device
ifup: failed to change interface eth0 state to 'up' [ !! ]
* Starting busybox syslog ... [ ok ]
* Setting keymap ...
loadkmap: can't open console [ !! ]
* ERROR: loadkmap failed to start
* Starting busybox acpid ... [ ok ]
* Starting busybox crond ... [ ok ]
can't open /dev/tty1: No such file or directory
can't open /dev/tty2: No such file or directory
can't open /dev/tty3: No such file or directory
can't open /dev/tty4: No such file or directory
can't open /dev/tty5: No such file or directory
can't open /dev/tty6: No such file or directory
can't open /dev/tty1: No such file or directory
[snip]
can't open /dev/tty6: No such file or directory
can't open /dev/tty1: No such file or directory
[snip]
can't open /dev/tty6: No such file or directory
can't open /dev/tty1: No such file or directory
[snip]
It's caught in an endless "can't open /dev/tty" loop.
Any ideas?
Regards,
Ralf
Offline
Well - on the one hand you try to use systemd
Note: systemd-nspawn requires that the operating system in the container uses systemd init (has it running as PID 1) and systemd-nspawn is installed in the container. These requirements can be satisfied by making sure the systemd-container package is installed on the container system. The systemd-container package depends on dbus, which is not installed by default. Make sure the dbus or dbus-broker package is installed on the container system.
and Alpine uses OpenRC. It shouldn't work this way - by design.
Offline
Thank you,
so I'll stay with pure chroot without steroids.
Regards,
Ralf
Offline
Actually, you can do it.
In your log the openrc can't open `/dev/tty`, just comment out the lines in `/etc/inittab` and add this line
console::respawn:/sbin/getty 38400 console
And here it is:
OpenRC 0.55.1 is starting up Linux 6.12.9-zen1-1-zen (x86_64)
* /proc is already mounted
* /run/openrc: creating directory
* /run/lock: creating directory
* /run/lock: correcting owner
* Caching service dependencies ...
Service 'hwdrivers' needs non existent service 'dev'
Service 'machine-id' needs non existent service 'dev' [ ok ]
Welcome to Alpine Linux 3.21
Kernel 6.12.9-zen1-1-zen on an x86_64 (/dev/console)
Offline