bhyve First try of a linux guest. Need help

Hello everyone.

I'm trying bhyve now.
I follow the 22.7 section of the handbook.. and I'm stuck.
a little help would be very friendly. I'm discovering FreeBSD little by little everyday.

FreeBSD 13.0 is installed as guest on Windows (VirtualBox). (VM-X enabled on Windows BIOS for nesting)

Here is everything I did from FreBSD's install.
First boot
logged as root

#freebsd-update fetch install
[...]
#reboot

logged as root
# cd /usr/ports/sysutils/grub2-bhyve
# make install clean
Stop.
make[3]: stopped in /usr/ports/ports-mgmt/pkg
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/ports-mgmt/pkg
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/sysutils/grub2-bhyve

------
Do I have to worry about thoses errors ? Before going on ?
------
 
Yes, but I don't see the actual error, IOW you snipped it, so no idea what's causing it.

Anyways, I assume you won't get far even when your builds are fixed: bhyve doesn't support nested virtualization.
 
small display :-D... only those lines are appearing.

Ok. So I go on.
#kldload vmm
#kldload nmdm
#ifconfig tap0 create
#sysctl net.link.tap.up_on_open=1
net.link.tap.up_on_open: 0 -> 1
#ifconfig bridge0 create
#ifconfig bridge0 addm igb0 addm tap0
ifconfig: bRDGADD igb0: No such file or directory
#ifconfig bridge0 up

------ Linux Guest -------
# truncate -s 16G linux.img

I mount debian-11.0.0-amd64-netinst.iso on Windows and add it to FreeBSD's VM by Virtualbox menu (Devices/Optical Drive)

#camcontrol devlist
<VBOX HARDDISK 1.0> at scbus0 target 0 lun 0 (ada0,pass0)
<VBOX CD-ROM 1.0> at scbus1 target 0 lun 0 (cd0,pass1)

so it comes to cd0, right ?

# grub-bhyve -m device.map -r cd0 -M 1024M linuxguest
grub-bhyve: Command not found

So I suggest, install by ports didn't work, right ?
 
small display :-D... only those lines are appearing.
then e.g. capture the output in a log, maybe with tee(1).
#ifconfig bridge0 addm igb0 addm tap0
ifconfig: bRDGADD igb0: No such file or directory
Do you blindly type commands from some website? this looks like your machine doesn't have an igb0 interface.
So I suggest, install by ports didn't work, right ?
Of course not, you have a build error. But to tell more, we would have to know which error exactly…

But then again, what you're trying to do won't work anyways, bhyve needs hardware support for virtualization (and that's impossible inside a VM, e.g. processors only provide one additional layer of pagetable indirection)
 
tee is like > ?

#freebsd-update fetch install > log.txt
# cat log.txt
src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 2 mirrors found.
Fetching metadata signature for 13.0-RELEASE from update2.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.

No updates needed to update system to 13.0-RELEASE-p4.
No updates are available to install

I follow FreeBSD handbook 22.7 section for bhyve.
Yes I don't have igb0. Only 2 (before creating bridge), lo0 and em0.

My teached told me that it was possible to create a VM nested in another with VM-X enabled in BIOS... But maybe you're right.
I should receive my new computer soon. I just wanted to understand before doing it for real.

Thanks for your help.
 
tee(1) can log output to a file while still sending it to the controlling tty (your screen) as well, so it's nice for observing a build and at the same time create a log.
Yes I don't have igb0. Only 2 (before creating bridge), lo0 and em0.
Then you should add em0 to your bridge.

Well, I don't know why you show the (unrelated) output of freebsd-update(8) now… if you're looking for help with your problem building grub-bhyve, capture that build in a log and search for error messages in there.
 
People of this glorious forum! Please use [cmd][/cmd] and [code][/code] tags (amongst others) where applicable!
Makes it much more convenient when trying to help.
 
Last edited:
Ok. Thank you.
I receive my computer this week. I'll do all of this on it (log with tee while installing packages) so that it will be easier to show the problem.
jbodenmann, got it ;-).
Thank you :-)
 
Back
Top