BHyve - installing CentOS-6 as a guest OS fails to boot on initial start

byrnejb

Well-Known Member

Reaction score: 27
Messages: 446

I have created a new vm on a FreeBSD-11.1 host using a CentOS-6.10 iso with the following commands:

Code:
vm create -s 100G -t centos6-2x4 inet09
vm install inet09 CentOS-6.10-x86_64-minimal.iso

The template file centos6-2x4.conf contains this:

Code:
loader="grub"
cpu=2
memory=4G
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0.img"
grub_install0="linux /isolinux/vmlinuz"
grub_install1="initrd /isolinux/initrd.img"
grub_run0="linux /vmlinuz-2.6.32-573.el6.x86_64 root=/dev/mapper/VolGroup-lv_root"
grub_run1="initrd /initramfs-2.6.32-573.el6.x86_64.img"


When I start this vm and connect to its console I see this:

Code:
error: disk 'hd0,1' not found.
error: you need to load the kernel first.


The grub console shows this:
Code:
+------------------------------------------------------------------+
|inet09 (bhyve run)                                                |


and dropping into the grub command shell shows this:

Code:
grub  ls
(hd0) (host)
grub  ls hd0
error: disk `hd0,1' not found.

What do I have to do to get CentOS-6 to install as a BHyve guest?
 
Last edited by a moderator:

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,683
Messages: 39,278

FreeBSD-11.1 host
FreeBSD 11.1 is End-of-Life since September 2018 and is not supported any more, upgrade to 11.2.
Topics about unsupported FreeBSD versions

Please note that the CentOS kernel and initramfs files contain the kernel version number, so will need changing if your system doesn't contain kernel 2.6.32-573.el6.
 

Remington

Aspiring Daemon

Reaction score: 194
Messages: 562

I had the same problem with CentOS so instead I used Debian and it worked fine.
 

abishai

Aspiring Daemon

Reaction score: 189
Messages: 770

XFS is not supported, install on ext4 or (even better) use UEFI.
 

Ancient

Member

Reaction score: 4
Messages: 24

I think the same that SirDice. Try using 11.2. I didn't used Bhyve, but apparently it is a kind of virtualization, or I'm wrong? If so, then why you don't try with the classic but usable VBox? Or Vagrant.
 

Ancient

Member

Reaction score: 4
Messages: 24

I will try with it. You don't know something 'til you've tried it, or experimented with it. In a moments I'll be reporting if I could run it. See y'all later.
 

Ancient

Member

Reaction score: 4
Messages: 24

Good news and bad news.
Bad: I cannot use Bhyve. Not for now. I need to read some more.
Good: I can run Vagrant. And it could run Centos 7. IDK if it could help you, but I give you the commands:

sudo pkg ins vagrant
vagrant init centos/7
vagrant up

Now I stopped the download of the base system, but I will continue to run it.
Thanks to you, I've found a good virtualization program.
And it means good things for mine, since I came to Linux, even BSD and Unix using VM's. And the most I use it's those kind of programs.
Thanks.
 

pos

Member

Reaction score: 13
Messages: 82

On FreeBSD12...

Latest CentOS 7 1810 won't work (no matter what filesystem on /boot) with UEFI due to UEFI bug. I have heard it is fixed though. But there is no new release yet...

If latest Scientific Linux (also tracking RHEL like CentOS) is used with ext4 on /boot, it will work flawlessly with UEFI + vnc console.
 

kpa

Beastie's Twin

Reaction score: 1,847
Messages: 6,318

You need an earlier snapshot of Centos to install it in Bhyve, I forget exactly which one but for me the lastest ones just didn't work and GRUB get failing with the xfs error on boot.
 
OP
B

byrnejb

Well-Known Member

Reaction score: 27
Messages: 446

I have upgraded the host system to FreeBSD-12.0p3 RELEASE with all pkg upgrades to date (2019-03-29). I have verified that both uefi-edk2-bhyve and grub2-bhyve are installed. I am using the most recent CentOS-6.10-x86_64-minimal.iso and I have confirmed that the correct kernel version is 2.6.32-754.11.1.el6. My template file looks like this:

Code:
guest="linux"
loader="grub"
cpu=2
memory=4G
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0.img"
grub_install0="linux /isolinux/vmlinuz"
grub_install1="initrd /isolinux/initrd.img"
grub_install2="boot"
grub_run_partition="msdos1"
grub_run0="linux /vmlinuz-2.6.32-754.11.1.el6.x86_64 root=/dev/mapper/VolGroup-lv_root"
grub_run1="initrd /initramfs-2.6.32-754.11.1.el6.x86_64.img"
grub_run2="boot"

And I destroyed and recreated the bhyve centos-6 guest using this template. Which gives these results in the grub boot loader:

Code:
                             GNU GRUB  version 2.00

 +--------------------------------------------------------------------------+
 | [Asetparams 'inet09 (bhyve run)'                                         |
 |                                                                          |
 |     root=hd0,msdos1                                                      |
 |     linux /vmlinuz-2.6.32-754.11.1.el6.x86_64 root=/dev/mapper/VolGroup\ |
 | -lv_root                                                                 |
 |     initrd /initramfs-2.6.32-754.11.1.el6.x86_64.img                     |

and the system still cannot boot.

P.S.
What happened to the font selection choice in the formatting bar?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,683
Messages: 39,278

What happened to the font selection choice in the formatting bar?
I removed it. I spent a ridiculous amount of time purging it from posts, time I much rather spend answering questions.

 
Top