Installing in a Virtual Machine
A virtual machine is the cheapest way to try Makronix: no disk is
overwritten, a snapshot is one command away, and the same installer runs as
on real hardware. This chapter gives the settings that matter for QEMU with
KVM and for Proxmox VE. The values are starting points; the installer is
the same as on a physical machine ().
What the VM needs
KVM. A virtual machine without
hardware acceleration (QEMU's TCG) installs, but slowly. On Linux,
/dev/kvm must exist and your user must be allowed
to use it; on Proxmox VE, KVM is the default.
Memory. 2 GiB installs the system
and runs the text console; 4 GiB make the MCDE desktop comfortable.
8 GiB are useful only if the guest runs a browser or another VM.
Disk. 32 GiB is a comfortable
size for the system, the desktop and a few packages. The source set
needs considerably more; explains
it.
Firmware. UEFI (OVMF) or BIOS.
UEFI is the modern choice; the installer and the boot loader handle
both. For UEFI, give the VM a writable variable store, not only the
read-only firmware image.
Disk and network devices. VirtIO
is the fast choice. The installer sees a VirtIO block disk as
ld0, a SCSI or AHCI disk as
sd0, and an IDE disk as
wd0.
A display for the desktop. The
graphical installer and dtlogin need a VGA device.
std is the safe emulation; a serial console is
enough for a headless installation.
QEMU and KVM
Create a disk image first. qemu-img makes a
sparse qcow2 file; it grows as the installation writes to it.
qemu-img create -f qcow2 makronix.qcow2 32G
The following command starts a BIOS machine with 4 GiB of memory,
four CPUs, an IDE disk, the DVD image, user-mode networking with SSH
forwarded to port 2222, and a graphical window:
qemu-system-x86_64 -enable-kvm -cpu host -smp 4 -m 4G \
-drive file=makronix.qcow2,if=ide,format=qcow2 \
-drive file=Makronix-0.99.10-amd64-dvd.iso,media=cdrom,readonly=on \
-boot order=dc \
-nic user,model=e1000, \
hostfwd=tcp:127.0.0.1:2222-:22 \
-vga std -display gtk
If /dev/kvm is not available, remove
-enable-kvm -cpu host and add
-cpu max; the installation then runs in emulation and
takes much longer. Replace -display gtk with
-display none -serial mon:stdio for a console-only
machine; the install media talks on com0, as
explains.
UEFI
UEFI needs the OVMF firmware and a writable copy of its variable
store. The paths differ between distributions; these are the Debian
and Ubuntu names:
cp /usr/share/OVMF/OVMF_VARS_4M.fd OVMF_VARS.fd
qemu-system-x86_64 -enable-kvm -cpu host -smp 4 -m 4G \
-machine q35 \
-drive if=pflash,format=raw,readonly=on, \
file=/usr/share/OVMF/OVMF_CODE_4M.fd \
-drive if=pflash,format=raw,file=OVMF_VARS.fd \
-device ich9-ahci,id=ahci \
-drive file=makronix.qcow2,if=none,id=hd0,format=qcow2 \
-device ide-hd,drive=hd0,bus=ahci.0 \
-drive file=Makronix-0.99.10-amd64-dvd.iso,media=cdrom,readonly=on, \
if=none,id=cd0 \
-device ide-cd,drive=cd0,bus=ahci.1 \
-boot order=dc \
-nic user,model=e1000, \
hostfwd=tcp:127.0.0.1:2222-:22 \
-vga std -display gtk
The AHCI controller is deliberate. OVMF's IDE driver reads a CD
or a disk so slowly that the boot loader can need minutes for the
kernel; the tree's own test machines put the disk and the CD on AHCI
when UEFI is used (tools/vmsh.sh).
A serial console
The installer's boot configuration uses
com0 at 115200 baud, so a headless machine can be
installed from a terminal. Run QEMU with the serial line on the
terminal and no display:
qemu-system-x86_64 -enable-kvm -cpu host -smp 4 -m 4G \
-drive file=makronix.qcow2,if=ide,format=qcow2 \
-drive file=Makronix-0.99.10-amd64-dvd.iso,media=cdrom,readonly=on \
-boot order=dc -display none -serial mon:stdio
Ctrl-A C switches between the guest console
and the QEMU monitor; Ctrl-A X stops the machine.
After the installation, boot the disk with -boot order=c
and leave the CD out.
Which disk the installer shows
In the installer's disk menu, the device name tells you which
bus the disk is on:
ld0 — a VirtIO block
device (if=virtio). The fastest choice for a
Linux KVM host.
sd0 — SCSI, AHCI or a
VirtIO SCSI controller (the Proxmox default).
wd0 — the emulated IDE
controller (if=ide), which is the simplest but the
slowest.
After the reboot, remove the CD from the command line (or set
-boot order=c). The installed system starts from
the disk. The network is vioif0 for VirtIO and
wm0 or re0 for the emulated
cards; the installer's DHCP client configures it either way.
Proxmox VE
Proxmox VE runs QEMU with KVM and adds its own storage, snapshots
and a web console. A Makronix VM is an Other
guest; the
settings that matter are the machine type, the firmware, the disk bus and
the display.
In the web interface, create a VM with these values:
OS: the DVD image
Makronix-0.99.10-amd64-dvd.iso as the CD/DVD, guest
type Other
.
System: machine q35,
BIOS OVMF (UEFI), an EFI disk, Secure Boot off. For
a BIOS VM use machine i440fx and SeaBIOS
instead.
Disks: SCSI controller
VirtIO SCSI, 32 GiB. The guest sees it as
sd0.
CPU: type host,
4 cores. On a cluster with mixed CPUs, a named model such as
x86-64-v2-AES is needed for migration; it is slower
but portable.
Memory: 4096 MiB (2048 is the
minimum for a text installation).
Network: model
VirtIO, bridge vmbr0, firewall as
your network needs it.
Display: std,
and a serial port if you want the text console.
Boot order: CD/DVD first, the
SCSI disk second.
The same VM from the command line:
qm create 100 --name makronix --ostype other --machine q35 --bios ovmf \
--efidisk0 local-lvm:1,efitype=4m,pre-enrolled-keys=0 \
--cpu host --cores 4 --memory 4096 --scsihw virtio-scsi-pci \
--scsi0 local-lvm:32 \
--ide2 local:iso/Makronix-0.99.10-amd64-dvd.iso,media=cdrom \
--boot 'order=ide2;scsi0' --net0 virtio,bridge=vmbr0 \
--vga std --serial0 socket
qm start 100
local-lvm and local are
the storage names of your Proxmox installation; replace them with the
names in Datacenter > Storage. For a BIOS VM,
omit --bios ovmf and --efidisk0, use
--machine i440fx, and keep the same
--boot order.
Open the console with Console (noVNC) for the
graphical installer, or qm terminal 100 for the serial
one. If the web console shows the installer but the keyboard does not
work, click inside the console once; Proxmox forwards the keyboard only
after the console has the focus.
When the installation is finished, detach the ISO and boot the
disk:
qm set 100 --boot order=scsi0
qm set 100 --delete ide2
Agent and cloud-init: leave the QEMU guest
agent off unless you install it in the guest; Makronix does not ship it.
Proxmox's snapshots and backups work at the block level without it. For
a consistent backup of a running guest, stop it first or use the guest's
own backup; a block snapshot of a mounted file system is not a
transactional backup.
After the installation
The first boot is the same as on a physical machine: the MCDE login
screen, the account you created, and the network the installer
configured. In QEMU's user-mode network, the host reaches the guest's
SSH server through the forwarded port:
ssh -p 2222 user@127.0.0.1
In Proxmox, the guest is on the bridge and gets an address from the
network's DHCP server, or the fixed address you configure in the
installer. The serial console remains available with
qm terminal 100; log out of it with
Ctrl-O.
An encrypted installation works in a VM exactly as on hardware: the
installer asks for the passphrase, and every boot asks for it again. A
Proxmox snapshot of an encrypted guest is a snapshot of the encrypted
blocks; the passphrase is still needed to start it.
When the VM does not cooperate
The VM starts but the installer does not
appear. Check the boot order (CD before disk), and give the
firmware a moment: OVMF scans its devices before it reads the CD. With
UEFI, make sure the writable variable store is attached; a read-only
OVMF image cannot keep the boot entries.
UEFI is very slow. Move the disk
and the CD to AHCI (ich9-ahci in QEMU, VirtIO SCSI in
Proxmox). OVMF's IDE driver is the usual cause.
The desktop does not start. The
installer may have completed on a serial console with no VGA device.
Add -vga std (QEMU) or vga: std
(Proxmox), start the graphical installer, and use the full installation
way if the simple way cannot detect the display.
No network. QEMU's user-mode
network is NAT: the guest can reach out, and the host reaches the guest
only through a forwarded port. A bridged Proxmox VM behaves like a
machine on the LAN; check the bridge and the firewall.
The keyboard is wrong. The
installer asks for the keyboard layout; the MCDE session has its own
setting. A VM console that sends the wrong keys is usually a host
layout problem, not a guest one.