Search

Thursday, September 26, 2019

FreeBSD QEMU Host with SliTaz Linux Guest



I got the awesome SliTaz Linux running as a QEMU guest on FreeBSD 12.0-RELEASE. The following references were great:

I did not build QEMU from source for this experiment, but just grabbed the pre-built package, along with the "screen" tool that allows running QEMU inside a detached virtual terminal and a vnc viewer to access the graphical screen of the QEMU-emulated machine:


# pkg install screen
# pkg install qemu
# pkg install tigervnc-viewer

The following was added to the file /boot/loader.conf:

if_bridge_load="YES"
if_tap_load="YES"
kqemu_load="YES"

and this was added to /etc/sysctl.conf and FreeBSD rebooted:

net.link.tap.user_open=1

Logging in with a non-privileged user account, the Slitaz Linux distribution was then downloaded and the QEMU virtual machine hard disk set up:

$ mkdir slitaz-linux
$ cd slitaz-linux
$ fetch http://mirror.slitaz.org/iso/3.0/flavors/slitaz-3.0-xvesa.iso
$ qemu-img create -f qcow2 slitaz.qcow2.4GB.disk 4G

QEMU was then launched in a "screen" virtual terminal session (to detach from the "screen" session leaving it running, press Ctrl-a and then d):
$ screen qemu-system-x86_64 -m 1024 -cdrom slitaz-3.0-xvesa.iso -hda slitaz.qcow2.4GB.disk -boot c -net nic -net user -nographic -vnc :0

Finally, to access the display of the virtual machine:

$ vncviewer localhost:0

A note about installing SliTaz on hard-disk:
From an xterm, partition the hard disk /dev/hda manually first for a large linux and small swap partition using fdisk. Then, launch the installer from start -> system tools -> SliTaz Installer. When prompted for the partition to install to, enter /dev/hda1.

You can download this entire Slitaz Linux QEMU prebuilt virtual machine appliance from my google drive. The "root" password is "root", and the "user" password is "password".

No comments:

Post a Comment

Recommended Products from Amazon