bhyve How to boot Debian in EFI mode using bhyve...

Hello to everyone.

I hope to make happy someone,explaining how to boot Debian using the EFI bootloader and Bhyve. There is an extra configuration to do,otherwise it will not boot at all. First of all,I'm using vm-bhyve and this conf. file :

Code:
loader="uefi"
cpu=8
memory=8GB
network0_type="virtio-net"
network0_switch="public"
disk0_type="ahci-hd"
disk0_name="debian-gpu.img"
uuid="ca6be87e-eed2-11eb-abbb-e0d55ee21f22"
network0_mac="58:9c:fc:03:33:60"
graphics="yes"
graphics_res="1440x900"
xhci_mouse="yes"

As is,if u try to boot Debian with vm-bhyve,you will see that after having installed Debian,the hard disk will not boot and the problem is caused by a "a bhyve's incomplete UEFI implementation". The solution is here :


The method that he used to boot Debian in EFI mode worked for me. I mean I did this after having installed Debian on a qcow2 image using virt-manager on Linux and then I have converted the qcow2 file to a raw / img file :

Code:
cd /boot/efi/EFI
mkdir BOOT
cp debian/grubx64.efi BOOT/bootx64.efi

The problem is that,later,for some reason Debian is not able to reach the desktop manager. When the booting process has ended,I see only a black screen with a blinking cursor and nothing happens anymore. I also tried to go in "recovery mode" : this is what happens :

Screenshot_20210729_163457.png


so,Im stuck there. Suggestions ?
 
I have this:
Code:
loader="uefi"
graphics="YES"
cpu="2"
memory="4096M"
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0"
disk0_dev="sparse-zvol"
grub_run_dir="/grub"
Use virtio-blk for the disk devices.
 
I made some progress. I've configured Debian in a different way and now it is able to reach the login prompt. I have also configured correctly vncserver and it works (at least,internally inside the VM that run on qemu-kvm in Linux),but in FreeBSD the situation is totally different. First of all,I have opened the port 5900 on the admin page of my router. After that,I've checked if the port 5900 is opened on FreeBSD :

Code:
root@marietto:~ # nmap 192.168.1.6

Starting Nmap 7.91 ( https://nmap.org ) at 2021-07-30 21:13 CEST
Nmap scan report for 192.168.1.6 (192.168.1.6)
Host is up (0.000025s latency).
Not shown: 998 closed ports

PORT     STATE SERVICE

22/tcp   open  ssh
5900/tcp open  vnc

root@marietto:~ # netstat -an | grep 5900

tcp4       0      0 *.5900                 *.*                    LISTEN


So,it seems that on FreeBSD port 5900 is open. Let's see how is the situation in the Debian guest os :

Code:
root@debian:#nmap 192.168.1.2

PORT     STATE   SERVICE


22/tcp   open ssh

80/tcp   open http


as u can see,there isn't any port 5900,but the tightVNC server is running correctly :


_Screenshot_20210730_215637.png

Screenshot_20210730_134900.png


Screenshot_20210730_135320.png
 
solution :

Code:
ssh -L 5901:localhost:5901 192.168.1.2 (ip number of debian)
vncviewer localhost:5901


Screenshot_20210731_010038.png
 
First of all,I have opened the port 5900 on the admin page of my router.
Don't open VNC up to the internet. Really, it's not the safest protocol in the world. Tunnel it over an SSH connection if you want to access it remotely.
 
It seems that to make work the audio inside the debian vm,we should do the following :
(On Debian I'm using kde plasma)
  1. adding export PULSE_SERVER=unix:~/.vnc/audio.socket to file ~/.cshrc (on FreeBSD) ---> it produces the error : export: Command not found.
  2. from Freebsd : ssh -L 5901:localhost:5901 192.168.1.8 -R /home/$user/.vnc/audio.socket:localhost:4713 (where 192.168.1.8 is the IP of Debian)
  3. add to /etc/pulse/default.pa :
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1
 
marietto@marietto:~ $ ssh -L 5901:localhost:5901 192.168.1.8 -R /home/mariuccio/.vnc/audio.socket:localhost:4713 firefox

marietto@192.168.1.8's password:
Permission denied, please try again.

marietto@192.168.1.8's password:
Permission denied, please try again.
 
Back
Top