ivandavidov / minimal

Minimal Linux Live (MLL) is a tiny educational Linux distribution, which is designed to be built from scratch by using a collection of automated shell scripts. Minimal Linux Live offers a core environment with just the Linux kernel, GNU C library, and Busybox userland utilities.
https://ivandavidov.github.io/minimal
GNU General Public License v3.0
1.52k stars 300 forks source link

Console when launching via ssh and qemu #147

Closed ghost closed 6 years ago

ghost commented 6 years ago

I found I could not launch MLL from qemu via ssh - nothing was displayed although it appears to start. This is because the console is displayed on VGA qemu-system-x86_64 -cdrom minimal_linux_live.iso -boot d -m 1024 -localtime --enable-kvm

Adding the curses option to the qemu command line fixes this by displaying the VGA text output via curses.

qemu-system-x86_64 -cdrom minimal_linux_live.iso -boot d -m 1024 -localtime --enable-kvm
 -curses

But that's kinda hacky and weird when doing ssh terminal oriented work. I wanted it to work natively in the ssh console.

To fix this you can replace MLL's default syslinux.cfg. The default syslinux.cfg looks like this:

PROMPT 1
TIMEOUT 50
DEFAULT mll

SAY
SAY   ##################################################################
SAY   #                                                                #
SAY   #  Press <ENTER> to boot Minimal Linux Live or wait 5 seconds.   #
SAY   #                                                                #
SAY   #  Press <TAB> to view available boot entries or enter Syslinux  #
SAY   #  commands directly.                                            #
SAY   #                                                                #
SAY   ##################################################################
SAY

LABEL mll
        LINUX /boot/kernel.xz
        APPEND vga=ask
        INITRD /boot/rootfs.xz

LABEL mll_nomodeset
        LINUX /boot/kernel.xz
        APPEND vga=ask nomodeset
        INITRD /boot/rootfs.xz

I don't really know why MLL is configured to use VGA for its console - presumably there is a reason but IMHO it would be better configured by default to use something other than VGA. Anyhow that's the project owner's choice of course.

To fix MLL to use a console accessible via SSH, after building MLL, go to the src directory.

Replace the ./minimal_boot/bios/boot/syslinux/syslinux.cfg with this:

SERIAL 0
DEFAULT operatingsystem
LABEL operatingsystem
    KERNEL /boot/kernel.xz console=tty0 console=ttyS0
    INITRD /boot/rootfs.xz

Then rebuild the iso without recompiling by: sh repackage.sh

You can now boot the iso via qemu using ssh and the console will be displayed within your terminal. Note that we now use the qemu 'nographic' option.

qemu-system-x86_64 -cdrom minimal_linux_live.iso -boot d -m 1024 -localtime --enable-kvm -nographic

You will then see all the startup messages and get a cli. awesome! Here's what it looks like:

root@ubuntu-s-1vcpu-1gb-nyc1-01:~/tmp/minimal/src# qemu-system-x86_64 -cdrom minimal_linux_live.iso -boot d -m 1024 -localtime --enable-kvm -nographic

ISOLINUX 6.03 2014-10-06  Copyright (C) 1994-2014 H. Peter Anvin et al
Loading /boot/kernel.xz... ok
Loading /boot/rootfs.xz...ok
[    0.000000] Linux version 4.14.12 (root@ubuntu-s-1vcpu-1gb-nyc1-01) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.6)) #4 SMP Wed Jan 31 21:49:06 UTC 2018
[    0.000000] Command line: BOOT_IMAGE=/boot/kernel.xz console=tty0 console=ttyS0 initrd=/boot/rootfs.xz
[    0.000000] x86/fpu: x87 FPU will use FXSAVE
[    0.000000] e820: BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[    0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000003ffdffff] usable
[    0.000000] BIOS-e820: [mem 0x000000003ffe0000-0x000000003fffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] random: fast init done
[    0.000000] SMBIOS 2.8 present.
[    0.000000] DMI: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014
[    0.000000] tsc: Fast TSC calibration failed
[    0.000000] tsc: Unable to calibrate against PIT
[    0.000000] tsc: No reference (HPET/PMTIMER) available
[    0.000000] e820: last_pfn = 0x3ffe0 max_arch_pfn = 0x400000000
[    0.000000] x86/PAT: PAT not supported by CPU.
[    0.000000] x86/PAT: Configuration [0-7]: WB  WT  UC- UC  WB  WT  UC- UC
[    0.000000] found SMP MP-table at [mem 0x000f6640-0x000f664f] mapped at [ffffffffff200640]
[    0.000000] Scanning 1 areas for low memory corruption
[    0.000000] RAMDISK: [mem 0x3fe64000-0x3ffdffff]
[    0.000000] ACPI: Early table checksum verification disabled
[    0.000000] ACPI: RSDP 0x00000000000F6460 000014 (v00 BOCHS )
[    0.000000] ACPI: RSDT 0x000000003FFE16EE 000034 (v01 BOCHS  BXPCRSDT 00000001 BXPC 00000001)
[    0.000000] ACPI: FACP 0x000000003FFE0C14 000074 (v01 BOCHS  BXPCFACP 00000001 BXPC 00000001)
[    0.000000] ACPI: DSDT 0x000000003FFE0040 000BD4 (v01 BOCHS  BXPCDSDT 00000001 BXPC 00000001)
[    0.000000] ACPI: FACS 0x000000003FFE0000 000040
[    0.000000] ACPI: SSDT 0x000000003FFE0C88 0009B6 (v01 BOCHS  BXPCSSDT 00000001 BXPC 00000001)
[    0.000000] ACPI: APIC 0x000000003FFE163E 000078 (v01 BOCHS  BXPCAPIC 00000001 BXPC 00000001)
[    0.000000] ACPI: HPET 0x000000003FFE16B6 000038 (v01 BOCHS  BXPCHPET 00000001 BXPC 00000001)
[    0.000000] No NUMA configuration found
[    0.000000] Faking a node at [mem 0x0000000000000000-0x000000003ffdffff]
[    0.000000] NODE_DATA(0) allocated [mem 0x3fe60000-0x3fe63fff]
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000001000-0x0000000000ffffff]
[    0.000000]   DMA32    [mem 0x0000000001000000-0x000000003ffdffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000001000-0x000000000009efff]
[    0.000000]   node   0: [mem 0x0000000000100000-0x000000003ffdffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000001000-0x000000003ffdffff]
[    0.000000] ACPI: PM-Timer IO Port: 0x608
[    0.000000] ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])
[    0.000000] IOAPIC[0]: apic_id 0, version 17, address 0xfec00000, GSI 0-23
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level)
[    0.000000] Using ACPI (MADT) for SMP configuration information
[    0.000000] ACPI: HPET id: 0x8086a201 base: 0xfed00000
[    0.000000] smpboot: Allowing 1 CPUs, 0 hotplug CPUs
[    0.000000] PM: Registered nosave memory: [mem 0x00000000-0x00000fff]
[    0.000000] PM: Registered nosave memory: [mem 0x0009f000-0x0009ffff]
[    0.000000] PM: Registered nosave memory: [mem 0x000a0000-0x000effff]
[    0.000000] PM: Registered nosave memory: [mem 0x000f0000-0x000fffff]
[    0.000000] e820: [mem 0x40000000-0xfeffbfff] available for PCI devices
[    0.000000] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1910969940391419 ns
[    0.000000] setup_percpu: NR_CPUS:64 nr_cpumask_bits:64 nr_cpu_ids:1 nr_node_ids:1
[    0.000000] percpu: Embedded 43 pages/cpu @ffff8e5dbfc00000 s137560 r8192 d30376 u2097152
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 257897
[    0.000000] Policy zone: DMA32
[    0.000000] Kernel command line: BOOT_IMAGE=/boot/kernel.xz console=tty0 console=ttyS0 initrd=/boot/rootfs.xz
[    0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[    0.000000] Memory: 1004020K/1048056K available (12300K kernel code, 1304K rwdata, 3004K rodata, 1196K init, 664K bss, 44036K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Kernel/User page tables isolation: enabled
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=1.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 4352, nr_irqs: 256, preallocated irqs: 16
[    0.000000] Console: colour VGA+ 80x25
[    0.000000] console [tty0] enabled
[    0.000000] console [ttyS0] enabled
[    0.000000] clocksource: hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604467 ns
[    0.001000] tsc: Fast TSC calibration failed
[    0.005000] tsc: Unable to calibrate against PIT
[    0.006000] tsc: HPET/PMTIMER calibration failed
[    0.007000] tsc: Marking TSC unstable due to could not calculate TSC khz
[    0.008000] Calibrating delay loop... 3538.94 BogoMIPS (lpj=1769472)
[    0.015000] pid_max: default: 32768 minimum: 301
[    0.016000] ACPI: Core revision 20170728
[    0.019000] ACPI: 2 ACPI AML tables successfully acquired and loaded
[    0.020000] Security Framework initialized
[    0.021000] SELinux:  Initializing.
[    0.022000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.024000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
[    0.025000] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
[    0.026000] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes)
[    0.029000] mce: CPU supports 10 MCE banks
[    0.030000] Last level iTLB entries: 4KB 0, 2MB 0, 4MB 0
[    0.031000] Last level dTLB entries: 4KB 0, 2MB 0, 4MB 0, 1GB 0
[    0.055000] Freeing SMP alternatives memory: 36K
[    0.057000] smpboot: Max logical packages: 1
[    0.067000] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[    0.077000] smpboot: CPU0: Intel QEMU Virtual CPU version 2.5+ (family: 0x6, model: 0x6, stepping: 0x3)
[    0.078000] Performance Events: PMU not available due to virtualization, using software events only.
[    0.080000] Hierarchical SRCU implementation.
[    0.081000] smp: Bringing up secondary CPUs ...
[    0.082000] smp: Brought up 1 node, 1 CPU
[    0.084000] smpboot: Total of 1 processors activated (3538.94 BogoMIPS)
[    0.087000] devtmpfs: initialized
[    0.088000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns
[    0.089000] futex hash table entries: 256 (order: 2, 16384 bytes)
[    0.091000] RTC time: 22:05:06, date: 01/31/18
[    0.092000] NET: Registered protocol family 16
[    0.093000] cpuidle: using governor menu
[    0.095000] ACPI: bus type PCI registered
[    0.097000] PCI: Using configuration type 1 for base access
[    0.108000] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.109000] ACPI: Added _OSI(Module Device)
[    0.110000] ACPI: Added _OSI(Processor Device)
[    0.111000] ACPI: Added _OSI(3.0 _SCP Extensions)
[    0.112000] ACPI: Added _OSI(Processor Aggregator Device)
[    0.116000] ACPI: Interpreter enabled
[    0.117000] ACPI: (supports S0 S3 S4 S5)
[    0.118000] ACPI: Using IOAPIC for interrupt routing
[    0.119000] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    0.120000] ACPI: Enabled 16 GPEs in block 00 to 0F
[    0.126000] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
[    0.127000] acpi PNP0A03:00: _OSC: OS supports [ASPM ClockPM Segments MSI]
[    0.128000] acpi PNP0A03:00: _OSC failed (AE_NOT_FOUND); disabling ASPM
[    0.129000] acpi PNP0A03:00: fail to add MMCONFIG information, can't access extended PCI configuration space under this bridge.
[    0.130000] PCI host bridge to bus 0000:00
[    0.132000] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7 window]
[    0.133000] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff window]
[    0.134000] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window]
[    0.135000] pci_bus 0000:00: root bus resource [mem 0x40000000-0xfebfffff window]
[    0.137000] pci_bus 0000:00: root bus resource [bus 00-ff]
[    0.153000] pci 0000:00:01.1: legacy IDE quirk: reg 0x10: [io  0x01f0-0x01f7]
[    0.154000] pci 0000:00:01.1: legacy IDE quirk: reg 0x14: [io  0x03f6]
[    0.155000] pci 0000:00:01.1: legacy IDE quirk: reg 0x18: [io  0x0170-0x0177]
[    0.156000] pci 0000:00:01.1: legacy IDE quirk: reg 0x1c: [io  0x0376]
[    0.161000] pci 0000:00:01.3: quirk: [io  0x0600-0x063f] claimed by PIIX4 ACPI
[    0.162000] pci 0000:00:01.3: quirk: [io  0x0700-0x070f] claimed by PIIX4 SMB
[    0.199000] ACPI: PCI Interrupt Link [LNKA] (IRQs 5 *10 11)
[    0.201000] ACPI: PCI Interrupt Link [LNKB] (IRQs 5 *10 11)
[    0.203000] ACPI: PCI Interrupt Link [LNKC] (IRQs 5 10 *11)
[    0.204000] ACPI: PCI Interrupt Link [LNKD] (IRQs 5 10 *11)
[    0.205000] ACPI: PCI Interrupt Link [LNKS] (IRQs *9)
[    0.207000] pci 0000:00:02.0: vgaarb: setting as boot VGA device
[    0.207000] pci 0000:00:02.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none
[    0.208000] pci 0000:00:02.0: vgaarb: bridge control possible
[    0.210000] vgaarb: loaded
[    0.211000] SCSI subsystem initialized
[    0.212000] ACPI: bus type USB registered
[    0.213000] usbcore: registered new interface driver usbfs
[    0.215000] usbcore: registered new interface driver hub
[    0.216000] usbcore: registered new device driver usb
[    0.218000] pps_core: LinuxPPS API ver. 1 registered
[    0.219000] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.220000] PTP clock support registered
[    0.221000] EDAC MC: Ver: 3.0.0
[    0.223000] Advanced Linux Sound Architecture Driver Initialized.
[    0.224000] PCI: Using ACPI for IRQ routing
[    0.227000] NetLabel: Initializing
[    0.229000] NetLabel:  domain hash size = 128
[    0.230000] NetLabel:  protocols = UNLABELED CIPSOv4 CALIPSO
[    0.231000] NetLabel:  unlabeled traffic allowed by default
[    0.233000] HPET: 3 timers in total, 0 timers will be used for per-cpu timer
[    0.234000] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
[    0.235000] hpet0: 3 comparators, 64-bit 100.000000 MHz counter
[    0.241000] clocksource: Switched to clocksource hpet
[    0.263188] VFS: Disk quotas dquot_6.6.0
[    0.270824] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.283196] pnp: PnP ACPI init
[    0.291178] pnp: PnP ACPI: found 6 devices
[    0.315170] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
[    0.333186] NET: Registered protocol family 2
[    0.341225] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[    0.353612] TCP bind hash table entries: 8192 (order: 5, 131072 bytes)
[    0.365197] TCP: Hash tables configured (established 8192 bind 8192)
[    0.376280] UDP hash table entries: 512 (order: 2, 16384 bytes)
[    0.386782] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[    0.398182] NET: Registered protocol family 1
[    0.406073] RPC: Registered named UNIX socket transport module.
[    0.416779] RPC: Registered udp transport module.
[    0.425306] RPC: Registered tcp transport module.
[    0.433889] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.445181] pci 0000:00:00.0: Limiting direct PCI/PCI transfers
[    0.455609] pci 0000:00:01.0: PIIX3: Enabling Passive Release
[    0.465575] pci 0000:00:01.0: Activating ISA DMA hang workarounds
[    0.474564] pci 0000:00:02.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff]
[    0.486669] Unpacking initramfs...
[    0.741201] Freeing initrd memory: 1520K
[    0.750192] Scanning for low memory corruption every 60 seconds
[    0.762186] audit: initializing netlink subsys (disabled)
[    0.773211] workingset: timestamp_bits=56 max_order=18 bucket_order=0
[    0.784745] audit: type=2000 audit(1517436305.772:1): state=initialized audit_enabled=0 res=1
[    0.810197] NFS: Registering the id_resolver key type
[    0.820197] Key type id_resolver registered
[    0.828448] Key type id_legacy registered
[    0.840183] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[    0.853115] io scheduler noop registered
[    0.860451] io scheduler deadline registered
[    0.868238] io scheduler cfq registered (default)
[    0.877210] io scheduler mq-deadline registered
[    0.885473] io scheduler kyber registered
[    0.894192] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
[    0.907465] ACPI: Power Button [PWRF]
[    0.916199] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.964208] 00:05: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[    0.980325] Non-volatile memory driver v1.3
[    0.988466] Linux agpgart interface v0.103
[    1.002195] loop: module loaded
[    1.013177] scsi host0: ata_piix
[    1.020190] scsi host1: ata_piix
[    1.027201] ata1: PATA max MWDMA2 cmd 0x1f0 ctl 0x3f6 bmdma 0xc040 irq 14
[    1.039286] ata2: PATA max MWDMA2 cmd 0x170 ctl 0x376 bmdma 0xc048 irq 15
[    1.055190] e100: Intel(R) PRO/100 Network Driver, 3.5.24-k2-NAPI
[    1.066273] e100: Copyright(c) 1999-2006 Intel Corporation
[    1.076142] e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI
[    1.088587] e1000: Copyright (c) 1999-2006 Intel Corporation.
[    1.127194] ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 11
[    1.217731] ata2.00: ATAPI: QEMU DVD-ROM, 2.5+, max UDMA/100
[    1.243720] ata2.00: configured for MWDMA2
[    1.264455] scsi 1:0:0:0: CD-ROM            QEMU     QEMU DVD-ROM     2.5+ PQ: 0 ANSI: 5
[    1.305324] sr 1:0:0:0: [sr0] scsi3-mmc drive: 4x/4x cd/rw xa/form2 tray
[    1.317546] cdrom: Uniform CD-ROM driver Revision: 3.20
[    1.350244] sr 1:0:0:0: Attached scsi generic sg0 type 5
[    2.005181] e1000 0000:00:03.0 eth0: (PCI:33MHz:32-bit) 52:54:00:12:34:56
[    2.018254] e1000 0000:00:03.0 eth0: Intel(R) PRO/1000 Network Connection
[    2.031187] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[    2.042076] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    2.053150] sky2: driver version 1.30
[    2.062192] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    2.074208] ehci-pci: EHCI PCI platform driver
[    2.082777] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    2.094077] ohci-pci: OHCI PCI platform driver
[    2.102734] uhci_hcd: USB Universal Host Controller Interface driver
[    2.115197] usbcore: registered new interface driver usblp
[    2.126075] usbcore: registered new interface driver usb-storage
[    2.137321] i8042: PNP: PS/2 Controller [PNP0303:KBD,PNP0f13:MOU] at 0x60,0x64 irq 1,12
[    2.157208] serio: i8042 KBD port at 0x60,0x64 irq 1
[    2.168142] serio: i8042 AUX port at 0x60,0x64 irq 12
[    2.180252] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input1
[    2.197237] rtc_cmos 00:00: RTC can wake from S4
[    2.217281] rtc_cmos 00:00: rtc core: registered rtc_cmos as rtc0
[    2.236212] rtc_cmos 00:00: alarms up to one day, 114 bytes nvram, hpet irqs
[    2.248190] IR NEC protocol handler initialized
[    2.257527] IR RC5(x/sz) protocol handler initialized
[    2.267377] IR RC6 protocol handler initialized
[    2.275875] IR JVC protocol handler initialized
[    2.284589] IR Sony protocol handler initialized
[    2.293254] IR SANYO protocol handler initialized
[    2.302115] IR Sharp protocol handler initialized
[    2.311115] IR MCE Keyboard/mouse protocol handler initialized
[    2.321918] IR XMP protocol handler initialized
[    2.330465] device-mapper: ioctl: 4.37.0-ioctl (2017-09-20) initialised: dm-devel@redhat.com
[    2.346285] hidraw: raw HID events driver (C) Jiri Kosina
[    2.360189] usbcore: registered new interface driver usbhid
[    2.370839] usbhid: USB HID core driver
[    2.380217] Netfilter messages via NETLINK v0.30.
[    2.389649] nf_conntrack version 0.5.0 (8192 buckets, 32768 max)
[    2.401192] ctnetlink v0.93: registering with nfnetlink.
[    2.411744] ip_tables: (C) 2000-2006 Netfilter Core Team
[    2.422174] Initializing XFRM netlink socket
[    2.431182] NET: Registered protocol family 10
[    2.445214] Segment Routing with IPv6
[    2.452890] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    2.462125] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    2.472138] NET: Registered protocol family 17
[    2.479852] Key type dns_resolver registered
[    2.488199] registered taskstats version 1
[    2.496158]   Magic number: 2:148:99
[    2.504177] console [netcon0] enabled
[    2.511502] netconsole: network logging started
[    2.520144] ALSA device list:
[    2.526203]   No soundcards found.
[    2.537181] Freeing unused kernel memory: 1196K
[    2.546194] Write protecting the kernel read-only data: 18432k
[    2.558181] Freeing unused kernel memory: 2004K
[    2.570188] Freeing unused kernel memory: 1092K
Welcome to Minimal Linux Live (/init)
Most kernel messages have been suppressed.
Mounted all core filesystems. Ready to continue.

  Press empty key (TAB, SPACE, ENTER) or wait 5 seconds to continue with the
  overlay initialization process. Press any other key for PID 1 rescue shell
  inside the initramfs area.

Created folders for all critical file systems.
Copying the root file system to /mnt.
Searching available devices for overlay content.
  Found /minimal folder on device /dev/sr0.
  Device /dev/sr0 is mounted in read only mode.
  Overlay data from device /dev/sr0 has been merged.
Mount locations /dev, /sys, /tmp and /proc have been moved to /mnt.

                                                                                                           VGA Blank mode
Switching from initramfs root area to overlayfs root area.

  Press empty key (TAB, SPACE, ENTER) or wait 5 seconds to continue with the
  system initialization process. Press any other key for PID 1 rescue shell
  outside of the initramfs area.

Executing /sbin/init as PID 1.
Welcome to Minimal Linux Live (/sbin/init)
Executing /etc/autorun/20_network.sh in subshell.
Found network device eth0
udhcpc: started, v1.27.2
udhcpc: sending discover
udhcpc: sending select for 10.0.2.15
udhcpc: lease of 10.0.2.15 obtained, lease time 86400
DHCP configuration for device eth0
IP:     10.0.2.15
mask:   24
router: 10.0.2.2
Found network device lo
Found network device sit0
udhcpc: started, v1.27.2
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: no lease, forking to background
Executing /etc/autorun/90_src.sh in subshell.
  You can find all sources in '/usr/src'.

  ###################################
  #                                 #
  #  Welcome to Minimal Linux Live  #
  #                                 #
  ###################################

/ #
TechnologyClassroom commented 6 years ago

Could this be rewritten and worked into the doc directory somewhere or as src/qemu-ssh.sh?

ghost commented 6 years ago

@TechnologyClassroom any idea why it uses VGA for the console? Is there a particular reason?

TechnologyClassroom commented 6 years ago

VGA is a very standard way to get a display on a large number of bare metal systems and VMs. I have never seen anyone boot like you did, but I think it is cool, useful, and worth mentioning.

ghost commented 6 years ago

VGA is a very standard way to get a display on a large number of bare metal systems and VMs

Yes that makes sense.

ivandavidov commented 6 years ago

@bootrino - your research is impressive!

MLL uses vga=ask only for demonstration purpose. This approach is the easiest and the most compatible way to provide basic graphical console support with the VESA framebuffer driver. The default wait timeout of 30 seconds comes either from the boot loader or from the kernel (I never researched this) and I'm not sure if it can be changed at all.

The first time I found out that MLL can be run in pure "QEMU console" mode was approximately 3 years ago. Back then I found @coopermaa's Docker solution:

https://github.com/coopermaa/my-docker-library/blob/master/minimal-linux-live/run

https://hub.docker.com/r/coopermaa/minimal-linux-live/~/dockerfile/

Till now I wasn't aware that we can provide more than one console argument in the kernel invocation parameters. This means that MLL's default boot behavior could be changed slightly to provide console output on both tty0 and ttyS0 and as @TechnologyClassroom suggested, there could be additional qemu-console helper script in order to automate the "QEMU console" mode.

I will leave this issue opened for further refining of this idea.

ghost commented 6 years ago

Yes you can output boot messages to multiple consoles, but there can be only one /dev/console that displays a root signin prompt as far as I am aware.

It must be possible for the system to start with login prompts on all consoles via operating system configuration rather than syslinux.cfg configuration, but I don't know how. Something to do with getty setup?

The ideal would be a configuration that automatically outputs to both serial and VGA and automatically displays to both serial and VGA but I have not yet found a way to do that.

If you go to this link, to Examples/Multiplexing mode http://cc.bingj.com/cache.aspx?q=qemu+console+device+ttys0+site%3anairobi-embedded.org&d=4760083908069298&mkt=en-US&setlang=en-US&w=KXdO9hLXzjx0orlwzDMp4vgQCN_LVlLk

Find the text on that page that says this: To allow login on both the UART (/dev/ttyS0) and USB-serial (/dev/ttyUSB0), the following files were prepared in the guest before booting with the QEMU command line shown above:

It seems to indicate how to have /dev/console on multiple devices but I could not make it work.

ivandavidov commented 6 years ago

I have implemented the option to run MLL in QEMU console mode here. Note that the console mode works fine only if you override the default boot entry with the console boot entry.

The defaults work fine (nothing has changed) and the new QEMU console script seems to work fine, provided that the user enters the console boot entry.