<div dir="ltr"><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Rudy (bulk)</b> <span dir="ltr"><<a href="mailto:crapsh@monkeybrains.net">crapsh@monkeybrains.net</a>></span><br>
Date: Sat, Mar 8, 2014 at 1:46 AM<br>Subject: [HOW-TO] CentOS on bhyve<br>To: <a href="mailto:freebsd-virtualization@freebsd.org">freebsd-virtualization@freebsd.org</a><br><br><br><br>
A customer wanted CentOS, so I tried doing it like I did my Ubuntu install --- no luck with the grub loading up automatically.<br>
<br>
Here is basically what I did ... it works, but I get all these odd characters in my terminal (if I hit tab, I can guess at the menu items and successfully make it through the installation process).  I need to clean up this how-to, but here it is...<br>

<br>
START INSTALL ------------------------------<u></u>-----------<br>
<br>
# cd /data/images/<br>
# truncate -s 200G vm2.img<br>
# cat vm2-device.map<br>
(hd0) /data/images/vm2.img<br>
(cd0) /data/distributions/CentOS-6.<u></u>5-x86_64-minimal.iso<br>
<br>
# bhyvectl --vm=vm2 --destroy<br>
# grub-bhyve -r cd0 -m /data/images/vm2-device.map -M 2048 vm2<br>
<br>
grub> linux /isolinux/vmlinuz<br>
grub> initrd /isolinux/initrd.img<br>
grub> boot<br>
<br>
# bhyve -c 2 -m 2048M -H -P -A \<br>
    -l com1,stdio \<br>
    -s 0:0,hostbridge \<br>
    -s 1:0,lpc -s 2:0,virtio-net,tap1 \<br>
    -s 3,ahci-cd,/data/distributions/<u></u>CentOS-6.5-x86_64-minimal.iso \<br>
    -s 4,virtio-blk,/data/images/vm2.<u></u>img vm2<br>
<br>
<br>
END  INSTALL ------------------------------<u></u>-----------<br>
<br>
Is there something like this that will clean up the output from the CentOS install program?<br>
<br>
grub> GRUB_TERMINAL=console<br>
<br>
<br>
The boot part is messy (how to I load up the grub.conf from inside the install image?<br>
<br>
<br>
<br>
START BOOT ------------------------------<u></u>-----------<br>
# grub-bhyve -r hd0,msdos1 -m vm2.map -M 2048 vm2<br>
grub> cat /grub/<br>
Possible files are:<br>
<br>
 grub.conf splash.xpm.gz menu.lst device.map stage1 stage2 e2fs_stage1_5 fat_stage1_5 ffs_stage1_5<br>
iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5<br>
grub> cat /grub/grub.conf<br>
# grub.conf generated by anaconda<br>
#<br>
# Note that you do not have to rerun grub after making changes to this file<br>
# NOTICE:  You have a /boot partition.  This means that<br>
#          all kernel and initrd paths are relative to /boot/, eg.<br>
#          root (hd0,0)<br>
#          kernel /vmlinuz-version ro root=/dev/mapper/VolGroup-lv_<u></u>root<br>
#          initrd /initrd-[generic-]version.img<br>
#boot=/dev/vda<br>
default=0<br>
timeout=5<br>
serial --unit=0 --speed=9600<br>
terminal --timeout=5 serial console<br>
title CentOS (2.6.32-431.el6.x86_64)<br>
        root (hd0,0)<br>
        kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_<u></u>root rd_NO_LUKS LANG=en_US.UTF-8<br>
rd_NO_MD  KEYTABLE=us rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 console=ttyS0 crashkernel=auto rd_LV<br>
M_LV=VolGroup/lv_root rd_NO_DM<br>
        initrd /initramfs-2.6.32-431.el6.x86_<u></u>64.img<br>
<br>
<br>
grub> linux /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_<u></u>root rd_NO_LUKS LANG=en_US.UTF-8 rd_<br>
NO_MD  KEYTABLE=us rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 console=ttyS0 crashkernel=auto rd_LVM_L<br>
V=VolGroup/lv_root rd_NO_DM<br>
grub> OM<br>
error: can't find command `OM'.<br>
grub> linux /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_<u></u>root rd_NO_LUKS LANG=en_US.UTF-8 rd_<br>
NO_MD  KEYTABLE=us rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 console=ttyS0 crashkernel=auto rd_LVM_L<br>
V=VolGroup/lv_root rd_NO_DM<br>
grub> initrd /initramfs-2.6.32-431.el6.x86_<u></u>64.img<br>
grub> boot<br>
<br>
# bhyve -c 2 -m 2048M -H -P -A -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap1 -s 3,ahci-cd,/data/distributions/<u></u>CentOS-6.5-x86_64-minimal.iso -s 4,virtio-blk,/data/images/vm2.<u></u>img -l com1,stdio vm2<br>
<br>
[snip]<br>
CentOS release 6.5 (Final)<br>
Kernel 2.6.32-431.el6.x86_64 on an x86_64<br>
<br>
localhost.localdomain login: root<br>
Password:<br>
[root@localhost ~]#<br>
<br>
 END  BOOT ------------------------------<u></u>-----------<br>
<br>
Also, this is making me wonder... am I doing this wrong?  I am using install CD images, are other people using pre-made CentOS images?<br>
I have noticed grub-bhyve requires a space at the end of the line or I get 'OM' on STDOUT and the line fails.  Above, I hit the up-arrow then a space (<br>
Rudy<br>
<br>
<br>
______________________________<u></u>_________________<br>
<a href="mailto:freebsd-virtualization@freebsd.org" target="_blank">freebsd-virtualization@<u></u>freebsd.org</a> mailing list<br>
<a href="http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization" target="_blank">http://lists.freebsd.org/<u></u>mailman/listinfo/freebsd-<u></u>virtualization</a><br>
To unsubscribe, send any mail to "<a href="mailto:freebsd-virtualization-unsubscribe@freebsd.org" target="_blank">freebsd-virtualization-<u></u>unsubscribe@freebsd.org</a>"<br>
</div><br><br clear="all"><br>-- <br><div dir="ltr">Aryeh M. Friedman, Lead Developer, <a href="http://www.PetiteCloud.org" target="_blank">http://www.PetiteCloud.org</a><br></div>
</div>