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



## byrnejb (Mar 15, 2019)

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


```
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:


```
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:


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


The grub console shows this:

```
+------------------------------------------------------------------+
|inet09 (bhyve run)                                                |
```


and dropping into the grub command shell shows this:


```
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?


----------



## SirDice (Mar 20, 2019)

byrnejb said:


> 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








						Unsupported FreeBSD Releases
					

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms.




					www.freebsd.org
				






> 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.











						Supported Guest Examples · churchers/vm-bhyve Wiki
					

Shell based, minimal dependency bhyve manager. Contribute to churchers/vm-bhyve development by creating an account on GitHub.




					github.com


----------



## Remington (Mar 20, 2019)

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


----------



## abishai (Mar 20, 2019)

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


----------



## abishai (Mar 21, 2019)

Probably, he disabled this feature  https://www.kernel.org/doc/Documentation/filesystems/xfs-self-describing-metadata.txt for /boot
This feature is not supported by our version of grub.


----------



## Ancient (Mar 21, 2019)

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 (Mar 21, 2019)

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 (Mar 22, 2019)

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 (Mar 28, 2019)

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 (Mar 29, 2019)

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.


----------



## byrnejb (Mar 29, 2019)

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:


```
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:


```
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 (Mar 29, 2019)

byrnejb said:


> 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. 









						Formatting Guidelines
					

1. Please write as clearly as possible.  Use English punctuation and capitalization, and avoid abbreviating things.  This helps to improve the clarity of messages and make problems easier to solve.  2. Use BBCode formatting tags.  As with punctuation, these tags make messages easier to read...




					forums.freebsd.org


----------

