KVM // FreeBSD guest (switch to serial mode)

grab latest release tarballs

    mkdir -p /data/kernels/freebsd130/
    cd /data/kernels/freebsd130/
    wget https://download.freebsd.org/releases/amd64/amd64/13.0-RELEASE/kernel.txz
    wget https://download.freebsd.org/releases/amd64/amd64/13.0-RELEASE/base.txz

    rm -rf boot/ usr/
    tar xaf kernel.txz

also grab the latest release ISO image

    mkdir -p /data/ISO-IMAGES/fbsd/
    cd /data/ISO-IMAGES/fbsd/

echo $mirror

wget $mirror/releases/ISO-IMAGES/13.0/FreeBSD-13.0-RELEASE-amd64-disc1.iso.xz
unxz FreeBSD-13.0-RELEASE-amd64-disc1.iso.xz
ln -sf FreeBSD-13.0-RELEASE-amd64-disc1.iso disc1.iso

mkdir -p /data/guests/freebsd/
cd /data/guests/freebsd/
virt-install \
            --name freebsd \
            --vcpus 12 \
            --ram 7168 \
            --disk path=/data/guests/freebsd/freebsd.qcow2,size=26,bus=virtio \
            --cdrom /data/ISO-IMAGES/fbsd/disc1.iso \
            --network bridge=virbr0,model=virtio \
            --os-type generic \
            --os-variant generic \
            --graphics vnc,port=5999 \
            --console pty,target_type=serial \
    --autoconsole

on the VNC console, press some key to get to the OK prompt

set console=comconsole

    virsh console freebsd

autoboot

Clean-up

virsh destroy freebsd
virsh undefine freebsd
rm -rf /data/guests/freebsd/

Resources

https://unix.stackexchange.com/questions/24453/installing-freebsd-as-guest-os-on-kvm-without-using-vnc

https://www.cyberciti.biz/faq/linux-kvm-redirecting-freebsd-virtual-machines-console-to-aserialport/


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5
Copyright © 2022 Pierre-Philipp Braun