From owner-freebsd-virtualization@FreeBSD.ORG Sat Mar 8 06:46:31 2014 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31D91A53 for ; Sat, 8 Mar 2014 06:46:31 +0000 (UTC) Received: from mail.monkeybrains.net (mail.monkeybrains.net [208.69.40.19]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 18733132 for ; Sat, 8 Mar 2014 06:46:30 +0000 (UTC) Received: from Birdhouse-o-My.local (208-90-212-98.PUBLIC.monkeybrains.net [208.90.212.98]) (authenticated bits=0) by mail.monkeybrains.net (8.14.7/8.14.7) with ESMTP id s286kUje012032 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Fri, 7 Mar 2014 22:46:30 -0800 (PST) (envelope-from crapsh@monkeybrains.net) X-Authentication-Warning: mail.monkeybrains.net: Host 208-90-212-98.PUBLIC.monkeybrains.net [208.90.212.98] claimed to be Birdhouse-o-My.local Message-ID: <531ABCC5.30801@monkeybrains.net> Date: Fri, 07 Mar 2014 22:46:29 -0800 From: "Rudy (bulk)" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: freebsd-virtualization@freebsd.org Subject: [HOW-TO] CentOS on bhyve Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.98.1 at mail.monkeybrains.net X-Virus-Status: Clean X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2014 06:46:31 -0000 A customer wanted CentOS, so I tried doing it like I did my Ubuntu install --- no luck with the grub loading up automatically. 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... START INSTALL ----------------------------------------- # cd /data/images/ # truncate -s 200G vm2.img # cat vm2-device.map (hd0) /data/images/vm2.img (cd0) /data/distributions/CentOS-6.5-x86_64-minimal.iso # bhyvectl --vm=vm2 --destroy # grub-bhyve -r cd0 -m /data/images/vm2-device.map -M 2048 vm2 grub> linux /isolinux/vmlinuz grub> initrd /isolinux/initrd.img grub> boot # bhyve -c 2 -m 2048M -H -P -A \ -l com1,stdio \ -s 0:0,hostbridge \ -s 1:0,lpc -s 2:0,virtio-net,tap1 \ -s 3,ahci-cd,/data/distributions/CentOS-6.5-x86_64-minimal.iso \ -s 4,virtio-blk,/data/images/vm2.img vm2 END INSTALL ----------------------------------------- Is there something like this that will clean up the output from the CentOS install program? grub> GRUB_TERMINAL=console The boot part is messy (how to I load up the grub.conf from inside the install image? START BOOT ----------------------------------------- # grub-bhyve -r hd0,msdos1 -m vm2.map -M 2048 vm2 grub> cat /grub/ Possible files are: grub.conf splash.xpm.gz menu.lst device.map stage1 stage2 e2fs_stage1_5 fat_stage1_5 ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5 grub> cat /grub/grub.conf # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/mapper/VolGroup-lv_root # initrd /initrd-[generic-]version.img #boot=/dev/vda default=0 timeout=5 serial --unit=0 --speed=9600 terminal --timeout=5 serial console title CentOS (2.6.32-431.el6.x86_64) root (hd0,0) kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD KEYTABLE=us rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 console=ttyS0 crashkernel=auto rd_LV M_LV=VolGroup/lv_root rd_NO_DM initrd /initramfs-2.6.32-431.el6.x86_64.img grub> linux /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_ NO_MD KEYTABLE=us rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 console=ttyS0 crashkernel=auto rd_LVM_L V=VolGroup/lv_root rd_NO_DM grub> OM error: can't find command `OM'. grub> linux /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_ NO_MD KEYTABLE=us rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 console=ttyS0 crashkernel=auto rd_LVM_L V=VolGroup/lv_root rd_NO_DM grub> initrd /initramfs-2.6.32-431.el6.x86_64.img grub> boot # 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/CentOS-6.5-x86_64-minimal.iso -s 4,virtio-blk,/data/images/vm2.img -l com1,stdio vm2 [snip] CentOS release 6.5 (Final) Kernel 2.6.32-431.el6.x86_64 on an x86_64 localhost.localdomain login: root Password: [root@localhost ~]# END BOOT ----------------------------------------- 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? 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 ( Rudy