Re: Starting the bhyve journey

From: Mario Marietto <marietto2008_at_gmail.com>
Date: Sat, 12 Aug 2023 10:22:33 UTC
As I had suspected,the first tutorial wants you learn vm-bhyve and iohyve
(the wrapper for zfs and bhyve),as he says :

*I’m not saying this is the way to go*. Really, really, If you are planning
on setting things up from scratch to have a nice FreeBSD virtual machines
server, look into all the cool projects out there like vm-bhyve
<https://github.com/churchers/vm-bhyve> or iohyve
<https://github.com/pr1ntf/iohyve> (to name two of them, I’m sure there are
more).


That's not good. If you want to set up from scratch you should not focus
too much on studying the vm-bhyve or iohyve,it makes things even more
complicated because these are tools that change themself during the time so
you should keep updated with more knowledge.

Take a look at this tutorial :

https://www.cyberciti.biz/faq/how-to-install-linux-vm-on-freebsd-using-bhyve-and-zfs/

On Sat, Aug 12, 2023 at 12:09 PM Odhiambo Washington <odhiambo@gmail.com>
wrote:

> I have read https://wu.e-shell.org/articles/hw-to-bhyve.html as well as
> https://www.netscylla.com/blog/2021/06/11/FreeBSD-and-Bhyve.html and many
> more.
> I will just master it with time.
>
> On Sat, Aug 12, 2023 at 1:01 PM Mario Marietto <marietto2008@gmail.com>
> wrote:
>
>> Try like this :
>>
>> bhyve -S -c sockets=2,cores=2,threads=2 -m 4G -w -H -A \
>> -s 0,hostbridge \
>> -s 1,ahci-hd,/mnt/zroot2/zroot2/bhyve/img/Windows/windows11.img,bootindex=1 \
>> -s 13,virtio-net,tap1 \
>> -s 29,fbuf,tcp=0.0.0.0:5918,w=1600,h=950,wait \
>> -s 30,xhci,tablet \
>> -s 31,lpc \
>> -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \
>> vm0:1 < /dev/null & sleep 2 && vncviewer 0:1
>>
>> Doing this way you will learn better how to compose the bhyve parameters and how they should be formatted naturally.
>> As you can see,the vm-bhyve wrapper "muddies the waters". And I think that you should also learn how to create a bridge on FreeBSD.
>>
>>
>> On Sat, Aug 12, 2023 at 11:46 AM Mario Marietto <marietto2008@gmail.com>
>> wrote:
>>
>>> In my opinion,the usage of the wrapper creates some difficulties to
>>> understand how bhyve and the networking works. You should start from the
>>> very beginning,studying bhyve and the freebsd networking,instead of
>>> learning how to correctly use the wrapper.
>>>
>>> On Sat, Aug 12, 2023 at 11:25 AM Odhiambo Washington <odhiambo@gmail.com>
>>> wrote:
>>>
>>>> Hello all.
>>>>
>>>> I am new to bhyve and have read a lot about it, so I decided to try
>>>> creating a few VMs.
>>>> I found a HOWTO that is detailed and which appears to be the easiest to
>>>> follow:
>>>> https://klarasystems.com/articles/from-0-to-bhyve-on-freebsd-13-1/
>>>> The only differences are that I did not install a fresh FreeBSD-13
>>>> server as I already had one, and I am not using ZFS on my server (host).
>>>> I have gotten stuck midway and cannot figure out why: I cannot boot the
>>>> VMs I create.
>>>> I have tried creating a Windows2019 as well as a Debian12 VM, but both
>>>> don't boot.
>>>>
>>>> vm-public: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0
>>>> mtu 1492
>>>>         ether ce:6f:18:51:d4:51
>>>>         id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
>>>>         maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
>>>>         root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
>>>>         member: em1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
>>>>                 ifmaxaddr 0 port 2 priority 128 path cost 20000
>>>>         groups: bridge vm-switch viid-4c918@
>>>>         nd6 options=9<PERFORMNUD,IFDISABLED>
>>>> tap0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric
>>>> 0 mtu 1492
>>>>         description: vmnet/debian12/0/public
>>>>         options=80000<LINKSTATE>
>>>>         ether 58:9c:fc:10:ff:ed
>>>>         inet6 fe80::5a9c:fcff:fe10:ffed%tap0 prefixlen 64 scopeid 0x6
>>>>         groups: tap vm-port
>>>>         media: Ethernet autoselect
>>>>         status: no carrier
>>>>         nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
>>>>
>>>> 1.  Windows2019 VM:
>>>>     vm create -t uefi -s 100G -m 8G -c8 windows2019
>>>>     vm install windows2019 /usr/local/bhyve-vms/.iso/server2019.iso
>>>>
>>>> 2. Debian12 VM:
>>>>     vm create -s 60G -m 8G -c 8 debian12
>>>>     vm install debian12 .iso/debian-12.0.0-amd64-DVD-1.iso
>>>>
>>>> root@gw:/usr/local/bhyve-vms # vm list
>>>> NAME         DATASTORE  LOADER     CPU  MEMORY  VNC  AUTO     STATE
>>>> debian12     default            bhyveload    8         8G
>>>>  -       Yes[2]         Bootloader (91866)
>>>> windows2019  default        uefi               8        8G
>>>>  -       Yes [1]     Stopped
>>>>
>>>> From the above output of `vm list`, you can see that none of them is
>>>> booting up.
>>>>
>>>> What is it that I could be missing?
>>>>
>>>>
>>>> --
>>>> Best regards,
>>>> Odhiambo WASHINGTON,
>>>> Nairobi,KE
>>>> +254 7 3200 0004/+254 7 2274 3223
>>>> "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
>>>> [How to ask smart questions:
>>>> http://www.catb.org/~esr/faqs/smart-questions.html]
>>>>
>>>
>>>
>>> --
>>> Mario.
>>>
>>
>>
>> --
>> Mario.
>>
>
>
> --
> Best regards,
> Odhiambo WASHINGTON,
> Nairobi,KE
> +254 7 3200 0004/+254 7 2274 3223
> "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
> [How to ask smart questions:
> http://www.catb.org/~esr/faqs/smart-questions.html]
>


-- 
Mario.