Skip to content

Running in Standalone Mode

This guide covers running a ToloMEO image on QEMU x86-64 in standalone mode, without the devcontainer build environment.


Table of Contents


Prerequisites

  • QEMU installed with qemu-system-x86_64 available
  • Build artifacts produced by following meta-tolomeo-qemu/README.md (includes disk provisioning with certificates)

Prepare Artifacts

Copy the following files from the artifacts directory to your working directory:

artifacts/tolomeo-qemux86-64
└── image-prod
    └── 1.0.0
        ├── bzImage
        ├── image-prod-tolomeo-qemux86-64.rootfs.ext4.gz
        ├── image-prod-tolomeo-qemux86-64.rootfs.qemuboot.conf
        └── ...

You need: bzImage and image-prod-tolomeo-qemux86-64.rootfs.ext4.gz.

Extract the root filesystem:

gunzip image-prod-tolomeo-qemux86-64.rootfs.ext4.gz

Prepare the Working Directory

Your working directory should contain the following before launching QEMU:

.
├── bzImage
├── image-prod-tolomeo-qemux86-64.rootfs.ext4
├── qemu-disk.img                               # provisioned disk with certificates
└── shared/                                     # local directory for shared mount

Create the shared directory if it does not exist:

mkdir -p shared

Run QEMU

Launch the VM with the following command:

qemu-system-x86_64 \
  -kernel bzImage \
  -append 'root=/dev/vda rw mem=1024M ip=dhcp console=ttyS0 console=ttyS1 oprofile.timer=1 tsc=reliable no_timer_check rcupdate.rcu_expedited=1 swiotlb=0 ' \
  -drive file=image-prod-tolomeo-qemux86-64.rootfs.ext4,if=virtio,format=raw \
  -drive file=qemu-disk.img,if=virtio,format=raw,id=qemu-disk \
  -virtfs local,path=shared,mount_tag=shared,security_model=mapped-xattr \
  -device virtio-net-pci,netdev=net0,mac=52:54:00:12:35:02 \
  -netdev user,id=net0,hostfwd=tcp:127.0.0.1:2222-:22,hostfwd=tcp:127.0.0.1:2323-:23 \
  -object rng-random,filename=/dev/urandom,id=rng0 \
  -device virtio-rng-pci,rng=rng0 \
  -cpu IvyBridge -machine q35,i8042=off \
  -smp 4 -m 1024 \
  -usb -device usb-tablet -usb -device usb-kbd \
  -serial mon:stdio -serial null -nographic

KVM acceleration: Add -enable-kvm for better performance. This may require sudo depending on your system configuration.


Connect via SSH

Once the VM has booted, connect as admin:

ssh -p 2222 admin@127.0.0.1