bhyve Linux Live CD Guest no login prompt

I'm playing around with bhyve. I want to run a small Linux guest as a VM. I'm loading the hypervisor with the following commands. The system presents the Grub screen. It then goes on to load the Linux kernel but then just hangs after a short while.

Code:
(cd0) /mnt/void-live-i686-20191109.iso

Code:
! /bin/sh
grub-bhyve -m device.map -r cd0 -M 512M linuxguest
bhyve -AHP -c 1 -m 512M -l com1,stdio -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap0 -s 3,ahci-cd,/mnt/void-live-i686-20191109.iso linuxguest

Please note I haven't any virtio block device setup. I simply want to boot the Live CD for now.
 
Does the Live CD actually have a serial console enabled? Most of the time Linux doesn't have this enabled, not by default at least.
 

Going according to this wiki serial console may not be enabled by default. I passed the parameter to the kernel at bootup:
Code:
console=ttyAMA0,115200

The VM still becomes unresponsive at bootup. I wonder if this is sufficient to enable serial console?
 
You may need to add a sleep statement to your startup script. With virtualized Devuan I have to allow grub to timeout before I can start bhyve.
Try sleep 10 in between your two lines or manually run the commands.
I could probably set grub to timeout to sooner but I just wait it out with a pause.
 
Thanks, I get the same errors as before. By removing the quiet parameter, the output is:
Code:
[    6.271145] ata1.00: qc timeout (cmd 0xa1)
[    6.272191] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[    6.602104] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[   16.674595] ata1.00: qc timeout (cmd 0xa1)
[   16.678034] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[   16.682600] ata1: limiting SATA link speed to 3.0 Gbps
[   17.011511] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 320)
[   47.400210] ata1.00: qc timeout (cmd 0xa1)
[   47.403670] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[   47.745010] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 320)
[   47.750075] Freeing unused kernel image memory: 616K
[   47.754007] Write protecting kernel text and read-only data: 7368k
[   47.758626] rodata_test: all tests were successful
[   47.762341] Run /init as init process
Alpine Init 3.4.5-r3
 * Loading boot drivers: [   47.808706] loop: module loaded
[   47.820204] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[   47.855651] ACPI: bus type USB registered
[   47.858908] usbcore: registered new interface driver usbfs
[   47.863049] usbcore: registered new interface driver hub
[   47.867127] usbcore: registered new device driver usb
[   47.880856] usbcore: registered new interface driver usb-storage
ok.
 * Mounting boot media: [   47.953270] virtio-pci 0000:00:02.0: virtio_pci: leaving for legacy driver
failed. 
initramfs emergency recovery shell launched. Type 'exit' to continue boot
sh: can't access tty; job control turned off
/ #

I don't have a virtio_pci setting. Could be my config is incorrect.
 

Attachments

  • vm_linux.jpg
    vm_linux.jpg
    384.1 KB · Views: 127
Maybe it's waiting for something, this was my first test:
Code:
root@hosaka:~ # vm create -d stor10k -c 2 -m 4096M -t debian void-test
root@hosaka:~ # vm iso https://alpha.de.repo.voidlinux.org/live/current/void-live-x86_64-20191109.iso
/vm/.iso/void-live-x86_64-20191109.iso                 411 MB   18 MBps    22s
root@hosaka:~ # vm install void-test void-live-x86_64-20191109.iso
Starting void-test
  * found guest in /storage/vm/void-test
  * booting...
root@hosaka:~ # vm console void-test
Connected

- runit: $Id: 25da3b86f7bed4038b8a039d2f8e8c9bbcf0822b $: booting.
- runit: enter stage: /etc/runit/1
=> Welcome to Void!
=> Mounting pseudo-filesystems...
=> Loading kernel modules...

=> Starting udev and waiting for devices to settle...
=> Setting up keymap to 'us'...
=> Remounting rootfs read-only...
=> Activating btrfs devices...
Scanning for Btrfs filesystems
=> Activating LVM devices...
=> Activating encrypted devices...
=> Activating LVM devices for dm-crypt...
=> Checking filesystems:
=> Mounting rootfs read-write...
=> Mounting all non-network filesystems...
=> Initializing swap...
=> Initializing random seed...
=> Setting up loopback interface...
=> Setting up hostname to 'void-live'...
=> Loading sysctl(8) settings...
* Applying /usr/lib/sysctl.d/10-void.conf ...
kernel.core_uses_pid = 1
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
kernel.kptr_restrict = 1
kernel.dmesg_restrict = 1
kernel.perf_event_paranoid = 2
kernel.kexec_load_disabled = 1
kernel.yama.ptrace_scope = 1
* Applying /etc/sysctl.conf ...
=> Initialization complete, running stage 2...
- runit: leave stage: /etc/runit/1
- runit: enter stage: /etc/runit/2
runsvchdir: default: current.
Then it appeared to be stuck. It does respond to vm stop so something is working there (I would have to use "poweroff" if it was really hung up). I picked the Debian template as that seemed the most "common".

So, after I made some changes, used graphics and the UEFI boot I got this:
void-linux.png

Booting without graphics seems to be stuck in "blind mode":
Code:
error: no suitable video mode found.
Booting in blind mode
 
-SirDice-
OK this is the same result I'm getting. Incidentally, how do you enable video mode?

(1) Nevermind Void Linux, it's too heavy on resources and complains from the outset with 1x vcore and 128M RAM.
(2) Debian ISO works but the netinstall ISO isn't a Live image so I'll leave this one too.

(3) I've also been trying to boot the Alpine-virt x86 ISO image which accepts low system resources but then halts when trying to mount boot media (as shown in my last post). Could you help me with this instead?
 
As you may have noticed I use vm(8) (sysutils/vm-bhyve) to create my bhyve VMs. Enabling graphics just requires me to add graphics="yes" to the VM's configuration. From its log files I can see it's started like this:
Code:
Jan 14 22:24:33:  [loader: uefi]
Jan 14 22:24:33:  [cpu: 2]
Jan 14 22:24:33:  [memory: 4096M]
Jan 14 22:24:33:  [hostbridge: standard]
Jan 14 22:24:33:  [com ports: com1]
Jan 14 22:24:33:  [uuid: c1fe6f26-56a4-11eb-bcdc-002590f15838]
Jan 14 22:24:33:  [utctime: yes]
Jan 14 22:24:33:  [debug mode: no]
Jan 14 22:24:33:  [primary disk: disk0]
Jan 14 22:24:33:  [primary disk dev: sparse-zvol]
Jan 14 22:24:33: initialising network device tap13
Jan 14 22:24:33: setting mtu of tap13 to 9000
Jan 14 22:24:33: adding tap13 -> vm-public (public addm)
Jan 14 22:24:33: bring up tap13 -> vm-public (public addm)
Jan 14 22:24:33: dynamically allocated port 5902 for vnc connections
Jan 14 22:24:33: booting
Jan 14 22:24:33:  [bhyve options: -c 2 -m 4096M -Hwl bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -U c1fe6f26-56a4-11eb-bcdc-002590f15838 -u]
Jan 14 22:24:33:  [bhyve devices: -s 0,hostbridge -s 31,lpc -s 4:0,virtio-blk,/dev/zvol/stor10k/DATA/vm/void-test/disk0 -s 5:0,virtio-net,tap13,mac=58:9c:fc:01:ce:e4 -s 6:0,fbuf,tcp=0.0.0.0:5902,wait]
Jan 14 22:24:33:  [bhyve console: -l com1,/dev/nmdm-void-test.1A]
Jan 14 22:24:33:  [bhyve iso device: -s 3:0,ahci-cd,/vm/.iso/void-live-x86_64-20191109.iso,ro]
Jan 14 22:24:33: starting bhyve (run 1)
It's the -s 6:0,fbuf,tcp=0.0.0.0:5902,wait part that spawns the VNC interface.

Alpine seems to be a bit tricky: https://github.com/churchers/vm-bhyve/wiki/Supported-Guest-Examples
 
These are the last few lines of the boot sequence. Where is the login prompt and how can I get it??

Code:
[    0.873660] ata1: SATA max UDMA/133 abar m1024@0xc0002000 port 0xc0002100 irq 32
[    0.875381] ata2: DUMMY
[    0.876079] ata3: DUMMY
[    0.876794] ata4: DUMMY
[    0.877517] ata5: DUMMY
[    0.878214] ata6: DUMMY
[    0.878970] i8042: PNP: PS/2 Controller [PNP0303:KBD,PNP0f13:MOU] at 0x60,0x64 irq 1,12
[    0.881049] i8042: Warning: Keylock active
[    0.883096] serio: i8042 KBD port at 0x60,0x64 irq 1
[    0.884321] serio: i8042 AUX port at 0x60,0x64 irq 12
[    0.886657] input: AT Raw Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
[    0.889162] rtc_cmos 00:05: registered as rtc0
[    0.890334] rtc_cmos 00:05: alarms up to one day, y3k, 114 bytes nvram
[    0.891985] intel_pstate: CPU model not supported
[    0.893224] gre: GRE over IPv4 demultiplexor driver
[    0.894465] Key type dns_resolver registered
[    0.895611] IPI shorthand broadcast: enabled
[    0.896765] sched_clock: Marking stable (762068140, 133507697)->(908263563, -12687726)
[    0.898967] registered taskstats version 1
[    0.900025] Loading compiled-in X.509 certificates
[    0.903265] Loaded X.509 cert 'Build time autogenerated kernel key: 293f9679c3fe055edb32e984117ac2fb11393dd5'
[    0.905662] Key type ._fscrypt registered
[    0.906709] Key type .fscrypt registered
[    0.907988] rtc_cmos 00:05: setting system clock to 2021-01-15T09:06:37 UTC (1610701597)
[    1.225658] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[    1.826945] tsc: Refined TSC clocksource calibration: 2398.250 MHz
[    1.828357] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x2291c253fe1, max_idle_ns: 440795314382 ns
[    1.830691] clocksource: Switched to clocksource tsc
[    6.221535] ata1.00: qc timeout (cmd 0xa1)
[    6.222631] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[    6.564766] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[   16.635178] ata1.00: qc timeout (cmd 0xa1)
[   16.639179] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[   16.644350] ata1: limiting SATA link speed to 3.0 Gbps
[   16.973066] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 320)
[   47.343421] ata1.00: qc timeout (cmd 0xa1)
[   47.346887] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[   47.685830] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 320)
[   47.690922] Freeing unused kernel image memory: 616K
[   47.694804] Write protecting kernel text and read-only data: 7368k
[   47.699394] rodata_test: all tests were successful
[   47.703131] Run /init as init process
Alpine Init 3.4.5-r3
 * Loading boot drivers: [   47.749115] loop: module loaded
[   47.760471] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[   47.795851] ACPI: bus type USB registered
[   47.799125] usbcore: registered new interface driver usbfs
[   47.803298] usbcore: registered new interface driver hub
[   47.807388] usbcore: registered new device driver usb
[   47.821051] usbcore: registered new interface driver usb-storage
ok.
 * Mounting boot media: [   47.893856] virtio-pci 0000:00:02.0: virtio_pci: leaving for legacy driver
[   47.896592] virtio-pci 0000:00:04.0: virtio_pci: leaving for legacy driver
[   47.935799] virtio_blk virtio1: [vda] 41943040 512-byte logical blocks (21.5 GB/20.0 GiB)
 
This is peculiar. I don't understand why I'm not presented with a login prompt. I am passing these parameters to the kernel:
Code:
console=tty0 console=ttyS0,115200
 
How about using a nmdm(4) device instead of using stdio. nmdm is what I use.
Code:
/usr/local/sbin/grub-bhyve -m /vm/device.map -r hd0,msdos1 -M 4096M -S devuan1 -d /boot/grub/ &
bhyve -S -c 2 -m 4G -A -H -P -u -s 0:0,hostbridge -s 3:0,ahci-hd,/vm/devuan1.img -s 5:0,passthru,131/0/3 -s 31:0,lpc -l com1,/dev/nmdm5A devuan1
Run the terminal from the host:
cu -l /dev/nmdm5B

device.map
Code:
(hd0) /vm/devuan1.img
(cd0) /vm/devuan_ascii_2.1_amd64_netinst.iso
 
^^^ I've tried this too but it doesn't work either.

Code:
user@bsd:~ $ sudo ./vm_run
Password:
rdmsr to register 0x140 on vcpu 0
wrmsr to register 0x140(0) on vcpu 0
rdmsr to register 0x64e on vcpu 0
rdmsr to register 0x34 on vcpu 0

Code:
user@bsd:~ $ sudo cu -l /dev/nmdm0B
Connected
[   47.358149] ata1.00: qc timeout (cmd 0xa1)
[   47.362481] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[   47.703208] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 320)
[   47.709143] Freeing unused kernel image memory: 616K
[   47.713415] Write protecting kernel text and read-only data: 7368k
[   47.718406] rodata_test: all tests were successful
[   47.722313] Run /init as init process
Alpine Init 3.4.5-r3
 * Loading boot drivers: [   47.770381] loop: module loaded
[   47.781958] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[   47.817714] ACPI: bus type USB registered
[   47.821307] usbcore: registered new interface driver usbfs
[   47.825793] usbcore: registered new interface driver hub
[   47.830224] usbcore: registered new device driver usb
[   47.844285] usbcore: registered new interface driver usb-storage
ok.
 * Mounting boot media: [   47.943875] virtio-pci 0000:00:02.0: virtio_pci: leaving for legacy driver
[   47.950140] virtio-pci 0000:00:04.0: virtio_pci: leaving for legacy driver
[   48.028324] virtio_blk virtio1: [vda] 2097152 512-byte logical blocks (1.07 GB/1.00 GiB)

Clearly it's not a coincidence. There is one thing I seem to be doing wrong.

Code:
#! /bin/sh
grub-bhyve -m device.map -r cd0 -M 128M linuxguest
#bhyve -AHPDHw -c 1 -m 128M -l com1,stdio -s 0,hostbridge -s 1,lpc -s 2,virtio-net,tap0 -s 3,ahci-cd,/mnt/alpine-virt-3.12.3-x86.iso -s 4,virtio-blk,/mnt/vm_bhyve/linuxguest/disk0.img linuxguest
bhyve -AHPDHw -c 1 -m 128M -l com1,/dev/nmdm0A -s 0,hostbridge -s 1,lpc -s 2,virtio-net,tap0 -s 3,ahci-cd,/mnt/alpine-virt-3.12.3-x86.iso -s 4,virtio-blk,/mnt/vm_bhyve/linuxguest/disk0.img linuxguest

Been following the wiki as per:

 
Stuck at mounting boot media. Kernel parameters are loaded with:

Code:
linux /boot/vmlinuz-virt modules=loop,squashfs,sd-mod,usb-storage,sr-mod console=tty0 console=ttyS0,115200"
initrd /boot/initramfs-virt

ISO is a live-cd and features a squashfs.
 
I'm using the 32-bit image. 64-bit ISO works and boots successfully.
Now my question is why is this the case??
 
Back
Top