====== PowerPC64 QEMU Instructions ====== ===== FreeBSD host ===== %%FreeBSD%% can run as VM in QEMU. %%FreeBSD%% 13.1-RELEASE supports for virtio devices. This example installs %%FreeBSD%% 13.1-RELEASE using the following environment/settings: Host: * Any running %%FreeBSD%% * Instructions tested on %%FreeBSD%%/amd64 running 14-current from August 2022 Guest: * Machine: pseries * SMP/CPU count: 8 * RAM: 4GB * Disk: 100GB * Network Controller: virtio * Disk Controller: virtio * Installer Image: %%FreeBSD%%-13.1-RELEASE-powerpc-powerpc64-disc1.iso (taken from [[https://download.freebsd.org/ftp/releases/powerpc/powerpc64/ISO-IMAGES/13.1/FreeBSD-13.1-RELEASE-powerpc-powerpc64-disc1.iso]]) * Video: disabled, using console. Remove "-vga none -nographic" from commands bellow if you want use default VNC video output === Create a disk === ''%%qemu-img create -f qcow2 freebsd-disk.qcow2 100G%%'' === Boot installer disc === ''%% qemu-system-ppc64 -smp 8 -m 4g -drive file=freebsd-disk.qcow2,format=qcow2,if=virtio -net nic,model=virtio -machine pseries,cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken -vga none -nographic -cdrom FreeBSD-13.1-RELEASE-powerpc-powerpc64-disc1.iso -boot d%%'' === Boot installed system === Same command used for installing it, but removing -cdrom and -boot options: ''%%qemu-system-ppc64 -smp 8 -m 4g -drive file=freebsd-disk.qcow2,format=qcow2,if=virtio -net nic,model=virtio -machine pseries,cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken -vga none -nographic%%'' ==== Other Methods ==== The methods outlined below for Linux for other ways of acquiring images work for %%FreeBSD%% host, but with the same command line differences to take out kvm acceleration. ===== Linux host ===== %%FreeBSD%% can run as VM in QEMU. %%FreeBSD%% 13.1-RELEASE supports for virtio devices. Huge Pages is also not mandatory anymore when running the VM on Linux hosts ==== Installing from disc1.iso ==== This example installs %%FreeBSD%% 13.1-RELEASE using the following environment/settings: Host: * Machine: IBM with POWER8 processor * OS: Ubuntu 18.04 LTS (PowerPC64 Little Endian) * QEMU Version: 4.2.0 Guest: * Machine: pseries with kvm acceleration * SMP/CPU count: 8 * RAM: 4GB * Disk: 100GB * Network Controller: virtio * Disk Controller: virtio * Installer Image: %%FreeBSD%%-13.1-RELEASE-powerpc-powerpc64-disc1.iso (taken from [[https://download.freebsd.org/ftp/releases/powerpc/powerpc64/ISO-IMAGES/13.1/FreeBSD-13.1-RELEASE-powerpc-powerpc64-disc1.iso]]) * Video: disabled, using console. Remove "-vga none -nographic" from commands bellow if you want use default VNC video output === Create a disk === ''%%qemu-img create -f qcow2 freebsd-disk.qcow2 100G%%'' === Boot installer disc === ''%%qemu-system-ppc64 -enable-kvm -smp 8 -m 4g -drive file=freebsd-disk.qcow2,format=qcow2,if=virtio -net nic,model=virtio -machine pseries,accel=kvm,cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken -vga none -nographic -cdrom FreeBSD-13.0-RELEASE-powerpc-powerpc64-disc1.iso -boot d%%'' === Boot installed system === Same command used for installing it, but removing -cdrom and -boot options: ''%%qemu-system-ppc64 -enable-kvm -smp 8 -m 4g -drive file=freebsd-disk.qcow2,format=qcow2,if=virtio -net nic,model=virtio -machine pseries,accel=kvm,cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken -vga none -nographic%%'' ==== Booting FreeBSD CI's ready-to-use disk image (for developers) ==== %%FreeBSD%% CI infrastructure builds a bootable disk image in qcow2 format that's normally used by CI scripts to validate %%FreeBSD%% sanity every time a change is made in the code base. This can also be used by a user or developer wanting to test stuff with a minimal pre-installed, pre-configured system without installing it from the classic CD/DVD disc. 1. Take latest snapshot ''%%wget/fetch https://artifact.ci.freebsd.org/snapshot/head/latest_vm/powerpc/powerpc64/disk.qcow2.zst%%'' 2. Uncompress it ''%%unzstd /home/alfredo.junior/tmp/disk.qcow2.zst%%'' 3. Boot ''%%qemu-system-ppc64 -enable-kvm -smp 8 -m 4g -drive file=disk.qcow2,format=qcow2,if=virtio -net nic,model=virtio -machine pseries,accel=kvm,cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken -vga none -nographic%%'' Default user is root without a password. ===== UNICAMP OpenPower Minicloud ===== The [[https://openpower.ic.unicamp.br/minicloud/|UNICAMP Minicloud]] is a %%OpenPower%% Cloud maintained by University of Campinas (Brazil). They are an academic member of the %%OpenPower%% Foundation and provides free access to POWER virtual machines that can be used for development, testing or migration of applications to POWER. The virtual machines of Minicloud run on %%OpenStack%%, which supports running a large number of virtual machines. Since 20200404 a %%FreeBSD%% 13-CURRENT pre-made image has been made available for the public. It can be found in the list of pre-made images under the name "FreeBSD13-head-r359571". After launching "FreeBSD13-head-r359571", it is recommended to: * Set a password for "root" user * Create a regular user (to be used in the SSH forwarding) ==== Configure network ==== echo 'ifconfig_vtnet0=DHCP' >> /etc/rc.conf service netif restart ==== Expand disk partition ==== Run the command bellow and take notes from partition 3 size (16GB at the time of this writing) and the free size. ''%%gpart show%%'' Resize partition 3 to the new size. If 'gpart show ' shows 16G used on partition 3 and 23G are free, you can resize it to rougly 38G (16-23-1) ''%%gpart resize -i 3 -s 38g -a 4k vtbd0%%'' Resize UFS filesystem ''%%growfs /%%''