KVM // FreeBSD guest (switch to serial mode)

assuming the host is up and running already

grab the latest release ISO image

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

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 3 \
            --ram 7168 \
            --disk path=/data/guests/freebsd/freebsd.qcow2,size=26,bus=virtio \
            --cdrom /data/ISO-IMAGES/freebsd130/disc1.iso \
            --network bridge=virbr0,model=virtio \
            --os-type generic \
            --os-variant generic \
            --graphics vnc,port=5900 \
            --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 | CONTACT
Copyright © 2024 Pierre-Philipp Braun