bhyve - Running Centos7 on FreeBSD

henninb

New Member


Messages: 8

I am very close to getting Centos7 (version 1503) running on FreeBSD 11.1 with bhyve, but I am stuck. I have used the following instructions for installation. Please let me know if you can advice how to address the /dev/mapper/centos-root issue or an alternative way to get Centos7 running in bhyve.

01. sudo pkg install vm-bhyve grub2-bhyve

02. sudo vi /etc/rc.conf
Code:
vm_enable="YES"
vm_dir="/vm"
03. sudo vm init
04. sudo cp /usr/local/share/examples/vm-bhyve/* /vm/.templates/
05. sudo vm switch create public
06. sudo vm switch add public alc0
07. vm iso CentOS-7-x86_64-Minimal-1503-01.iso
08. sudo vm create centos7
09. sudo vm -f install centos7 CentOS-7-x86_64-Minimal-1503-01.iso

10. sudo vi /vm/centos/centos7.conf # updated kernel version
Code:
    /vmlinuz-3.10.0-229.el7.x86_64
    /initramfs-3.10.0-229.el7.x86_64.img
11. sudo vm -f start centos7
Code:
[  OK  ] Reached target Basic System.
[    0.812167]  vda: vda1 vda2 vda3
[    1.260077] input: PS/2 Generic Mouse as /devices/platform/i8042/serio1/input/input2
[    1.472683] tsc: Refined TSC clocksource calibration: 3196.809 MHz
[    1.473214] Switching to clocksource tsc
Code:
Aug 20 15:36:01 centos7 kernel: Switching to clocksource tsc
Aug 20 15:39:08 centos7 dracut-initqueue[209]: Warning: Could not boot.
Aug 20 15:39:08 centos7 dracut-initqueue[209]: Warning: /dev/mapper/centos-root
Aug 20 15:39:08 centos7 systemd[1]: Starting Dracut Emergency Shell...
 

Jov

Member

Reaction score: 24
Messages: 40

Not sure what's wrong, but I can share my config for reference. I use CentOS-7-x86_64-Minimal-1511.iso to install CentOS 7 and this is my vm-bhyve config:
Code:
loader="grub"
cpu=2
memory=2048M
#passthru0="1/0/0"
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0.img"
grub_install0="linux /isolinux/vmlinuz LANG=en_US.UTF-8 KEYTABLE=us SYSFONT=latarcyrheb-sun16 console=ttyS0"
grub_install1="initrd /isolinux/initrd.img"
grub_run0="linux /vmlinuz-3.10.0-327.el7.x86_64 root=/dev/mapper/centos-root LANG=en_US.UTF-8 KEYTABLE=us SYSFONT=latarcyrheb-sun16 console=ttyS0"
grub_run1="initrd /initramfs-3.10.0-327.el7.x86_64.img"
network0_mac="58:9c:fc:00:7f:9b"
This is my updated kernel version using to test BBR:
Code:
loader="grub"
cpu=2
memory=2048M
#passthru0="1/0/0"
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0.img"
grub_install0="linux /isolinux/vmlinuz LANG=en_US.UTF-8 KEYTABLE=us SYSFONT=latarcyrheb-sun16 console=ttyS0"
grub_install1="initrd /isolinux/initrd.img"
grub_run0="linux /vmlinuz-4.10.5-1.el7.elrepo.x86_64 root=/dev/mapper/centos-root LANG=en_US.UTF-8 KEYTABLE=us SYSFONT=latarcyrheb-sun16 console=ttyS0"
grub_run1="initrd /initramfs-4.10.5-1.el7.elrepo.x86_64.img"
network0_mac="58:9c:fc:00:7f:9b"
 
OP
OP
henninb

henninb

New Member


Messages: 8

Jov thanks for sharing your centos.conf I will check it for discrepancies between yours and see if I can find anything to help my centos7 boot correctly. The reason I am not running Centos7 (1511) is because after I install I noticed that bhyve-grub2 could not read my xfs boot partition. How did you get around that issue? I assume I am doing something incorrectly.
 
OP
OP
henninb

henninb

New Member


Messages: 8

Jov thanks for sharing your centos.conf I will check it for discrepancies between yours and see if I can find anything to help my centos7 boot correctly. The reason I am not running Centos7 (1511) is because after I install I noticed that bhyve-grub2 could not read my xfs boot partition. How did you get around that issue? I assume I am doing something incorrectly.
Correction I was attempting to run 1611 and not 1511, I will try and install 1511 and see if I have better results. Based on your results Jov, I assume the latest version of Centos7 that does not utilize xfs as the default for /boot is 1511. At the end of the day it would be nice if the Centos 7 console install allowed this setting to be configurable.
 
OP
OP
henninb

henninb

New Member


Messages: 8

On the Centos side I fixed this by reinstalling 1511 and choosing the LVM instead of Legacy Partitions.
 
Top