Here are the steps to run FreeBSD on Linux + qemu.
In each explanation below, the command to be actually executed is described in the following format.
$sudo apt install package name
Actually, when you execute the above command, the progress of package installation is displayed, but these are omitted on this page.
Uses Ubuntu 20.04.1 LTS.
Make the following settings on Ubuntu.
$ sudo apt install qemu-system-x86
$ sudo gpasswd -a $(whoami) kvm
To install FreeBSD, do the following on Ubuntu:
$ mkdir -p ~/VM/fbsd122
$ cd ~/VM/fbsd122
$ qemu-img create -f qcow2 fbsd122.qcow2 16g
$ wget https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/12.2/FreeBSD-12.2-RELEASE-amd64-disc1.iso
Start FreeBSD with FreeBSD-12.2-RELEASE-amd64-disc1.iso.
$ qemu-system-x86_64 -enable-kvm -m 1024 -boot order=d -cdrom FreeBSD-12.2-RELEASE-amd64-disc1.iso fbsd122.qcow2
Operate FreeBSD on the above QEMU Window.
Please refer to the following documents for the installation procedure of FreeBSD.
Please note the following two points as installation precautions.
During the installation, the following screen will be displayed and you will be prompted to enter the "root" password.
The following screen will be displayed during installation, prompting you to register as a general user.
When the installation is complete, the dialog "Complete" will be displayed. Press the TAB key to select "Live CD" and press the Enter key. When "login:" is displayed, type "root" and press the Enter key.
If you remove the "-boot" and "-cdrom" during installation and run it, FreeBSD will boot from the HDD.
$ qemu-system-x86_64 -enable-kvm -m 1024 fbsd122.qcow2
For login:, type root and press Enter. For "Password:", enter the "root" password that you set when you installed FreeBSD and press Enter.
Log in as root, type "shutdown -p now" and press Enter to shut down FreeBSD. When the shutdown is complete, the QEMU Window disappears.
Recommended Posts