Solved vm bhyve arch linux

Hi Guys,

for a while now I am hitting a wall while trying to set up an Arch Linux VM. I followed many guides to install this in vm bhyve, but no matter what i do i hit the brick wall at:

Code:
/usr/bin/ash: error while loading shared libraries: libcrypt.so.2: cannot open shared object file: No such file or directory

and subsequently hitting a panic
Code:
[    0.703319] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
[    0.703507] CPU: 0 UID: 0 PID: 1 Comm: init Not tainted 6.14.9-arch1-1 #1 b1f151dd96221c005b8930ad08f5fe03d2956910
[    0.703758] Hardware name: FreeBSD BHYVE/BHYVE, BIOS 14.0 10/17/2021
[    0.703915] Call Trace:
[    0.703982]  <TASK>
[    0.704042]  dump_stack_lvl+0x5d/0x80
[    0.704139]  panic+0x118/0x2db
[    0.704224]  do_exit.cold+0x3e/0x58
[    0.704316]  ? srso_alias_return_thunk+0x5/0xfbef5
[    0.704438]  do_group_exit+0x2d/0xc0
[    0.704533]  __x64_sys_exit_group+0x18/0x20
[    0.704639]  x64_sys_call+0xff0/0x1500
[    0.704736]  do_syscall_64+0x7b/0x190
[    0.704835]  ? __wake_up+0x44/0x60
[    0.704926]  ? srso_alias_return_thunk+0x5/0xfbef5
[    0.705048]  ? file_tty_write.isra.0+0x20c/0x2c0
[    0.705171]  ? srso_alias_return_thunk+0x5/0xfbef5
[    0.705292]  ? do_iter_readv_writev+0x153/0x250
[    0.705410]  ? srso_alias_return_thunk+0x5/0xfbef5
[    0.705532]  ? vfs_writev+0xe9/0x3b0
[    0.705629]  ? do_writev+0x84/0x120
[    0.705721]  ? srso_alias_return_thunk+0x5/0xfbef5
[    0.705844]  ? do_writev+0x84/0x120
[    0.705937]  ? srso_alias_return_thunk+0x5/0xfbef5
[    0.706060]  ? syscall_exit_to_user_mode+0x37/0x1c0
[    0.706186]  ? srso_alias_return_thunk+0x5/0xfbef5
[    0.706307]  ? do_syscall_64+0x87/0x190
[    0.706407]  ? alloc_fd+0x12d/0x190
[    0.706500]  ? put_unused_fd+0x2a/0x70
[    0.706599]  ? srso_alias_return_thunk+0x5/0xfbef5
[    0.706721]  ? do_sys_openat2+0x96/0xe0
[    0.706823]  ? srso_alias_return_thunk+0x5/0xfbef5
[    0.706946]  ? srso_alias_return_thunk+0x5/0xfbef5
[    0.707069]  ? syscall_exit_to_user_mode+0x37/0x1c0
[    0.707194]  ? srso_alias_return_thunk+0x5/0xfbef5
[    0.707316]  ? do_syscall_64+0x87/0x190
[    0.707416]  ? srso_alias_return_thunk+0x5/0xfbef5
[    0.707538]  ? srso_alias_return_thunk+0x5/0xfbef5
[    0.707661]  ? irqentry_exit_to_user_mode+0x2c/0x1b0
[    0.707789]  entry_SYSCALL_64_after_hwframe+0x76/0x7e
[    0.707920] RIP: 0033:0x7f057ea8a8f7
[    0.708015] Code: 00 00 00 b8 ca 00 00 00 0f 05 c3 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 66 66 2e 0f 1f 84 00 00 00 00 00 90 b8 e7 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 09 f4 eb ee 66 0f 1f 44 00 00 f7 d8 89 05 90
[    0.708460] RSP: 002b:00007ffd764d01f8 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7
[    0.708648] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f057ea8a8f7
[    0.708826] RDX: 000000000000000a RSI: 00007ffd764cf8c0 RDI: 000000000000007f
[    0.709004] RBP: 00007ffd764d02d0 R08: 0000000000000001 R09: 0000000000000019
[    0.709180] R10: 00007f057ea9e300 R11: 0000000000000202 R12: 00007f057ea5d01f
[    0.709357] R13: 0000000000000000 R14: 0000000000000000 R15: 00007f057ea5d030
[    0.709535]  </TASK>
[    0.709630] Kernel Offset: 0x14000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[    0.709893] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00 ]---

It just dont want to boot. I tried with a generic uefi vm as well, but hit other problems as well. Anyone lately did succeed to create an arch vm?

best
Stefan
 
For Arch, using vm-bhyve, rather than bhyve, my config that worked is

loader="uefi"
graphics="yes"
graphics_res="1920x1080"
xhci_mouse="yes"
cpu=1
memory="4096"
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk
"disk0_name="disk0.img"
uuid="4cce4348-48aa-11f0-b119-b0416f14e95f"
network0_mac="58:9c:fc:0e:ff:66"

uuid and net mac are assigned arbitrarily by vm-bhyve. If you want sound you can add
Code:
bhyve_options="-s 8,hda,play=/dev/dsp"

One can also have more cpus and more (or less) memory.

It is taken from a centos7 template that I use for most Linux vms I make with a gui.
 
I followed many guides to install this in vm bhyve
Do you have links please, thanks.

Agree with scottro, bhyve is powerful and sysutils/vm-bhyve makes it more friendly, if you can deal with bhyve options on your own it's fine but if you are struggling sysutils/vm-bhyve is an alternative, that's what I do personally.
I've just finished an Arch Linux installation to test and I can confirm that it works (it's been years since I install an archlinux and it feels it's never been easier than today they improved their install script a lot which is a good thing), the template I used is mostly the same one showed by scottro, except for disk_type that is replaced by nvme because it supposed to be quicker.
Other than that, I pick net/tigervnc-viewer to get into the VM and that's basically it.
 
I add that the following bhyve command line works for booting the installation media:

bhyve -AHP -c 1 -m 2G -s 0,hostbridge -s 1,nvme,/data/kvm/vm/arch/disk -s 2,ahci-cd,/data/kvm/vm/arch/arch-2025.iso -s 31,lpc -s 29,xhci,tablet -s 30,fbuf,tcp=0.0.0.0:5900 -s 3,virtio-net,tapARCH -l bootrom,/data/kvm/BHYVE_UEFI.fd,/data/kvm/vm/arch/UEFI_VARS.fd arch

/data/kvm/vm/arch/disk is just a file (truncate(1), 10 GiB).
tapARCH is a tap(4), member of a bridge(4) where my host ethernet interface is equally a member.
/data/kvm/BHYVE_UEFI.fd is a copy of the UEFI bhyve firmware of sysutils/edk2.
/data/kvm/vm/arch/UEFI_VARS.fd is a copy of the UEFI vars you find in sysutils/edk2.
 
I got it working finally with vm bhyve. Reading the logfile just helps I noticed. I forgot to install bhyve-firmware...

Thanks guys arch is now up and running.
 
Back
Top